LibreOffice Module ucbhelper (master) 1
|
This is an abstract base class for implementations of the service com.sun.star.ucb.Content. More...
#include <contenthelper.hxx>
Public Member Functions | |
ContentImplHelper (css::uno::Reference< css::uno::XComponentContext > xContext, rtl::Reference< ContentProviderImplHelper > xProvider, css::uno::Reference< css::ucb::XContentIdentifier > Identifier) | |
Constructor. More... | |
virtual | ~ContentImplHelper () override |
Destructor. More... | |
virtual css::uno::Any SAL_CALL | queryInterface (const css::uno::Type &rType) override |
virtual void SAL_CALL | acquire () noexcept override |
virtual void SAL_CALL | release () noexcept override |
virtual css::uno::Sequence< sal_Int8 > SAL_CALL | getImplementationId () override |
virtual css::uno::Sequence< css::uno::Type > SAL_CALL | getTypes () override |
virtual OUString SAL_CALL | getImplementationName () override=0 |
virtual sal_Bool SAL_CALL | supportsService (const OUString &ServiceName) override |
virtual css::uno::Sequence< OUString > SAL_CALL | getSupportedServiceNames () override=0 |
virtual void SAL_CALL | dispose () override |
virtual void SAL_CALL | addEventListener (const css::uno::Reference< css::lang::XEventListener > &Listener) override |
virtual void SAL_CALL | removeEventListener (const css::uno::Reference< css::lang::XEventListener > &Listener) override |
virtual css::uno::Reference< css::ucb::XContentIdentifier > SAL_CALL | getIdentifier () override |
virtual OUString SAL_CALL | getContentType () override=0 |
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=0 |
virtual void SAL_CALL | abort (sal_Int32 CommandId) override=0 |
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 | addCommandInfoChangeListener (const css::uno::Reference< css::ucb::XCommandInfoChangeListener > &Listener) override |
virtual void SAL_CALL | removeCommandInfoChangeListener (const css::uno::Reference< css::ucb::XCommandInfoChangeListener > &Listener) override |
virtual void SAL_CALL | addProperty (const OUString &Name, sal_Int16 Attributes, const css::uno::Any &DefaultValue) override |
This method adds a property to the content according to the interface specification. More... | |
virtual void SAL_CALL | removeProperty (const OUString &Name) override |
This method removes a property from the content according to the interface specification. More... | |
virtual void SAL_CALL | addPropertySetInfoChangeListener (const css::uno::Reference< css::beans::XPropertySetInfoChangeListener > &Listener) override |
virtual void SAL_CALL | removePropertySetInfoChangeListener (const css::uno::Reference< css::beans::XPropertySetInfoChangeListener > &Listener) override |
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL | getParent () override |
This method returns the content representing the parent of a content, if such a parent exists. More... | |
virtual void SAL_CALL | setParent (const css::uno::Reference< css::uno::XInterface > &Parent) override |
The implementation of this method always throws a NoSupportException. More... | |
const rtl::Reference< ContentProviderImplHelper > & | getProvider () const |
This method returns the provider of the content. More... | |
Public Member Functions inherited from cppu::OWeakObject | |
OWeakObject () | |
OWeakObject (const OWeakObject &) | |
OWeakObject &SAL_CALL | operator= (const OWeakObject &) |
virtual css::uno::Any SAL_CALL | queryInterface (const css::uno::Type &rType) SAL_OVERRIDE |
virtual void SAL_CALL | acquire () SAL_NOEXCEPT SAL_OVERRIDE |
virtual void SAL_CALL | release () SAL_NOEXCEPT SAL_OVERRIDE |
virtual css::uno::Reference< css::uno::XAdapter > SAL_CALL | queryAdapter () SAL_OVERRIDE |
SAL_CALL | operator css::uno::Reference< css::uno::XInterface > () |
Protected Member Functions | |
css::uno::Reference< css::beans::XPropertySetInfo > | getPropertySetInfo (const css::uno::Reference< css::ucb::XCommandEnvironment > &xEnv, bool bCache=true) |
This method returns complete meta data for the properties ( including Additional Core Properties supplied via XPropertyContainer interface ) supported by the content. More... | |
css::uno::Reference< css::ucb::XCommandInfo > | getCommandInfo (const css::uno::Reference< css::ucb::XCommandEnvironment > &xEnv, bool bCache=true) |
This method returns complete meta data for the commands supported by the content. More... | |
void | notifyPropertiesChange (const css::uno::Sequence< css::beans::PropertyChangeEvent > &evt) const |
This method can be used to propagate changes of property values. More... | |
void | notifyPropertySetInfoChange (const css::beans::PropertySetInfoChangeEvent &evt) const |
This method can be used to propagate changes of the propertyset info of your content (i.e. More... | |
void | notifyContentEvent (const css::ucb::ContentEvent &evt) const |
This method can be used to propagate content events. More... | |
void | inserted () |
Use this method to announce the insertion of this content at the end of your implementation of the command "insert". More... | |
void | deleted () |
Use this method to announce the destruction of this content at the end of your implementation of the command "delete". More... | |
bool | exchange (const css::uno::Reference< css::ucb::XContentIdentifier > &rNewId) |
Use this method to change the identity of a content. More... | |
css::uno::Reference< css::ucb::XPersistentPropertySet > | getAdditionalPropertySet (bool bCreate) |
Use this method to get access to the Additional Core Properties of the content ( added using content's XPropertyContainer interface ). More... | |
bool | renameAdditionalPropertySet (const OUString &rOldKey, const OUString &rNewKey) |
This method renames the propertyset containing the Additional Core Properties of the content. More... | |
bool | copyAdditionalPropertySet (const OUString &rSourceKey, const OUString &rTargetKey) |
This method copies the propertyset containing the Additional Core Properties of the content. More... | |
bool | removeAdditionalPropertySet () |
This method removes the propertyset containing the Additional Core Properties of the content. More... | |
Protected Member Functions inherited from cppu::OWeakObject | |
virtual | ~OWeakObject () COVERITY_NOEXCEPT_FALSE |
void | disposeWeakConnectionPoint () |
Protected Attributes | |
osl::Mutex | m_aMutex |
css::uno::Reference< css::uno::XComponentContext > | m_xContext |
css::uno::Reference< css::ucb::XContentIdentifier > | m_xIdentifier |
rtl::Reference< ContentProviderImplHelper > | m_xProvider |
sal_uInt32 | m_nCommandId |
Protected Attributes inherited from cppu::OWeakObject | |
oslInterlockedCount | m_refCount |
Private Member Functions | |
virtual UCBHELPER_DLLPRIVATE css::uno::Sequence< css::beans::Property > | getProperties (const css::uno::Reference< css::ucb::XCommandEnvironment > &xEnv)=0 |
Your implementation of this method must return a sequence containing the meta data of the properties supported by the content. More... | |
virtual UCBHELPER_DLLPRIVATE css::uno::Sequence< css::ucb::CommandInfo > | getCommands (const css::uno::Reference< css::ucb::XCommandEnvironment > &xEnv)=0 |
Your implementation of this method must return a sequence containing the meta data of the commands supported by the content. More... | |
virtual UCBHELPER_DLLPRIVATE OUString | getParentURL ()=0 |
The implementation of this method shall return the URL of the parent of your content. More... | |
Private Attributes | |
std::unique_ptr< ucbhelper_impl::ContentImplHelper_Impl > | m_pImpl |
Friends | |
class | PropertySetInfo |
class | CommandProcessorInfo |
This is an abstract base class for implementations of the service com.sun.star.ucb.Content.
Implementations derived from this class are objects provided by implementations derived from class ucb::ContentProviderImplHelper.
Features of the base class implementation:
Definition at line 81 of file contenthelper.hxx.
ucbhelper::ContentImplHelper::ContentImplHelper | ( | css::uno::Reference< css::uno::XComponentContext > | xContext, |
rtl::Reference< ContentProviderImplHelper > | xProvider, | ||
css::uno::Reference< css::ucb::XContentIdentifier > | Identifier | ||
) |
Constructor.
Note that the implementation of this ctor registers itself at its content provider. The provider implementation inserts the content in a hash map. So it easily can be found and reused when the provider is asked for a content.
rxContext | is a Service Manager. |
rxProvider | is the provider for the content. |
Identifier | is the content identifier for the content. |
Definition at line 127 of file contenthelper.cxx.
References Identifier, m_pImpl, and m_xContext.
|
overridevirtual |
Destructor.
Note that the implementation of this dtor deregisters itself from its content provider. The provider implementation removes the content from a hash map.
Definition at line 141 of file contenthelper.cxx.
|
overridepure virtual |
|
inlineoverridevirtualnoexcept |
Reimplemented from cppu::OWeakObject.
Definition at line 311 of file contenthelper.hxx.
References cppu::OWeakObject::acquire().
|
overridevirtual |
Definition at line 357 of file contenthelper.cxx.
|
overridevirtual |
Definition at line 270 of file contenthelper.cxx.
|
overridevirtual |
Definition at line 240 of file contenthelper.cxx.
|
overridevirtual |
Definition at line 302 of file contenthelper.cxx.
|
overridevirtual |
This method adds a property to the content according to the interface specification.
The properties will be stored using the service com.sun.star.ucb.Store.
Note: You may provide your own implementation of this method, for instance, if your data source supports adding/removing of properties. Don't forget to return the meta data for these properties in your implementation of getPropertyInfoTable.
Definition at line 380 of file contenthelper.cxx.
References getAdditionalPropertySet(), getPropertySetInfo(), m_aMutex, m_pImpl, Name, and notifyPropertySetInfoChange().
|
overridevirtual |
Definition at line 563 of file contenthelper.cxx.
|
protected |
This method copies the propertyset containing the Additional Core Properties of the content.
rSourceKey | is the key of the source propertyset. |
rTargetKey | is the key of the target propertyset. |
Definition at line 630 of file contenthelper.cxx.
References m_xProvider.
|
overridevirtual |
Definition at line 293 of file contenthelper.cxx.
References m_aMutex, and m_nCommandId.
|
protected |
Use this method to announce the destruction of this content at the end of your implementation of the command "delete".
The implementation of is method propagates a ContentEvent( DELETED ) and a ContentEvent( REMOVED ) at the parent of the deleted content, if a parent exists.
Definition at line 763 of file contenthelper.cxx.
References getIdentifier(), getParentURL(), m_xProvider, and notifyContentEvent().
|
overridevirtual |
Definition at line 193 of file contenthelper.cxx.
|
protected |
Use this method to change the identity of a content.
The implementation of this method will replace the content identifier of the content and propagate the appropriate ContentEvent( EXCHANGED ).
rNewId | is the new content identifier for the content. |
Definition at line 792 of file contenthelper.cxx.
References getIdentifier(), m_aMutex, m_xIdentifier, m_xProvider, and notifyContentEvent().
|
overridepure virtual |
|
protected |
Use this method to get access to the Additional Core Properties of the content ( added using content's XPropertyContainer interface ).
If you supply your own XPropertyContainer implementation, this method will always return an empty propertyset.
bCreate | indicates whether a new propertyset shall be created if it does not exist. |
Definition at line 615 of file contenthelper.cxx.
References m_xIdentifier, and m_xProvider.
Referenced by addProperty(), and removeProperty().
|
protected |
This method returns complete meta data for the commands supported by the content.
To implement the required command "getCommandInfo" simply return the return value of this method.
xEnv | is an environment to use for example, for interactions. |
bCache | indicates, whether the implementation should use cached data, if exist. |
Definition at line 830 of file contenthelper.cxx.
References CommandProcessorInfo, m_aMutex, and m_pImpl.
|
privatepure virtual |
Your implementation of this method must return a sequence containing the meta data of the commands supported by the content.
xEnv | is an environment to use for example, for interactions. |
Referenced by ucbhelper::CommandProcessorInfo::getCommandsImpl().
|
overridepure virtual |
|
overridevirtual |
Definition at line 264 of file contenthelper.cxx.
References m_xIdentifier.
Referenced by deleted(), exchange(), and ucbhelper::ContentProviderImplHelper::removeContent().
|
overridevirtual |
|
overridepure virtual |
|
overridevirtual |
This method returns the content representing the parent of a content, if such a parent exists.
The implementation of this method uses your implementation of getParentURL.
Definition at line 586 of file contenthelper.cxx.
References aURL, getParentURL(), and m_xProvider.
|
privatepure virtual |
The implementation of this method shall return the URL of the parent of your content.
References inserted(), and queryInterface().
Referenced by deleted(), getParent(), and inserted().
|
privatepure virtual |
Your implementation of this method must return a sequence containing the meta data of the properties supported by the content.
Note: If you wish to provide your own implementation of the interface XPropertyContainer ( completely override addContent and removeContent implementation of this base class in this case ), you can supply the meta data for your Additional Core Properties here to get a fully featured getPropertySetInfo method ( see below ).
xEnv | is an environment to use for example, for interactions. |
|
protected |
This method returns complete meta data for the properties ( including Additional Core Properties supplied via XPropertyContainer interface ) supported by the content.
To implement the required command "getPropertySetInfo" simply return the return value of this method.
xEnv | is an environment to use for example, for interactions. |
bCache | indicates, whether the implementation should use cached data, if exist. |
Definition at line 846 of file contenthelper.cxx.
References m_aMutex, m_pImpl, and PropertySetInfo.
Referenced by addProperty(), and removeProperty().
|
inline |
This method returns the provider of the content.
Definition at line 440 of file contenthelper.hxx.
|
overridepure virtual |
|
overridevirtual |
|
protected |
Use this method to announce the insertion of this content at the end of your implementation of the command "insert".
The implementation of is method propagates a ContentEvent( INSERTED ).
Definition at line 741 of file contenthelper.cxx.
References getParentURL(), and m_xProvider.
|
protected |
This method can be used to propagate content events.
evt | is a sequence of content events. |
Definition at line 731 of file contenthelper.cxx.
References m_pImpl.
Referenced by deleted(), and exchange().
|
protected |
This method can be used to propagate changes of property values.
evt | is a sequence of property change events. |
Definition at line 644 of file contenthelper.cxx.
References aListeners, first, cppu::OInterfaceIteratorHelper::hasMoreElements(), m_pImpl, nCount, cppu::OInterfaceIteratorHelper::next(), and p.
|
protected |
This method can be used to propagate changes of the propertyset info of your content (i.e.
this happens if a new property is added to your content via its XPropertyContainer interface). This base class automatically generates events when the propertyset info changes. If you provide your own implementations of addproperty and removeProperty, then you must call "notifyPropertySetInfoChange" by yourself.
evt | is a sequence of property change events. |
Definition at line 721 of file contenthelper.cxx.
References m_pImpl.
Referenced by addProperty(), and removeProperty().
|
overridevirtual |
Reimplemented from cppu::OWeakObject.
Definition at line 157 of file contenthelper.cxx.
References cppu::OWeakObject::queryInterface(), and cppu::queryInterface().
|
overridevirtualnoexcept |
Reimplemented from cppu::OWeakObject.
Definition at line 145 of file contenthelper.cxx.
References m_xProvider.
|
protected |
This method removes the propertyset containing the Additional Core Properties of the content.
Propertysets for children described by rOldKey are removed too.
Definition at line 638 of file contenthelper.cxx.
References m_xIdentifier, and m_xProvider.
|
overridevirtual |
Definition at line 370 of file contenthelper.cxx.
|
overridevirtual |
Definition at line 283 of file contenthelper.cxx.
|
overridevirtual |
Definition at line 253 of file contenthelper.cxx.
|
overridevirtual |
Definition at line 330 of file contenthelper.cxx.
|
overridevirtual |
This method removes a property from the content according to the interface specification.
The properties will be stored using the service com.sun.star.ucb.Store.
Note: You may provide your own implementation of this method, for instance, if your data source supports adding/removing of properties. Don't forget to return the meta data for these properties in your implementation of getPropertyInfoTable.
Definition at line 467 of file contenthelper.cxx.
References getAdditionalPropertySet(), getPropertySetInfo(), m_aMutex, m_pImpl, Name, and notifyPropertySetInfoChange().
|
overridevirtual |
Definition at line 576 of file contenthelper.cxx.
|
protected |
This method renames the propertyset containing the Additional Core Properties of the content.
rOldKey | is the old key of the propertyset. |
rNewKey | is the new key for the propertyset. |
Definition at line 622 of file contenthelper.cxx.
References m_xProvider.
|
overridevirtual |
The implementation of this method always throws a NoSupportException.
Definition at line 608 of file contenthelper.cxx.
|
overridevirtual |
Definition at line 186 of file contenthelper.cxx.
References ServiceName, and cppu::supportsService().
|
friend |
Definition at line 95 of file contenthelper.hxx.
Referenced by getCommandInfo().
|
friend |
Definition at line 94 of file contenthelper.hxx.
Referenced by getPropertySetInfo().
|
protected |
Definition at line 100 of file contenthelper.hxx.
Referenced by addCommandInfoChangeListener(), addContentEventListener(), addEventListener(), addPropertiesChangeListener(), addProperty(), addPropertySetInfoChangeListener(), createCommandIdentifier(), dispose(), exchange(), getCommandInfo(), getPropertySetInfo(), removeCommandInfoChangeListener(), removeContentEventListener(), removeEventListener(), removePropertiesChangeListener(), removeProperty(), and removePropertySetInfoChangeListener().
|
protected |
Definition at line 107 of file contenthelper.hxx.
Referenced by createCommandIdentifier().
|
private |
Definition at line 97 of file contenthelper.hxx.
Referenced by addCommandInfoChangeListener(), addContentEventListener(), addEventListener(), addPropertiesChangeListener(), addProperty(), addPropertySetInfoChangeListener(), dispose(), getCommandInfo(), getPropertySetInfo(), notifyContentEvent(), notifyPropertiesChange(), notifyPropertySetInfoChange(), removeCommandInfoChangeListener(), removeContentEventListener(), removeEventListener(), removePropertiesChangeListener(), removeProperty(), and removePropertySetInfoChangeListener().
|
protected |
Definition at line 102 of file contenthelper.hxx.
|
protected |
Definition at line 104 of file contenthelper.hxx.
Referenced by exchange(), getAdditionalPropertySet(), getIdentifier(), and removeAdditionalPropertySet().
|
protected |
Definition at line 106 of file contenthelper.hxx.
Referenced by copyAdditionalPropertySet(), deleted(), exchange(), getAdditionalPropertySet(), getParent(), inserted(), release(), removeAdditionalPropertySet(), and renameAdditionalPropertySet().