28#include <osl/mutex.hxx>
29#include <com/sun/star/container/XNameContainer.hpp>
30#include <com/sun/star/container/XContainer.hpp>
31#include <com/sun/star/container/XEnumerationAccess.hpp>
32#include <com/sun/star/container/XIndexAccess.hpp>
33#include <com/sun/star/beans/XPropertyChangeListener.hpp>
34#include <com/sun/star/beans/XVetoableChangeListener.hpp>
35#include <com/sun/star/container/XContainerApproveBroadcaster.hpp>
79 , css::container::XNameContainer
80 , css::container::XEnumerationAccess
81 , css::container::XContainer
82 , css::container::XContainerApproveBroadcaster
83 , css::beans::XPropertyChangeListener
84 , css::beans::XVetoableChangeListener
92 typedef std::map< OUString, css::uno::WeakReference< css::ucb::XContent > >
Documents;
113 std::vector<Documents::iterator>
152 const css::uno::Reference< css::uno::XComponentContext >& _xORB
153 ,
const css::uno::Reference< css::uno::XInterface >& _xParentContainer
155 ,
bool _bCheckSlash =
true
173 virtual css::
uno::Reference< css::container::XEnumeration > SAL_CALL
createEnumeration( ) override;
176 virtual sal_Int32 SAL_CALL
getCount( ) override;
177 virtual css::
uno::Any SAL_CALL
getByIndex( sal_Int32 _nIndex ) override;
180 virtual
void SAL_CALL
insertByName( const OUString& _rName, const css::
uno::Any& aElement ) override;
181 virtual
void SAL_CALL
removeByName( const OUString& _rName ) override;
184 virtual
void SAL_CALL
replaceByName( const OUString& _rName, const css::
uno::Any& aElement ) override;
187 virtual css::
uno::Any SAL_CALL
getByName( const OUString& aName ) override;
192 virtual
void SAL_CALL
addContainerListener( const css::
uno::Reference< css::container::XContainerListener >& xListener ) override;
193 virtual
void SAL_CALL
removeContainerListener( const css::
uno::Reference< css::container::XContainerListener >& xListener ) override;
200 virtual
void SAL_CALL
disposing( const css::lang::EventObject& Source ) override;
203 virtual
void SAL_CALL
propertyChange( const css::beans::PropertyChangeEvent& evt ) override;
205 virtual
void SAL_CALL
vetoableChange( const css::beans::PropertyChangeEvent& aEvent ) override;
209 virtual
void SAL_CALL
disposing() override;
216 const OUString& _rName) = 0;
226 css::
uno::Reference< css::
ucb::XContent >
227 implGetByName(const OUString& _rName,
bool _bCreateIfNecessary);
248 const OUString& _rName,
249 const css::
uno::Reference< css::
ucb::XContent >& _rxNewObject
274 const OUString& _rName,
275 const css::
uno::Reference< css::
ucb::XContent >& _rxNewObject
281 ::
osl::ResettableMutexGuard& _rGuard,
282 const OUString& _rName,
283 const css::
uno::Reference< css::
ucb::XContent >& _xNewElement,
284 const css::
uno::Reference< css::
ucb::XContent >& xOldElement,
291 return const_cast< XContainer*
>(
static_cast< const XContainer*
>( this ) );
295 void addObjectListener(
const css::uno::Reference< css::ucb::XContent >& _xNewObject);
311 const OUString& _sName,
312 const css::uno::Reference< css::ucb::XContent >& _rxObject
sal_Int32 getLength() const
NamedDefinitions m_aDefinitions
NamedDefinitions::iterator iterator
const_iterator begin() const
void insert(const OUString &_rName, TContentPtr _pDefinition)
const_iterator end() const
NamedDefinitions::const_iterator const_iterator
std::map< OUString, TContentPtr > NamedDefinitions
const_iterator find(const OUString &_rName) const
void erase(const OUString &_rName)
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
virtual void SAL_CALL addContainerApproveListener(const css::uno::Reference< css::container::XContainerApproveListener > &Listener) override
const ODefinitionContainer_Impl & getDefinitions() const
ODefinitionContainer_Impl & getDefinitions()
void implReplace(const OUString &_rName, const css::uno::Reference< css::ucb::XContent > &_rxNewObject)
remove an object in the container.
void implAppend(const OUString &_rName, const css::uno::Reference< css::ucb::XContent > &_rxNewObject)
append a new object to the container.
virtual css::uno::Reference< css::ucb::XContent > createObject(const OUString &_rName)=0
create an object from its persistent data within the configuration.
void removeObjectListener(const css::uno::Reference< css::ucb::XContent > &_xNewObject)
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.
virtual void SAL_CALL replaceByName(const OUString &_rName, const css::uno::Any &aElement) override
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
virtual void SAL_CALL vetoableChange(const css::beans::PropertyChangeEvent &aEvent) override
::comphelper::OInterfaceContainerHelper2 m_aApproveListeners
::comphelper::OInterfaceContainerHelper2 m_aContainerListeners
virtual sal_Int32 SAL_CALL getCount() override
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
std::map< OUString, css::uno::WeakReference< css::ucb::XContent > > Documents
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.
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual ~ODefinitionContainer() override
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
virtual void SAL_CALL insertByName(const OUString &_rName, const css::uno::Any &aElement) override
virtual void SAL_CALL disposing() override
void implRemove(const OUString &_rName)
remove all references to an object from the container.
virtual void SAL_CALL removeContainerApproveListener(const css::uno::Reference< css::container::XContainerApproveListener > &Listener) override
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Bool SAL_CALL hasElements() override
const PContainerApprove & getElementApproval() const
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 _nIndex) override
virtual void SAL_CALL removeContainerListener(const css::uno::Reference< css::container::XContainerListener > &xListener) override
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent &evt) override
void addObjectListener(const css::uno::Reference< css::ucb::XContent > &_xNewObject)
virtual void SAL_CALL removeByName(const OUString &_rName) override
virtual void SAL_CALL addContainerListener(const css::uno::Reference< css::container::XContainerListener > &xListener) override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
css::uno::Reference< css::ucb::XContent > implGetByName(const OUString &_rName, bool _bCreateIfNecessary)
get the object specified by the given name.
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
std::vector< Documents::iterator > m_aDocuments
virtual bool checkExistence(const OUString &_rName)
quickly checks if there already is an element with a given name.
void setElementApproval(PContainerApprove _pElementApproval)
Additionally to our own approvals which new elements must pass, derived classes can specify an additi...
PContainerApprove m_pElementApproval
bool impl_haveAnyListeners_nothrow() const
virtual css::uno::Type SAL_CALL getElementType() override
std::shared_ptr< OContentHelper_Impl > TContentPtr
::cppu::ImplHelper7< css::container::XIndexAccess, css::container::XNameContainer, css::container::XEnumerationAccess, css::container::XContainer, css::container::XContainerApproveBroadcaster, css::beans::XPropertyChangeListener, css::beans::XVetoableChangeListener > ODefinitionContainer_Base
std::shared_ptr< IContainerApprove > PContainerApprove
#define DECLARE_XINTERFACE()