LibreOffice Module dbaccess (master) 1
|
#include <definitioncontainer.hxx>
Public Member Functions | |
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 ContentProperties & | getContentProperties () 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 TContentPtr & | getImpl () 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 |
Protected Types | |
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 | |
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 PContainerApprove & | getElementApproval () const |
virtual | ~ODefinitionContainer () override |
const ODefinitionContainer_Impl & | getDefinitions () const |
ODefinitionContainer_Impl & | getDefinitions () |
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 Attributes | |
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 |
Private Member Functions | |
void | addObjectListener (const css::uno::Reference< css::ucb::XContent > &_xNewObject) |
void | removeObjectListener (const css::uno::Reference< css::ucb::XContent > &_xNewObject) |
void | approveNewObject (const OUString &_sName, const css::uno::Reference< css::ucb::XContent > &_rxObject) const |
approve that the object given may be inserted into the container. More... | |
bool | impl_haveAnyListeners_nothrow () const |
Private Attributes | |
PContainerApprove | m_pElementApproval |
Definition at line 87 of file definitioncontainer.hxx.
|
protected |
Definition at line 92 of file definitioncontainer.hxx.
|
protected |
Enumerator | |
---|---|
E_REPLACED | |
E_REMOVED | |
E_INSERTED |
Definition at line 94 of file definitioncontainer.hxx.
|
protected |
Enumerator | |
---|---|
ApproveListeners | |
ContainerListemers |
Definition at line 101 of file definitioncontainer.hxx.
|
overrideprotectedvirtual |
Definition at line 133 of file definitioncontainer.cxx.
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.
Definition at line 83 of file definitioncontainer.cxx.
References getDefinitions(), m_aDocumentMap, m_aDocuments, m_aMutex, and dbaccess::OContentHelper::m_pImpl.
|
overridevirtual |
Definition at line 334 of file definitioncontainer.cxx.
References comphelper::OInterfaceContainerHelper2::addInterface(), and m_aApproveListeners.
|
overridevirtual |
Definition at line 322 of file definitioncontainer.cxx.
References comphelper::OInterfaceContainerHelper2::addInterface(), and m_aContainerListeners.
|
private |
Definition at line 650 of file definitioncontainer.cxx.
References PROPERTY_NAME().
Referenced by implAppend(), implGetByName(), and implReplace().
|
private |
approve that the object given may be inserted into the container.
Should be overridden by derived classes, the default implementation just checks the object to be non-void.
IllegalArgumentException | if the name or the object are invalid |
ElementExistException | if the object already exists in the container, or another object with the same name already exists |
WrappedTargetException | if another error occurs which prevents insertion of the object into the container |
Definition at line 568 of file definitioncontainer.cxx.
References DBA_RES, dbaccess::ODefinitionContainer_Impl::end(), dbaccess::ODefinitionContainer_Impl::find(), getDefinitions(), connectivity::SQLError::getErrorMessage(), dbaccess::OContentHelper::m_aErrorHelper, and m_bCheckSlash.
Referenced by insertByName(), and replaceByName().
|
protectedvirtual |
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.
_rName | the object name to check |
Reimplemented in dbaccess::OQueryContainer.
Definition at line 671 of file definitioncontainer.cxx.
References m_aDocumentMap.
Referenced by hasByName(), implReplace(), dbaccess::ODocumentContainer::removeByName(), and removeByName().
|
overridevirtual |
Definition at line 359 of file definitioncontainer.cxx.
References cppu::BaseMutex::m_aMutex.
|
protectedpure virtual |
create an object from its persistent data within the configuration.
To be overwritten by derived classes.
_rName | the name the object has within the container |
Implemented in dbaccess::OCommandContainer, dbaccess::ODocumentContainer, and dbaccess::OQueryContainer.
Referenced by getByIndex(), and implGetByName().
|
overrideprotectedvirtual |
Reimplemented from dbaccess::OContentHelper.
Reimplemented in dbaccess::OQueryContainer.
Definition at line 105 of file definitioncontainer.cxx.
References comphelper::OInterfaceContainerHelper2::disposeAndClear(), dbaccess::OContentHelper::disposing(), m_aApproveListeners, m_aContainerListeners, m_aDocumentMap, m_aDocuments, cppu::BaseMutex::m_aMutex, and removeObjectListener().
Referenced by dbaccess::OQueryContainer::disposing().
|
overridevirtual |
Reimplemented in dbaccess::OQueryContainer.
|
overridevirtual |
Definition at line 372 of file definitioncontainer.cxx.
References Any, createObject(), m_aDocuments, cppu::BaseMutex::m_aMutex, and o3tl::make_unsigned().
Referenced by dbaccess::OQueryContainer::dropByIndex().
|
overridevirtual |
Definition at line 392 of file definitioncontainer.cxx.
References Any, implGetByName(), and cppu::BaseMutex::m_aMutex.
|
overridevirtual |
Reimplemented in dbaccess::OQueryContainer.
Definition at line 366 of file definitioncontainer.cxx.
References m_aDocuments, and cppu::BaseMutex::m_aMutex.
|
inlineprotected |
Definition at line 144 of file definitioncontainer.hxx.
|
inlineprotected |
Definition at line 139 of file definitioncontainer.hxx.
Referenced by approveNewObject(), dbaccess::ODocumentContainer::createInstanceWithArguments(), dbaccess::OCommandContainer::createObject(), dbaccess::ODocumentContainer::createObject(), implAppend(), implRemove(), dbaccess::OQueryContainer::init(), and ODefinitionContainer().
|
inlineprotected |
Definition at line 134 of file definitioncontainer.hxx.
References m_pElementApproval.
Referenced by dbaccess::OQueryContainer::approveInsertElement().
|
overridevirtual |
Reimplemented in dbaccess::OQueryContainer.
Definition at line 420 of file definitioncontainer.cxx.
References m_aDocumentMap, and cppu::BaseMutex::m_aMutex.
Referenced by dbaccess::ODocumentContainer::execute().
|
overridevirtual |
Definition at line 347 of file definitioncontainer.cxx.
References cppu::UnoType< typename T >::get().
|
overridevirtual |
Reimplemented from cppu::ImplHelper7< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >.
Reimplemented in dbaccess::OCommandContainer, and dbaccess::ODocumentContainer.
Definition at line 147 of file definitioncontainer.cxx.
|
overridevirtual |
Reimplemented from dbaccess::OContentHelper.
Definition at line 153 of file definitioncontainer.cxx.
|
overridevirtual |
Reimplemented from dbaccess::OContentHelper.
Definition at line 158 of file definitioncontainer.cxx.
|
overridevirtual |
Reimplemented from cppu::ImplHelper7< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7 >.
Reimplemented in dbaccess::OCommandContainer, and dbaccess::ODocumentContainer.
Definition at line 138 of file definitioncontainer.cxx.
Referenced by dbaccess::OCommandContainer::getTypes(), and dbaccess::ODocumentContainer::getTypes().
|
overridevirtual |
Definition at line 435 of file definitioncontainer.cxx.
References checkExistence(), and cppu::BaseMutex::m_aMutex.
Referenced by dbaccess::OQueryContainer::elementInserted(), dbaccess::OQueryContainer::elementRemoved(), dbaccess::OQueryContainer::elementReplaced(), and vetoableChange().
|
overridevirtual |
Reimplemented in dbaccess::OQueryContainer.
Definition at line 352 of file definitioncontainer.cxx.
References m_aDocuments, and cppu::BaseMutex::m_aMutex.
|
inlineprivate |
Definition at line 315 of file definitioncontainer.hxx.
References comphelper::OInterfaceContainerHelper2::getLength(), m_aApproveListeners, and m_aContainerListeners.
Referenced by removeByName(), and replaceByName().
|
protected |
append a new object to the container.
No plausibility checks are done, e.g. if the object is non-NULL or if the name is already used by another object or anything like this. This method is for derived classes which may support different methods to create and/or append objects, and don't want to deal with the internal structures of this class.
The old component will not be disposed, this is the callers responsibility, too.
_rName | the name of the new object |
_rxNewObject | the new object (not surprising, is it ?) |
Definition at line 516 of file definitioncontainer.cxx.
References addObjectListener(), dbaccess::ODefinitionContainer_Impl::end(), dbaccess::ODefinitionContainer_Impl::erase(), Exception, dbaccess::ODefinitionContainer_Impl::find(), getDefinitions(), dbaccess::ODefinitionContainer_Impl::insert(), m_aDocumentMap, m_aDocuments, cppu::BaseMutex::m_aMutex, and dbaccess::OContentHelper::notifyDataSourceModified().
Referenced by dbaccess::OQueryContainer::appendByDescriptor(), dbaccess::OQueryContainer::checkExistence(), insertByName(), and propertyChange().
|
protected |
get the object specified by the given name.
If desired, the object will be read if not already done so.
_rName | the object name |
_bReadIfNecessary | if sal_True, the object will be created if necessary |
NoSuchElementException | if there is no object with the given name. |
Definition at line 399 of file definitioncontainer.cxx.
References addObjectListener(), createObject(), and m_aDocumentMap.
Referenced by getByName(), dbaccess::ODocumentContainer::getContent(), dbaccess::ODocumentContainer::removeByName(), removeByName(), and replaceByName().
|
protected |
remove all references to an object from the container.
No plausibility checks are done, e.g. whether or not there exists an object with the given name. This is the responsibility of the caller.
Additionally the node for the given object will be removed from the registry (including all sub nodes).
The old component will not be disposed, this is the callers responsibility, too.
_rName | the objects name |
Definition at line 458 of file definitioncontainer.cxx.
References dbaccess::ODefinitionContainer_Impl::erase(), getDefinitions(), m_aDocumentMap, m_aDocuments, and dbaccess::OContentHelper::notifyDataSourceModified().
Referenced by propertyChange(), dbaccess::ODocumentContainer::removeByName(), and removeByName().
|
protected |
remove an object in the container.
No plausibility checks are done, e.g. whether or not there exists an object with the given name or the object is non-NULL. This is the responsibility of the caller.
Additionally all object-related information within the registry will be deleted. The new object config node, where the caller may want to store the new objects information, is returned.
The old component will not be disposed, this is the callers responsibility, too.
_rName | the objects name |
_rxNewObject | the new object |
_rNewObjectNode | the configuration node where the new object may be stored |
Definition at line 558 of file definitioncontainer.cxx.
References addObjectListener(), checkExistence(), m_aDocumentMap, and removeObjectListener().
Referenced by replaceByName().
|
overridevirtual |
Definition at line 164 of file definitioncontainer.cxx.
References ApproveListeners, approveNewObject(), ContainerListemers, E_INSERTED, implAppend(), cppu::BaseMutex::m_aMutex, and notifyByName().
Referenced by dbaccess::OQueryContainer::elementInserted().
|
protected |
notifies our container/approve listeners
Definition at line 280 of file definitioncontainer.cxx.
References aEvent, Any, ApproveListeners, E_INSERTED, E_REMOVED, E_REPLACED, comphelper::OInterfaceContainerHelper2::forEach(), comphelper::OInterfaceContainerHelper2::getLength(), m_aApproveListeners, m_aContainerListeners, and comphelper::OInterfaceContainerHelper2::notifyEach().
Referenced by dbaccess::OQueryContainer::appendByDescriptor(), insertByName(), dbaccess::ODocumentContainer::removeByName(), removeByName(), and replaceByName().
|
inlineprotected |
Definition at line 289 of file definitioncontainer.hxx.
|
overridevirtual |
Definition at line 609 of file definitioncontainer.cxx.
References ex, Exception, cppu::getCaughtException(), implAppend(), implRemove(), cppu::BaseMutex::m_aMutex, m_bInPropertyChange, PROPERTY_NAME(), and removeObjectListener().
|
overridevirtual |
Reimplemented in dbaccess::ODocumentContainer.
Definition at line 177 of file definitioncontainer.cxx.
References ApproveListeners, checkExistence(), ContainerListemers, disposeComponent(), E_REMOVED, impl_haveAnyListeners_nothrow(), implGetByName(), implRemove(), cppu::BaseMutex::m_aMutex, notifyByName(), and removeObjectListener().
Referenced by dbaccess::OQueryContainer::elementRemoved().
|
overridevirtual |
Definition at line 340 of file definitioncontainer.cxx.
References m_aApproveListeners, and comphelper::OInterfaceContainerHelper2::removeInterface().
|
overridevirtual |
Definition at line 328 of file definitioncontainer.cxx.
References m_aContainerListeners, and comphelper::OInterfaceContainerHelper2::removeInterface().
|
private |
Definition at line 661 of file definitioncontainer.cxx.
References PROPERTY_NAME().
Referenced by disposing(), implReplace(), propertyChange(), and removeByName().
|
overridevirtual |
Definition at line 201 of file definitioncontainer.cxx.
References a, ApproveListeners, approveNewObject(), ContainerListemers, disposeComponent(), E_REPLACED, Exception, cppu::getCaughtException(), impl_haveAnyListeners_nothrow(), implGetByName(), implReplace(), cppu::BaseMutex::m_aMutex, and notifyByName().
Referenced by dbaccess::OQueryContainer::elementReplaced().
|
inlineprotected |
Additionally to our own approvals which new elements must pass, derived classes can specify an additional approval instance here.
Every time a new element is inserted into the container (or an element is replaced with a new one), this new element must pass our own internal approval, plus the approval given here.
Definition at line 133 of file definitioncontainer.hxx.
References m_pElementApproval.
Referenced by dbaccess::OQueryContainer::init(), and dbaccess::ODocumentContainer::ODocumentContainer().
|
overridevirtual |
Definition at line 637 of file definitioncontainer.cxx.
References aEvent, hasByName(), cppu::BaseMutex::m_aMutex, and PROPERTY_NAME().
|
protected |
Definition at line 118 of file definitioncontainer.hxx.
Referenced by addContainerApproveListener(), disposing(), impl_haveAnyListeners_nothrow(), notifyByName(), and removeContainerApproveListener().
|
protected |
Definition at line 120 of file definitioncontainer.hxx.
Referenced by addContainerListener(), disposing(), impl_haveAnyListeners_nothrow(), notifyByName(), and removeContainerListener().
|
protected |
Definition at line 115 of file definitioncontainer.hxx.
Referenced by checkExistence(), dbaccess::OQueryContainer::checkExistence(), dbaccess::ODocumentContainer::commit(), disposing(), dbaccess::OQueryContainer::disposing(), dbaccess::OQueryContainer::elementInserted(), dbaccess::OQueryContainer::elementRemoved(), dbaccess::OQueryContainer::elementReplaced(), getElementNames(), implAppend(), implGetByName(), implRemove(), implReplace(), dbaccess::OQueryContainer::init(), ODefinitionContainer(), and dbaccess::ODocumentContainer::revert().
|
protected |
Definition at line 114 of file definitioncontainer.hxx.
Referenced by dbaccess::OQueryContainer::checkExistence(), disposing(), getByIndex(), getCount(), hasElements(), implAppend(), implRemove(), dbaccess::OQueryContainer::init(), and ODefinitionContainer().
|
protected |
Definition at line 123 of file definitioncontainer.hxx.
Referenced by approveNewObject().
|
protected |
Definition at line 122 of file definitioncontainer.hxx.
Referenced by dbaccess::OQueryContainer::checkExistence(), and propertyChange().
|
private |
Definition at line 108 of file definitioncontainer.hxx.
Referenced by getElementApproval(), and setElementApproval().