24#include <svx/strings.hrc>
25#include <svx/svxids.hrc>
26#include <com/sun/star/sdb/CommandType.hpp>
27#include <com/sun/star/sdbc/XConnection.hpp>
66 : sColumnName(std::move(i_sColumnName))
73 const uno::Sequence< OUString >
aEntries = i_xColumns->getElementNames();
74 for (
const OUString& rEntry :
aEntries )
76 uno::Reference< beans::XPropertySet>
xColumn(i_xColumns->getByName(rEntry),UNO_QUERY_THROW);
82 if ( !sLabel.isEmpty() )
91 rUnsetDragIcon =
false;
93 ColumnInfo* pSelected = weld::fromId<ColumnInfo*>(m_xListBox->get_selected_id());
101 aDescriptor[ DataAccessDescriptorProperty::DataSource ] <<= GetDatabaseName();
102 aDescriptor[ DataAccessDescriptorProperty::Connection ] <<= GetConnection().getTyped();
103 aDescriptor[ DataAccessDescriptorProperty::Command ] <<= GetObjectName();
104 aDescriptor[ DataAccessDescriptorProperty::CommandType ]<<= GetObjectType();
105 aDescriptor[ DataAccessDescriptorProperty::ColumnName ] <<= pSelected->sColumnName;
107 m_xHelper->setDescriptor(aDescriptor);
116 , m_xListBox(m_xBuilder->weld_tree_view(
"treeview"))
149 return createSelectionControls();
158 ODataAccessDescriptor aDescr;
163 aDescr[ DataAccessDescriptorProperty::Command ] <<=
GetObjectName();
164 aDescr[ DataAccessDescriptorProperty::CommandType ] <<=
GetObjectType();
165 aDescr[ DataAccessDescriptorProperty::ColumnName ] <<= pSelected->sColumnName;
168 SfxUnoAnyItem aDescriptorItem( SID_FM_DATACCESS_DESCRIPTOR,
Any( aDescr.createPropertyValueSequence() ) );
171 &aDescriptorItem,
nullptr
178 return nullptr != pSelected;
183 css::uno::Reference< css::form::XForm > xForm(evt.Source, css::uno::UNO_QUERY);
189 if (!pState || SID_FM_FIELDS_CONTROL != nSID)
192 if (eState >= SfxItemState::DEFAULT)
205 OUString aTitle(
SvxResId(RID_STR_FIELDSELECTION));
208 if (!pShell || !pShell->
GetImpl())
211 Reference<XForm>
const xForm = pShell->
GetImpl()->getCurrentForm_Lock();
223 OUString aTitle(
SvxResId(RID_STR_FIELDSELECTION));
229 Reference< XPropertySet > xSet(xForm, UNO_QUERY);
237 connectRowset( Reference< XRowSet >( xForm, UNO_QUERY ), ::comphelper::getProcessComponentContext(),
nullptr ),
248 Reference< XComponent > xKeepFieldsAlive;
259 case CommandType::TABLE:
260 aPrefix =
SvxResId(RID_RSC_TABWIN_PREFIX[0]);
262 case CommandType::QUERY:
263 aPrefix =
SvxResId(RID_RSC_TABWIN_PREFIX[1]);
266 aPrefix =
SvxResId(RID_RSC_TABWIN_PREFIX[2]);
303 auto xDlg = std::make_shared<FmFieldWin>(_pBindings,
this, _pParent->GetFrameWeld());
305 SetHideNotDelete(
true);
306 xDlg->Initialize(_pInfo);
Reference< XExecutableDialog > m_xDialog
const OUString & GetObjectName() const
const ::dbtools::SharedConnection & GetConnection() const
SfxBindings & GetBindings()
virtual void _propertyChanged(const css::beans::PropertyChangeEvent &evt) override
std::vector< std::unique_ptr< ColumnInfo > > m_aListBoxData
::dbtools::SharedConnection m_aConnection
sal_Int32 GetObjectType() const
bool createSelectionControls()
rtl::Reference< svx::OColumnTransferable > m_xHelper
virtual void StateChangedAtToolBoxControl(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override
virtual ~FmFieldWin() override
const OUString & GetDatabaseName() const
std::unique_ptr< weld::TreeView > m_xListBox
void UpdateContent(FmFormShell const *)
rtl::Reference< comphelper::OPropertyChangeMultiplexer2 > m_xChangeListener
FmFieldWin(SfxBindings *pBindings, SfxChildWindow *pMgr, weld::Window *pParent)
void FillInfo(SfxChildWinInfo &rInfo) const override
void addToList(const css::uno::Reference< css::container::XNameAccess > &i_xColumns)
bool Execute(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr, SfxCallMode nCall=SfxCallMode::SLOT)
class encapsulating the css::sdb::DataAccessDescriptor service.
const css::uno::Reference< INTERFACE > & getTyped() const
void reset(const css::uno::Reference< INTERFACE > &_rxComponent, AssignmentMode _eMode=TakeOwnership)
#define TOOLS_WARN_EXCEPTION(area, stream)
OUString SvxResId(TranslateId aId)
ScXMLEditAttributeMap::Entry const aEntries[]
constexpr OUStringLiteral FM_PROP_COMMAND
constexpr OUStringLiteral FM_PROP_LABEL
constexpr OUStringLiteral FM_PROP_COMMANDTYPE
constexpr OUStringLiteral FM_PROP_DATASOURCE
constexpr OUStringLiteral HID_FIELD_SEL_WIN
constexpr OUStringLiteral HID_FIELD_SEL
#define LINK(Instance, Class, Member)
class SvxPropertySetInfoPool
OUString toId(const void *pValue)
SFX_IMPL_MODELESSDIALOGCONTOLLER(SfxRecordingFloatWrapper_Impl, SID_RECORDING_FLOATWINDOW)
const tools::Long STD_WIN_SIZE_Y
IMPL_LINK(FmFieldWin, DragBeginHdl, bool &, rUnsetDragIcon, bool)
const tools::Long STD_WIN_SIZE_X
IMPL_LINK_NOARG(FmFieldWin, RowActivatedHdl, weld::TreeView &, bool)