23#include <callbacks.hxx>
30#include <com/sun/star/beans/XPropertyChangeListener.hpp>
31#include <com/sun/star/container/XContainerListener.hpp>
32#include <com/sun/star/sdb/application/XDatabaseDocumentUI.hpp>
33#include <com/sun/star/ui/XContextMenuInterception.hpp>
59 class OComponentTransferable;
71 class SubComponentManager;
72 class OApplicationController;
73 class OApplicationView;
74 class OLinkedDocumentsAccess;
75 class SelectionNotifier;
78 , css::beans::XPropertyChangeListener
79 , css::sdb::application::XDatabaseDocumentUI
80 , css::ui::XContextMenuInterception
81 , css::view::XSelectionSupplier
92 typedef std::vector< css::uno::Reference< css::container::XContainer > >
TContainerVector;
99 css::uno::Reference< css::sdbc::XDatabaseMetaData >
103 css::uno::Reference< css::beans::XPropertySet >
105 css::uno::Reference< css::frame::XModel >
125 std::unique_ptr< SelectionNotifier >
155 const OUString& _sName,
158 sal_uInt16 _nInstigatorCommand,
159 const ::comphelper::NamedValueCollection& _rAdditionalArguments
168 css::uno::Reference< css::lang::XComponent >
171 const ::comphelper::NamedValueCollection& i_rAdditionalArguments,
172 css::uno::Reference< css::lang::XComponent >& o_rDocumentDefinition
214 const std::vector< OUString>& _rList,
221 void deleteTables(
const std::vector< OUString>& _rList);
283 void addContainerListener(
const css::uno::Reference< css::container::XNameAccess>& _xCollection);
289 void openDialog(
const OUString& _sServiceName);
300 const OUString& _rName,
301 const sal_Int32 _nType,
303 const css::uno::Reference< css::lang::XComponent >& _xDocument,
304 const css::uno::Reference< css::lang::XComponent >& _xDefinition
320 ,
const OUString& _sParentFolder
321 ,
bool _bCollection =
true
322 ,
const css::uno::Reference< css::ucb::XContent>& _xContent = css::uno::Reference< css::ucb::XContent>()
323 ,
bool _bMove =
false);
372 virtual void Execute(sal_uInt16 nId,
const css::uno::Sequence< css::beans::PropertyValue>& aArgs)
override;
375 virtual void onLoadedMenu(
const css::uno::Reference< css::frame::XLayoutManager >& _xLayoutManager )
override;
388 DECLARE_XTYPEPROVIDER( )
401 virtual
void SAL_CALL
elementInserted(const css::container::ContainerEvent& Event) override;
402 virtual
void SAL_CALL
elementRemoved(const css::container::ContainerEvent& Event) override;
403 virtual
void SAL_CALL
elementReplaced(const css::container::ContainerEvent& Event) override;
406 virtual
void SAL_CALL
propertyChange( const css::beans::PropertyChangeEvent& evt ) override;
415 virtual
void SAL_CALL
connect( ) override;
416 virtual css::beans::Pair< ::sal_Int32, OUString > SAL_CALL
identifySubComponent( const css::
uno::
Reference< css::lang::XComponent >& SubComponent ) override;
492 void containerFound(
const css::uno::Reference< css::container::XContainer >& _xContainer);
498 virtual bool requestQuickHelp(
const void* pUserData, OUString& rText)
const override;
506 virtual ::comphelper::OInterfaceContainerHelper2*
532 virtual void SAL_CALL
disposing(
const css::lang::EventObject& Source)
override;
535 virtual void SAL_CALL
disposing()
override;
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getApplicationMainWindow() override
PreviewMode m_ePreviewMode
virtual sal_Bool SAL_CALL suspend(sal_Bool bSuspend) override
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL releaseContextMenuInterceptor(const css::uno::Reference< css::ui::XContextMenuInterceptor > &Interceptor) override
bool isConnected() const
determines whether we're currently connected to the database
virtual void SAL_CALL removeSelectionChangeListener(const css::uno::Reference< css::view::XSelectionChangeListener > &xListener) override
ImplSVEvent * m_nAsyncDrop
virtual bool requestDrag(const weld::TreeIter &rEntry) override
handler for StartDrag requests
void onDeleteEntry()
called when a "Delete" command is executed in a tree view
virtual css::uno::Reference< css::lang::XComponent > SAL_CALL createComponent(::sal_Int32 ObjectType, css::uno::Reference< css::lang::XComponent > &o_DocumentDefinition) override
css::uno::Reference< css::container::XNameContainer > getQueryDefinitions() const
returns the query definitions of the active data source.
void addContainerListener(const css::uno::Reference< css::container::XNameAccess > &_xCollection)
adds a listener to the current name access.
void deleteTables(const std::vector< OUString > &_rList)
deletes tables.
const TransferableDataHelper & getViewClipboard() const
returns the system clipboard.
bool isRenameDeleteAllowed(ElementType _eType, bool _bDelete) const
checks if delete command or rename command is allowed
virtual void SAL_CALL addSelectionChangeListener(const css::uno::Reference< css::view::XSelectionChangeListener > &xListener) override
virtual ~OApplicationController() override
virtual css::uno::Reference< css::lang::XComponent > SAL_CALL loadComponent(::sal_Int32 ObjectType, const OUString &ObjectName, sal_Bool ForEditing) override
bool insertHierarchyElement(ElementType _eType, const OUString &_sParentFolder, bool _bCollection=true, const css::uno::Reference< css::ucb::XContent > &_xContent=css::uno::Reference< css::ucb::XContent >(), bool _bMove=false)
Inserts a new object into the hierarchy given be the type.
void pasteFormat(SotClipboardFormatId _nFormatId)
pastes a special format from the system clipboard to the currently selected object types
std::map< ElementType, std::vector< OUString > > SelectionByElementType
OApplicationController(const css::uno::Reference< css::uno::XComponentContext > &_rxORB)
virtual void SAL_CALL attachFrame(const css::uno::Reference< css::frame::XFrame > &xFrame) override
virtual void SAL_CALL registerContextMenuInterceptor(const css::uno::Reference< css::ui::XContextMenuInterceptor > &Interceptor) override
virtual css::uno::Reference< css::sdbc::XDataSource > SAL_CALL getDataSource() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
static void getSupportedFormats(ElementType _eType, std::vector< SotClipboardFormatId > &_rFormatIds)
fills the vector with all supported formats
void openDialog(const OUString &_sServiceName)
opens a uno dialog with the currently selected data source as initialize argument
static ElementType getElementType(const css::uno::Reference< css::container::XContainer > &_xContainer)
return the element type for given container
virtual sal_Bool SAL_CALL closeSubComponents() override
virtual void SAL_CALL elementInserted(const css::container::ContainerEvent &Event) override
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent &evt) override
void refreshTables()
refreshes the tables
void renameEntry()
renames the selected entry in the detail page
void OnInvalidateClipboard()
void askToReconnect()
when the settings of the data source changed, it opens a dialog which ask to close all depending docu...
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getActiveConnection() override
virtual void SAL_CALL elementRemoved(const css::container::ContainerEvent &Event) override
std::unique_ptr< SelectionNotifier > m_pSelectionNotifier
virtual void SAL_CALL elementReplaced(const css::container::ContainerEvent &Event) override
void deleteObjects(ElementType _eType, const std::vector< OUString > &_rList, bool _bConfirm)
deletes queries, forms, or reports
virtual ::comphelper::OInterfaceContainerHelper2 * getContextMenuInterceptors() override
returns the container of registered context menu interceptors, or NULL if the implementation does not...
OTableCopyHelper::DropDescriptor m_aAsyncDrop
virtual css::uno::Reference< css::lang::XComponent > SAL_CALL loadComponentWithArguments(::sal_Int32 ObjectType, const OUString &ObjectName, sal_Bool ForEditing, const css::uno::Sequence< css::beans::PropertyValue > &Arguments) override
void OnFirstControllerConnected()
DECL_LINK(OnClipboardChanged, TransferableDataHelper *, void)
virtual css::uno::Any SAL_CALL getSelection() override
bool isConnectionReadOnly() const
checks if the connection for the selected data source is read only.
css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData
void impl_validateObjectTypeAndName_throw(const sal_Int32 _nObjectType, const ::std::optional< OUString > &i_rObjectName)
verifies the object type denotes a valid DatabaseObject, and the object name denotes an existing obje...
void newElementWithPilot(ElementType _eType)
creates a new database object, using an auto pilot
virtual OUString getContextMenuResourceName() const override
returns the context menu resource name for the control
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
virtual css::uno::Reference< css::lang::XComponent > SAL_CALL createComponentWithArguments(::sal_Int32 ObjectType, const css::uno::Sequence< css::beans::PropertyValue > &Arguments, css::uno::Reference< css::lang::XComponent > &o_DocumentDefinition) override
virtual bool isDataSourceReadOnly() const override
checks if the selected data source is read only
SelectionByElementType m_aPendingSelection
virtual css::uno::Reference< css::frame::XModel > getPrivateModel() const override
virtual sal_Int8 queryDrop(const AcceptDropEvent &_rEvt, const DataFlavorExVector &_rFlavors) override
check whether or not a drop request should be accepted
virtual sal_Int8 executeDrop(const ExecuteDropEvent &_rEvt) override
execute a drop request
css::uno::Reference< css::lang::XComponent > newElement(ElementType _eType, const ::comphelper::NamedValueCollection &i_rAdditionalArguments, css::uno::Reference< css::lang::XComponent > &o_rDocumentDefinition)
opens a new frame for creation or auto pilot
OTableCopyHelper m_aTableCopyHelper
void showPreviewFor(const ElementType _eType, const OUString &_sName)
shows the preview for the given entry
bool copySQLObject(ODataClipboard &rExchange)
fills rExchange with current object if it's a Table or Query
std::vector< css::uno::Reference< css::container::XContainer > > TContainerVector
void disconnect()
disconnects from our XConnection, and cleans up this connection
virtual css::uno::Any getCurrentSelection(weld::TreeView &rControl) const override
returns the current selection in the given control
virtual bool Construct(vcl::Window *pParent) override
DECL_LINK(OnSelectContainer, void *, void)
virtual void SAL_CALL disposing() override
bool onContainerSelect(ElementType _eType)
called when a container (category) in the application view has been selected
virtual sal_Bool SAL_CALL isConnected() override
void onDocumentOpened(const OUString &_rName, const sal_Int32 _nType, const ElementOpenMode _eMode, const css::uno::Reference< css::lang::XComponent > &_xDocument, const css::uno::Reference< css::lang::XComponent > &_xDefinition)
remember a newly opened sub document for later access
void onSelectionChanged()
called when an entry in a tree view has been selected
const SharedConnection & ensureConnection(::dbtools::SQLExceptionInfo *_pErrorInfo=nullptr)
retrieves the current connection, creates it if necessary
DECL_LINK(OnAsyncDrop, void *, void)
bool paste(ElementType _eType, const svx::ODataAccessDescriptor &_rPasteData, const OUString &_sParentFolder=OUString(), bool _bMove=false)
pastes a query, form or report into the data source
rtl::Reference< TransferableHelper > copyObject()
copies the current object into clipboard
virtual css::uno::Reference< css::frame::XModel > SAL_CALL getModel() 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 css::beans::Pair< ::sal_Int32, OUString > SAL_CALL identifySubComponent(const css::uno::Reference< css::lang::XComponent > &SubComponent) override
ElementType m_eCurrentType
rtl::Reference< TransferableClipboardListener > m_pClipboardNotifier
void deleteEntries()
deletes the entries selected.
void containerFound(const css::uno::Reference< css::container::XContainer > &_xContainer)
called when an object container of any kind was found during enumerating tree view elements
const SharedConnection & getConnection() const
retrieves the current connection
css::uno::Reference< css::beans::XPropertySet > m_xDataSource
void getSelectionElementNames(std::vector< OUString > &_rNames) const
fills the list with the selected entries.
void convertToView(const OUString &_sName)
converts the query to a view
std::unique_ptr< OLinkedDocumentsAccess > getDocumentsAccess(ElementType _eType)
returns the document access for the specific type
virtual css::uno::Sequence< css::uno::Reference< css::lang::XComponent > > SAL_CALL getSubComponents() override
OAsynchronousLink m_aSelectContainerEvent
css::uno::Reference< css::lang::XComponent > openElementWithArguments(const OUString &_sName, ElementType _eType, ElementOpenMode _eOpenMode, sal_uInt16 _nInstigatorCommand, const ::comphelper::NamedValueCollection &_rAdditionalArguments)
opens a new sub frame with a table/query/form/report/view, passing additional arguments
::comphelper::OInterfaceContainerHelper2 m_aContextMenuInterceptors
DECL_LINK(OnCreateWithPilot, void *, void)
virtual void SAL_CALL connect() override
virtual void Execute(sal_uInt16 nId, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
bool impl_isAlterableView_nothrow(const OUString &_rTableOrViewName) const
determines whether the given table name denotes a view which can be altered
virtual FeatureState GetState(sal_uInt16 nId) const override
TransferableDataHelper m_aSystemClipboard
void onPasteEntry()
called when a "Paste" command is executed in a tree view
void previewChanged(sal_Int32 _nMode)
called when the preview mode was changed
virtual void onLoadedMenu(const css::uno::Reference< css::frame::XLayoutManager > &_xLayoutManager) override
called when our menu has been loaded into our frame, can be used to load sub toolbars
void doAction(sal_uInt16 _nId, ElementOpenMode _eOpenMode)
all selected entries will be opened, or edited, or converted to a view
css::uno::Reference< css::frame::XModel > m_xModel
bool copyDocObject(svx::OComponentTransferable &rExchange)
fills rExchange with current object if it's a Form or Report
OUString getStrippedDatabaseName() const
returns the stripped database name.
OUString getDatabaseName() const
returns the database name
void onCopyEntry()
called when a "Copy" command is executed in a tree view
css::uno::Reference< css::container::XNameAccess > getElements(ElementType _eType)
returns the nameaccess
::rtl::Reference< SubComponentManager > m_pSubComponentManager
bool isTableFormat() const
returns <TRUE> if the clipboard supports a table format, otherwise <FALSE>.
virtual void describeSupportedFeatures() override
OApplicationView * getContainer() const
virtual sal_Bool SAL_CALL select(const css::uno::Any &xSelection) override
::dbaccess::ODsnTypeCollection m_aTypeCollection
void onAttachedFrame()
called we were attached to a frame
virtual sal_Bool SAL_CALL attachModel(const css::uno::Reference< css::frame::XModel > &xModel) override
bool onEntryDoubleClick(const weld::TreeView &rTree)
called when an entry in a tree list box has been double-clicked
OUString getCurrentlySelectedName(sal_Int32 &_rnCommandType) const
returns the currently selected table or query name.
SharedConnection m_xDataSourceConnection
virtual IController & getCommandController() override
returns the controller which is responsible for providing states of certain features,...
TContainerVector m_aCurrentContainers
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
handles asynchronous links which may be called in multi-threaded environments If you use an instance ...
css::uno::Reference< css::sdbc::XConnection > connect(const css::uno::Reference< css::sdbc::XDataSource > &_xDataSource)
::std::vector< DataFlavorEx > DataFlavorExVector
::cppu::ImplHelper5< css::container::XContainerListener, css::beans::XPropertyChangeListener, css::sdb::application::XDatabaseDocumentUI, css::ui::XContextMenuInterception, css::view::XSelectionSupplier > OApplicationController_Base
describes the state of a feature
Reference< XFrame > xFrame
the frame which the component resides in. Must not be <NULL>
Reference< XModel > xModel
the model of the sub component. Might be <NULL>
#define DECLARE_XINTERFACE()