24#include <com/sun/star/frame/XStatusListener.hpp>
25#include <com/sun/star/frame/XDispatch.hpp>
26#include <com/sun/star/i18n/XCollator.hpp>
27#include <com/sun/star/view/XSelectionSupplier.hpp>
28#include <com/sun/star/awt/XWindow.hpp>
29#include <com/sun/star/document/XScriptInvocationContext.hpp>
30#include <com/sun/star/ui/XContextMenuInterception.hpp>
31#include <com/sun/star/sdb/application/DatabaseObject.hpp>
32#include <com/sun/star/sdb/application/DatabaseObjectContainer.hpp>
33#include <com/sun/star/sdb/XDatabaseRegistrationsListener.hpp>
50 struct DBTreeEditedEntry;
51 struct DBTreeListUserData;
55 , css::view::XSelectionSupplier
56 , css::document::XScriptInvocationContext
57 , css::ui::XContextMenuInterception
58 , css::sdb::XDatabaseRegistrationsListener
73 css::uno::Reference< css::frame::XDispatch >
105 ::std::optional< bool >
118 etDatasource = css::sdb::application::DatabaseObjectContainer::DATA_SOURCE,
136 virtual css::uno::Any SAL_CALL
queryInterface(
const css::uno::Type& _rType)
override;
139 virtual css::uno::Sequence< css::uno::Type > SAL_CALL
getTypes( )
override;
143 virtual void SAL_CALL
propertyChange(
const css::beans::PropertyChangeEvent& evt)
override;
147 virtual void SAL_CALL
attachFrame(
const css::uno::Reference< css::frame::XFrame > &
xFrame)
override;
150 virtual void SAL_CALL
disposing()
override;
153 virtual void SAL_CALL
statusChanged(
const css::frame::FeatureStateEvent& Event )
override;
156 virtual void SAL_CALL
disposing(
const css::lang::EventObject& Source )
override;
160 virtual css::uno::Any SAL_CALL
getSelection( )
override;
161 virtual void SAL_CALL
addSelectionChangeListener(
const css::uno::Reference< css::view::XSelectionChangeListener >& xListener )
override;
169 virtual void SAL_CALL
elementInserted(
const css::container::ContainerEvent& Event )
override;
170 virtual void SAL_CALL
elementRemoved(
const css::container::ContainerEvent& Event )
override;
171 virtual void SAL_CALL
elementReplaced(
const css::container::ContainerEvent& Event )
override;
173 virtual void SAL_CALL
frameAction(
const css::frame::FrameActionEvent& aEvent)
override;
176 virtual css::uno::Reference< css::document::XEmbeddedScripts > SAL_CALL
getScriptContainer()
override;
189 virtual bool InitializeForm(
const css::uno::Reference< css::beans::XPropertySet >& i_formProperties )
override;
196 virtual void addModelListeners(
const css::uno::Reference< css::awt::XControlModel > & _xGridControlModel)
override;
197 virtual void removeModelListeners(
const css::uno::Reference< css::awt::XControlModel > & _xGridControlModel)
override;
199 virtual void AddColumnListener(
const css::uno::Reference< css::beans::XPropertySet > & xCol)
override;
200 virtual void RemoveColumnListener(
const css::uno::Reference< css::beans::XPropertySet > & xCol)
override;
208 virtual void Execute(sal_uInt16 nId,
const css::uno::Sequence< css::beans::PropertyValue>& aArgs)
override;
211 virtual bool requestQuickHelp(
const void* pUserData, OUString& rText)
const override;
219 virtual ::comphelper::OInterfaceContainerHelper2*
246 virtual void loadMenu(
const css::uno::Reference< css::frame::XFrame >& _xFrame)
override;
266 OUString& _rQueryName, OUString& _rQueryImage,
267 OUString& _rTableName, OUString& _rTableImage,
303 std::unique_ptr<weld::TreeIter>
getEntryFromContainer(
const css::uno::Reference<css::container::XNameAccess>& rxNameAccess);
347 const OUString& _rDataSourceName,
348 const OUString& _rCommand,
349 const sal_Int32 _nCommandType,
350 const bool _bEscapeProcessing,
359 const OUString& rName,
363 bool implLoadAnything(
const OUString& _rDataSourceName,
const OUString& _rCommand,
364 const sal_Int32 _nCommandType,
const bool _bEscapeProcessing,
const SharedConnection& _rxConnection );
375 std::unique_ptr<weld::TreeIter>* ppDataSourceEntry, std::unique_ptr<weld::TreeIter>* ppContainerEntry
394 const OUString& rDataSource,
const OUString& rCommand, sal_Int32 nCommandType,
395 std::unique_ptr<weld::TreeIter>* ppDataSourceEntry, std::unique_ptr<weld::TreeIter>* ppContainerEntry,
396 bool _bExpandAncestors =
true,
404 OUString& _rDataSource, OUString& _rCommand, sal_Int32& _rCommandType,
bool& _rEscapeProcessing);
424 static void clearGridColumns(
const css::uno::Reference< css::container::XNameContainer >& _xColContainer);
virtual IController & getCommandController() override
returns the controller which is responsible for providing states of certain features,...
css::uno::Reference< css::i18n::XCollator > m_xCollator
void transferChangedControlProperty(const OUString &_rProperty, const css::uno::Any &_rNewValue)
void clearTreeModel()
clears the tree list box
virtual void criticalFail() override
DECL_LINK(OnAsyncDrop, void *, void)
void checkDocumentDataSource()
checks if m_aDocumentDataSource describes a known object
::comphelper::OInterfaceContainerHelper2 m_aSelectionListeners
void impl_cleanupDataSourceEntry(std::u16string_view _rDataSourceName)
removes (and cleans up) the entry for the given data source
virtual sal_Int8 executeDrop(const ExecuteDropEvent &_rEvt) override
execute a drop request
virtual void addModelListeners(const css::uno::Reference< css::awt::XControlModel > &_xGridControlModel) override
svx::ODataAccessDescriptor m_aDocumentDataSource
void impl_sanitizeRowSetClauses_nothrow()
checks whether the Order/Filter clauses set at our row set are valid, removes them if not so
void InitializeGridModel(const css::uno::Reference< css::form::XFormComponent > &xGrid)
virtual void SAL_CALL elementInserted(const css::container::ContainerEvent &Event) override
void initializePreviewMode()
called whenever the content of the browser is used for preview, as the very last action of the load p...
VclPtr< Splitter > m_pSplitter
void closeConnection(const weld::TreeIter &rEntry, bool bDisposeConnection=true)
close the connection (and collapse the list entries) of the given list entries
std::map< sal_uInt16, ExternalFeature > ExternalFeaturesMap
bool m_bQueryEscapeProcessing
void populateTree(const css::uno::Reference< css::container::XNameAccess > &xNameAccess, const weld::TreeIter &rParent, EntryType eEntryType)
DECL_LINK(OnSelectionChange, LinkParamNone *, void)
css::uno::Reference< css::awt::XWindow > m_xMainToolbar
void disposeConnection(const weld::TreeIter *xpDSEntry)
bool haveExplorer() const
void implAdministrate(const weld::TreeIter &rApplyTo)
void implRemoveStatusListeners()
EntryType getChildType(const weld::TreeIter &rEntry) const
::comphelper::OInterfaceContainerHelper2 m_aContextMenuInterceptors
virtual ~SbaTableQueryBrowser() override
bool ensureConnection(const weld::TreeIter *pDSEntry, void *pDSData, SharedConnection &rConnection)
void selectPath(const weld::TreeIter *pEntry, bool bSelect=true)
virtual FeatureState GetState(sal_uInt16 nId) const override
virtual bool Construct(vcl::Window *pParent) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void implAddDatasource(const OUString &_rDbName, OUString &_rDbImage, OUString &_rQueryName, OUString &_rQueryImage, OUString &_rTableName, OUString &_rTableImage, const SharedConnection &_rxConnection)
add an entry (including the subentries for queries/tables) to the list model
virtual css::uno::Any SAL_CALL getSelection() override
virtual void SAL_CALL attachFrame(const css::uno::Reference< css::frame::XFrame > &xFrame) override
virtual void AddColumnListener(const css::uno::Reference< css::beans::XPropertySet > &xCol) override
bool isCurrentlyDisplayedChanged(std::u16string_view rName, const weld::TreeIter &rContainer)
checks if the currently displayed entry changed
std::unique_ptr< weld::TreeIter > getObjectEntry(const svx::ODataAccessDescriptor &rDescriptor, std::unique_ptr< weld::TreeIter > *ppDataSourceEntry, std::unique_ptr< weld::TreeIter > *ppContainerEntry)
retrieves the tree entry for the object described by <arg>_rDescriptor</arg>
static bool isObject(EntryType _eType)
virtual sal_Bool SAL_CALL select(const css::uno::Any &aSelection) override
VclPtr< InterimDBTreeListBox > m_pTreeView
virtual void SAL_CALL disposing() override
virtual OUString getContextMenuResourceName() const override
returns the context menu resource name for the control
virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent &Event) override
bool isEntryCopyAllowed(const weld::TreeIter &rEntry) const
int OnTreeEntryCompare(const weld::TreeIter &rLHS, const weld::TreeIter &rRHS)
static void clearGridColumns(const css::uno::Reference< css::container::XNameContainer > &_xColContainer)
bool getExternalSlotState(sal_uInt16 _nId) const
get the state of an external slot
virtual void removeModelListeners(const css::uno::Reference< css::awt::XControlModel > &_xGridControlModel) override
void initializeTreeModel()
static sal_Int32 getDatabaseObjectType(EntryType _eType)
returns a DatabaseObject value corresponding to the given EntryType
bool ensureEntryObject(const weld::TreeIter &rEntry)
std::unique_ptr< weld::TreeIter > getEntryFromContainer(const css::uno::Reference< css::container::XNameAccess > &rxNameAccess)
search in the tree for query- or tablecontainer equal to this interface and return this container ent...
DECL_LINK(OnCopyEntry, LinkParamNone *, void)
bool implSelect(const svx::ODataAccessDescriptor &_rDescriptor, bool _bSelectDirect=false)
bool getExistentConnectionFor(const weld::TreeIter *pDSEntry, SharedConnection &rConnection)
virtual sal_Bool SAL_CALL suspend(sal_Bool bSuspend) override
virtual void SAL_CALL addSelectionChangeListener(const css::uno::Reference< css::view::XSelectionChangeListener > &xListener) override
virtual bool preReloadForm() override
DECL_LINK(OnExpandEntry, const weld::TreeIter &, bool)
virtual bool InitializeForm(const css::uno::Reference< css::beans::XPropertySet > &i_formProperties) override
virtual void SAL_CALL changedDatabaseLocation(const css::sdb::DatabaseRegistrationEvent &Event) override
virtual ::comphelper::OInterfaceContainerHelper2 * getContextMenuInterceptors() override
returns the container of registered context menu interceptors, or NULL if the implementation does not...
SbaTableQueryBrowser(const css::uno::Reference< css::uno::XComponentContext > &_rM)
virtual void SAL_CALL revokedDatabaseLocation(const css::sdb::DatabaseRegistrationEvent &Event) override
std::unique_ptr< ImageProvider > getImageProviderFor(const weld::TreeIter *pAnyEntry)
returns an image provider which works with the connection belonging to the given entry
virtual css::uno::Reference< css::document::XEmbeddedScripts > SAL_CALL getScriptContainer() override
void impl_releaseConnection(SharedConnection &_rxConnection)
flushes and disposes the given connection, and de-registers as listener
OTableCopyHelper::DropDescriptor m_aAsyncDrop
bool impl_isDataSourceEntry(const weld::TreeIter *pEntry) const
::std::optional< bool > m_aDocScriptSupport
virtual void loadMenu(const css::uno::Reference< css::frame::XFrame > &_xFrame) override
virtual void SAL_CALL elementRemoved(const css::container::ContainerEvent &Event) override
virtual vcl::Window * getMenuParent() const override
virtual bool requestQuickHelp(const void *pUserData, OUString &rText) const override
requests a quick help text to display
virtual void SAL_CALL frameAction(const css::frame::FrameActionEvent &aEvent) override
std::unique_ptr< weld::TreeIter > m_xCurrentlyDisplayed
virtual void describeSupportedFeatures() override
bool implCopyObject(ODataClipboard &rExchange, const weld::TreeIter &rApplyTo, sal_Int32 nCommandType)
OUString getDataSourceAccessor(const weld::TreeIter &rDataSourceEntry) const
retrieves the data source URL/name for the given entry representing a data source
std::unique_ptr< weld::TreeIter > implGetConnectionEntry(const weld::TreeIter &rEntry) const
virtual sal_Int8 queryDrop(const AcceptDropEvent &_rEvt, const DataFlavorExVector &_rFlavors) override
check whether or not a drop request should be accepted
css::uno::Reference< css::frame::XFrame > m_xCurrentFrameParent
virtual bool requestDrag(const weld::TreeIter &rEntry) override
handler for StartDrag requests
OUString GetEntryText(const weld::TreeIter &rEntry) const
ImplSVEvent * m_nAsyncDrop
virtual void SAL_CALL registerContextMenuInterceptor(const css::uno::Reference< css::ui::XContextMenuInterceptor > &Interceptor) override
static void extractDescriptorProps(const svx::ODataAccessDescriptor &_rDescriptor, OUString &_rDataSource, OUString &_rCommand, sal_Int32 &_rCommandType, bool &_rEscapeProcessing)
virtual void SAL_CALL releaseContextMenuInterceptor(const css::uno::Reference< css::ui::XContextMenuInterceptor > &Interceptor) override
std::unique_ptr< weld::TreeIter > implAppendEntry(const weld::TreeIter *pParent, const OUString &rName, const DBTreeListUserData *pUserData)
inserts an entry into the tree
static bool isContainer(EntryType _eType)
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent &evt) override
virtual void ColumnChanged() override
virtual OUString getPrivateTitle() const override
virtual void SAL_CALL elementReplaced(const css::container::ContainerEvent &Event) override
ExternalFeaturesMap m_aExternalFeatures
void copyEntry(const weld::TreeIter &rEntry)
bool isContainer(const weld::TreeIter &rEntry) const
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual void SelectionChanged() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
bool implGetQuerySignature(OUString &_rCommand, bool &_bEscapeProcessing)
get the signature (command/escape processing) of the query the form is based on
virtual OUString SAL_CALL getImplementationName() override
virtual void impl_initialize() override
EntryType getEntryType(const weld::TreeIter &rEntry) const
virtual void postReloadForm() override
virtual void adjustMenuPosition(const weld::TreeView &rControl, ::Point &rPos) const override
adjust rPos which is initially relative to rControl to be relative to the window of getMenuParent
void implCheckExternalSlot(sal_uInt16 _nId)
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &_rType) override
bool isSelected(const weld::TreeIter &rEntry) const
bool implLoadAnything(const OUString &_rDataSourceName, const OUString &_rCommand, const sal_Int32 _nCommandType, const bool _bEscapeProcessing, const SharedConnection &_rxConnection)
loads the grid control with the data object specified (which may be a table, a query or a command)
virtual void SAL_CALL removeSelectionChangeListener(const css::uno::Reference< css::view::XSelectionChangeListener > &xListener) override
void unloadAndCleanup(bool _bDisposeConnection=true)
unloads the form, empties the grid model, cleans up anything related to the currently displayed objec...
virtual void Execute(sal_uInt16 nId, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
virtual void RowChanged() override
virtual css::uno::Any getCurrentSelection(weld::TreeView &rControl) const override
returns the current selection in the given control
void connectExternalDispatches()
OTableCopyHelper m_aTableCopyHelper
virtual void SAL_CALL registeredDatabaseLocation(const css::sdb::DatabaseRegistrationEvent &Event) override
virtual void RemoveColumnListener(const css::uno::Reference< css::beans::XPropertySet > &xCol) override
virtual void LoadFinished(bool _bWasSynch) override
::std::vector< DataFlavorEx > DataFlavorExVector
::cppu::ImplHelper5< css::frame::XStatusListener, css::view::XSelectionSupplier, css::document::XScriptInvocationContext, css::ui::XContextMenuInterception, css::sdb::XDatabaseRegistrationsListener > SbaTableQueryBrowser_Base
::utl::SharedUNOComponent< css::sdbc::XConnection > SharedConnection
describes the state of a feature
ExternalFeature(css::util::URL _aURL)
css::uno::Reference< css::frame::XDispatch > xDispatcher
Reference< XFrame > xFrame
the frame which the component resides in. Must not be <NULL>
#define DECLARE_UNO3_DEFAULTS(classname, baseclass)