LibreOffice Module dbaccess (master) 1
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
dbaccess::OQueryContainer Class Reference

#include <querycontainer.hxx>

Inheritance diagram for dbaccess::OQueryContainer:
[legend]
Collaboration diagram for dbaccess::OQueryContainer:
[legend]

Classes

class  OAutoActionReset
 

Public Member Functions

 DECLARE_SERVICE_INFO ()
 
virtual void SAL_CALL elementInserted (const css::container::ContainerEvent &Event) override
 
virtual void SAL_CALL elementRemoved (const css::container::ContainerEvent &Event) override
 
virtual void SAL_CALL elementReplaced (const css::container::ContainerEvent &Event) override
 
virtual css::uno::Reference< css::util::XVeto > SAL_CALL approveInsertElement (const css::container::ContainerEvent &Event) override
 
virtual css::uno::Reference< css::util::XVeto > SAL_CALL approveReplaceElement (const css::container::ContainerEvent &Event) override
 
virtual css::uno::Reference< css::util::XVeto > SAL_CALL approveRemoveElement (const css::container::ContainerEvent &Event) override
 
virtual void SAL_CALL disposing (const css::lang::EventObject &Source) override
 
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL createDataDescriptor () override
 
virtual void SAL_CALL appendByDescriptor (const css::uno::Reference< css::beans::XPropertySet > &descriptor) override
 
virtual void SAL_CALL dropByName (const OUString &elementName) override
 
virtual void SAL_CALL dropByIndex (sal_Int32 index) override
 
virtual sal_Bool SAL_CALL hasElements () override
 
virtual sal_Int32 SAL_CALL getCount () override
 
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames () override
 
- Public Member Functions inherited from dbaccess::ODefinitionContainer
 ODefinitionContainer (const css::uno::Reference< css::uno::XComponentContext > &_xORB, const css::uno::Reference< css::uno::XInterface > &_xParentContainer, const TContentPtr &_pImpl, bool _bCheckSlash=true)
 constructs the container. More...
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () override
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () override
 
virtual OUString SAL_CALL getImplementationName () override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 
virtual css::uno::Type SAL_CALL getElementType () override
 
virtual sal_Bool SAL_CALL hasElements () override
 
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration () override
 
virtual sal_Int32 SAL_CALL getCount () override
 
virtual css::uno::Any SAL_CALL getByIndex (sal_Int32 _nIndex) override
 
virtual void SAL_CALL insertByName (const OUString &_rName, const css::uno::Any &aElement) override
 
virtual void SAL_CALL removeByName (const OUString &_rName) override
 
virtual void SAL_CALL replaceByName (const OUString &_rName, const css::uno::Any &aElement) override
 
virtual css::uno::Any SAL_CALL getByName (const OUString &aName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames () override
 
virtual sal_Bool SAL_CALL hasByName (const OUString &aName) override
 
virtual void SAL_CALL addContainerListener (const css::uno::Reference< css::container::XContainerListener > &xListener) override
 
virtual void SAL_CALL removeContainerListener (const css::uno::Reference< css::container::XContainerListener > &xListener) override
 
virtual void SAL_CALL addContainerApproveListener (const css::uno::Reference< css::container::XContainerApproveListener > &Listener) override
 
virtual void SAL_CALL removeContainerApproveListener (const css::uno::Reference< css::container::XContainerApproveListener > &Listener) override
 
virtual void SAL_CALL disposing (const css::lang::EventObject &Source) override
 
virtual void SAL_CALL propertyChange (const css::beans::PropertyChangeEvent &evt) override
 
virtual void SAL_CALL vetoableChange (const css::beans::PropertyChangeEvent &aEvent) override
 
- Public Member Functions inherited from dbaccess::OContentHelper
 OContentHelper (const css::uno::Reference< css::uno::XComponentContext > &_xORB, const css::uno::Reference< css::uno::XInterface > &_xParentContainer, TContentPtr _pImpl)
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () override
 
virtual sal_Bool SAL_CALL supportsService (const OUString &ServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 
virtual OUString SAL_CALL getImplementationName () override
 
virtual css::uno::Reference< css::ucb::XContentIdentifier > SAL_CALL getIdentifier () override
 
virtual OUString SAL_CALL getContentType () override
 
virtual void SAL_CALL addContentEventListener (const css::uno::Reference< css::ucb::XContentEventListener > &Listener) override
 
virtual void SAL_CALL removeContentEventListener (const css::uno::Reference< css::ucb::XContentEventListener > &Listener) override
 
virtual sal_Int32 SAL_CALL createCommandIdentifier () override
 
virtual css::uno::Any SAL_CALL execute (const css::ucb::Command &aCommand, sal_Int32 CommandId, const css::uno::Reference< css::ucb::XCommandEnvironment > &Environment) override
 
virtual void SAL_CALL abort (sal_Int32 CommandId) override
 
virtual void SAL_CALL addPropertiesChangeListener (const css::uno::Sequence< OUString > &PropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &Listener) override
 
virtual void SAL_CALL removePropertiesChangeListener (const css::uno::Sequence< OUString > &PropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &Listener) override
 
virtual void SAL_CALL addProperty (const OUString &Name, sal_Int16 Attributes, const css::uno::Any &DefaultValue) override
 
virtual void SAL_CALL removeProperty (const OUString &Name) override
 
virtual void SAL_CALL initialize (const css::uno::Sequence< css::uno::Any > &aArguments) override
 
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent () override
 
virtual void SAL_CALL setParent (const css::uno::Reference< css::uno::XInterface > &Parent) override
 
virtual void SAL_CALL rename (const OUString &newName) override
 
const ContentPropertiesgetContentProperties () const
 
css::uno::Reference< css::sdbc::XRow > getPropertyValues (const css::uno::Sequence< css::beans::Property > &rProperties)
 
const css::uno::Reference< css::uno::XComponentContext > & getContext () const
 
const TContentPtrgetImpl () const
 
- Public Member Functions inherited from cppu::ImplHelper7< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) SAL_OVERRIDE
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () SAL_OVERRIDE
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () SAL_OVERRIDE
 
- Public Member Functions inherited from cppu::ImplHelper5< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 >
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) SAL_OVERRIDE
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () SAL_OVERRIDE
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () SAL_OVERRIDE
 

Static Public Member Functions

static rtl::Reference< OQueryContainercreate (const css::uno::Reference< css::container::XNameContainer > &_rxCommandDefinitions, const css::uno::Reference< css::sdbc::XConnection > &_rxConn, const css::uno::Reference< css::uno::XComponentContext > &_rxORB, ::dbtools::WarningsContainer *_pWarnings)
 

Private Types

enum class  AggregateAction {
  NONE ,
  Inserting
}
 

Private Member Functions

virtual css::uno::Reference< css::ucb::XContent > createObject (const OUString &_rName) override
 create an object from its persistent data within the configuration. More...
 
virtual bool checkExistence (const OUString &_rName) override
 quickly checks if there already is an element with a given name. More...
 
virtual void SAL_CALL disposing () override
 
virtual ~OQueryContainer () override
 
 OQueryContainer (const css::uno::Reference< css::container::XNameContainer > &_rxCommandDefinitions, const css::uno::Reference< css::sdbc::XConnection > &_rxConn, const css::uno::Reference< css::uno::XComponentContext > &_rxORB, ::dbtools::WarningsContainer *_pWarnings)
 ctor of the container. More...
 
void init ()
 
virtual OUString determineContentType () const override
 
css::uno::Reference< css::ucb::XContent > implCreateWrapper (const OUString &_rName)
 create a query object wrapping a CommandDefinition given by name. More...
 
css::uno::Reference< css::ucb::XContent > implCreateWrapper (const css::uno::Reference< css::ucb::XContent > &_rxCommandDesc)
 create a query object wrapping a CommandDefinition. The returned object is acquired once. More...
 

Private Attributes

::dbtools::WarningsContainerm_pWarnings
 
css::uno::Reference< css::container::XNameContainer > m_xCommandDefinitions
 
css::uno::Reference< css::sdbc::XConnection > m_xConnection
 
AggregateAction m_eDoingCurrently
 

Friends

class OAutoActionReset
 

Additional Inherited Members

- Protected Types inherited from dbaccess::ODefinitionContainer
enum  ContainerOperation {
  E_REPLACED ,
  E_REMOVED ,
  E_INSERTED
}
 
enum  ListenerType {
  ApproveListeners ,
  ContainerListemers
}
 
typedef std::map< OUString, css::uno::WeakReference< css::ucb::XContent > > Documents
 
- Protected Member Functions inherited from dbaccess::ODefinitionContainer
void setElementApproval (PContainerApprove _pElementApproval)
 Additionally to our own approvals which new elements must pass, derived classes can specify an additional approval instance here. More...
 
const PContainerApprovegetElementApproval () const
 
virtual ~ODefinitionContainer () override
 
const ODefinitionContainer_ImplgetDefinitions () const
 
ODefinitionContainer_ImplgetDefinitions ()
 
virtual void SAL_CALL disposing () override
 
virtual css::uno::Reference< css::ucb::XContent > createObject (const OUString &_rName)=0
 create an object from its persistent data within the configuration. More...
 
css::uno::Reference< css::ucb::XContent > implGetByName (const OUString &_rName, bool _bCreateIfNecessary)
 get the object specified by the given name. More...
 
virtual bool checkExistence (const OUString &_rName)
 quickly checks if there already is an element with a given name. More...
 
void implAppend (const OUString &_rName, const css::uno::Reference< css::ucb::XContent > &_rxNewObject)
 append a new object to the container. More...
 
void implRemove (const OUString &_rName)
 remove all references to an object from the container. More...
 
void implReplace (const OUString &_rName, const css::uno::Reference< css::ucb::XContent > &_rxNewObject)
 remove an object in the container. More...
 
void notifyByName (::osl::ResettableMutexGuard &_rGuard, const OUString &_rName, const css::uno::Reference< css::ucb::XContent > &_xNewElement, const css::uno::Reference< css::ucb::XContent > &xOldElement, ContainerOperation _eOperation, ListenerType _eType)
 notifies our container/approve listeners More...
 
 operator css::uno::Reference< css::uno::XInterface > () const
 
- Protected Member Functions inherited from dbaccess::OContentHelper
virtual void SAL_CALL disposing () override
 
void notifyDataSourceModified ()
 
void notifyPropertiesChange (const css::uno::Sequence< css::beans::PropertyChangeEvent > &evt) const
 This method can be used to propagate changes of property values. More...
 
OUString impl_getHierarchicalName (bool _includingRootContainer) const
 
virtual OUString determineContentType () const =0
 
- Protected Member Functions inherited from cppu::ImplHelper7< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >
 ~ImplHelper7 () SAL_NOEXCEPT
 
- Protected Member Functions inherited from cppu::ImplHelper5< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5 >
 ~ImplHelper5 () SAL_NOEXCEPT
 
- Protected Attributes inherited from dbaccess::ODefinitionContainer
std::vector< Documents::iterator > m_aDocuments
 
Documents m_aDocumentMap
 
::comphelper::OInterfaceContainerHelper2 m_aApproveListeners
 
::comphelper::OInterfaceContainerHelper2 m_aContainerListeners
 
bool m_bInPropertyChange
 
bool m_bCheckSlash
 
- Protected Attributes inherited from dbaccess::OContentHelper
::comphelper::OInterfaceContainerHelper3< css::ucb::XContentEventListener > m_aContentListeners
 
PropertyChangeListenerContainer m_aPropertyChangeListeners
 
css::uno::Reference< css::uno::XInterface > m_xParentContainer
 
const css::uno::Reference< css::uno::XComponentContext > m_aContext
 
const ::connectivity::SQLError m_aErrorHelper
 
TContentPtr m_pImpl
 
sal_uInt32 m_nCommandId
 
- Protected Attributes inherited from cppu::BaseMutex
mutable::osl::Mutex m_aMutex
 

Detailed Description

Definition at line 54 of file querycontainer.hxx.

Member Enumeration Documentation

◆ AggregateAction

Enumerator
NONE 
Inserting 

Definition at line 64 of file querycontainer.hxx.

Constructor & Destructor Documentation

◆ ~OQueryContainer()

dbaccess::OQueryContainer::~OQueryContainer ( )
overrideprivatevirtual

Definition at line 107 of file querycontainer.cxx.

◆ OQueryContainer()

dbaccess::OQueryContainer::OQueryContainer ( const css::uno::Reference< css::container::XNameContainer > &  _rxCommandDefinitions,
const css::uno::Reference< css::sdbc::XConnection > &  _rxConn,
const css::uno::Reference< css::uno::XComponentContext > &  _rxORB,
::dbtools::WarningsContainer _pWarnings 
)
private

ctor of the container.

The parent has to support the <type scope="css::sdbc">XConnection</type> interface.

Parameters
_pWarningsspecifies a warnings container (May be <NULL>)

Any errors which occur during the lifetime of the query container, which cannot be reported as exceptions (for instance in methods where throwing an SQLException is not allowed) will be appended to this container.

The caller is responsible for ensuring the lifetime of the object pointed to by this parameter.

Definition at line 59 of file querycontainer.cxx.

References make_shared(), and NONE.

Referenced by create().

Member Function Documentation

◆ appendByDescriptor()

void SAL_CALL dbaccess::OQueryContainer::appendByDescriptor ( const css::uno::Reference< css::beans::XPropertySet > &  descriptor)
overridevirtual

◆ approveInsertElement()

Reference< XVeto > SAL_CALL dbaccess::OQueryContainer::approveInsertElement ( const css::container::ContainerEvent &  Event)
overridevirtual

◆ approveRemoveElement()

Reference< XVeto > SAL_CALL dbaccess::OQueryContainer::approveRemoveElement ( const css::container::ContainerEvent &  Event)
overridevirtual

Definition at line 322 of file querycontainer.cxx.

◆ approveReplaceElement()

Reference< XVeto > SAL_CALL dbaccess::OQueryContainer::approveReplaceElement ( const css::container::ContainerEvent &  Event)
overridevirtual

Definition at line 317 of file querycontainer.cxx.

◆ checkExistence()

bool dbaccess::OQueryContainer::checkExistence ( const OUString &  _rName)
overrideprivatevirtual

quickly checks if there already is an element with a given name.

No access to the configuration occurs, i.e. if there is such an object which is not already loaded, it won't be loaded now.

Parameters
_rNamethe object name to check
Returns
sal_True if there already exists such an object

Reimplemented from dbaccess::ODefinitionContainer.

Definition at line 389 of file querycontainer.cxx.

References dbaccess::ODefinitionContainer::implAppend(), dbaccess::ODefinitionContainer::m_aDocumentMap, dbaccess::ODefinitionContainer::m_aDocuments, dbaccess::ODefinitionContainer::m_bInPropertyChange, and m_xCommandDefinitions.

Referenced by dropByName().

◆ create()

rtl::Reference< OQueryContainer > dbaccess::OQueryContainer::create ( const css::uno::Reference< css::container::XNameContainer > &  _rxCommandDefinitions,
const css::uno::Reference< css::sdbc::XConnection > &  _rxConn,
const css::uno::Reference< css::uno::XComponentContext > &  _rxORB,
::dbtools::WarningsContainer _pWarnings 
)
static

Definition at line 94 of file querycontainer.cxx.

References OQueryContainer().

◆ createDataDescriptor()

Reference< XPropertySet > SAL_CALL dbaccess::OQueryContainer::createDataDescriptor ( )
overridevirtual

Definition at line 154 of file querycontainer.cxx.

◆ createObject()

Reference< XContent > dbaccess::OQueryContainer::createObject ( const OUString &  _rName)
overrideprivatevirtual

create an object from its persistent data within the configuration.

To be overwritten by derived classes.

Parameters
_rNamethe name the object has within the container
Returns
the newly created object or an empty reference if something went wrong

Implements dbaccess::ODefinitionContainer.

Definition at line 384 of file querycontainer.cxx.

References implCreateWrapper().

◆ DECLARE_SERVICE_INFO()

dbaccess::OQueryContainer::DECLARE_SERVICE_INFO ( )

◆ determineContentType()

OUString dbaccess::OQueryContainer::determineContentType ( ) const
overrideprivatevirtual

Implements dbaccess::OContentHelper.

Definition at line 350 of file querycontainer.cxx.

◆ disposing() [1/2]

void dbaccess::OQueryContainer::disposing ( )
overrideprivatevirtual

◆ disposing() [2/2]

void SAL_CALL dbaccess::OQueryContainer::disposing ( const css::lang::EventObject &  Source)
overridevirtual

◆ dropByIndex()

void SAL_CALL dbaccess::OQueryContainer::dropByIndex ( sal_Int32  index)
overridevirtual

◆ dropByName()

void SAL_CALL dbaccess::OQueryContainer::dropByName ( const OUString &  elementName)
overridevirtual

Definition at line 214 of file querycontainer.cxx.

References checkExistence(), cppu::BaseMutex::m_aMutex, and m_xCommandDefinitions.

Referenced by dropByIndex().

◆ elementInserted()

void SAL_CALL dbaccess::OQueryContainer::elementInserted ( const css::container::ContainerEvent &  Event)
overridevirtual

◆ elementRemoved()

void SAL_CALL dbaccess::OQueryContainer::elementRemoved ( const css::container::ContainerEvent &  Event)
overridevirtual

◆ elementReplaced()

void SAL_CALL dbaccess::OQueryContainer::elementReplaced ( const css::container::ContainerEvent &  Event)
overridevirtual

◆ getCount()

sal_Int32 SAL_CALL dbaccess::OQueryContainer::getCount ( )
overridevirtual

Reimplemented from dbaccess::ODefinitionContainer.

Definition at line 415 of file querycontainer.cxx.

References cppu::BaseMutex::m_aMutex, and m_xCommandDefinitions.

Referenced by dropByIndex().

◆ getElementNames()

Sequence< OUString > SAL_CALL dbaccess::OQueryContainer::getElementNames ( )
overridevirtual

Reimplemented from dbaccess::ODefinitionContainer.

Definition at line 421 of file querycontainer.cxx.

References cppu::BaseMutex::m_aMutex, and m_xCommandDefinitions.

◆ hasElements()

sal_Bool SAL_CALL dbaccess::OQueryContainer::hasElements ( )
overridevirtual

Reimplemented from dbaccess::ODefinitionContainer.

Definition at line 409 of file querycontainer.cxx.

References cppu::BaseMutex::m_aMutex, and m_xCommandDefinitions.

◆ implCreateWrapper() [1/2]

css::uno::Reference< css::ucb::XContent > dbaccess::OQueryContainer::implCreateWrapper ( const css::uno::Reference< css::ucb::XContent > &  _rxCommandDesc)
private

create a query object wrapping a CommandDefinition. The returned object is acquired once.

◆ implCreateWrapper() [2/2]

Reference< XContent > dbaccess::OQueryContainer::implCreateWrapper ( const OUString &  _rName)
private

create a query object wrapping a CommandDefinition given by name.

To retrieve the object, the CommandDescription container will be asked for the given name.
The returned object is acquired once.

Definition at line 355 of file querycontainer.cxx.

References implCreateWrapper(), and m_xCommandDefinitions.

Referenced by appendByDescriptor(), createObject(), elementInserted(), elementReplaced(), and implCreateWrapper().

◆ init()

void dbaccess::OQueryContainer::init ( )
private

Friends And Related Function Documentation

◆ OAutoActionReset

friend class OAutoActionReset
friend

Definition at line 70 of file querycontainer.hxx.

Member Data Documentation

◆ m_eDoingCurrently

AggregateAction dbaccess::OQueryContainer::m_eDoingCurrently
private

◆ m_pWarnings

::dbtools::WarningsContainer* dbaccess::OQueryContainer::m_pWarnings
private

Definition at line 58 of file querycontainer.hxx.

◆ m_xCommandDefinitions

css::uno::Reference< css::container::XNameContainer > dbaccess::OQueryContainer::m_xCommandDefinitions
private

◆ m_xConnection

css::uno::Reference< css::sdbc::XConnection > dbaccess::OQueryContainer::m_xConnection
private

Definition at line 62 of file querycontainer.hxx.

Referenced by init().


The documentation for this class was generated from the following files: