LibreOffice Module ucbhelper (master) 1
|
This is an abstract base class for implementations of the service com.sun.star.ucb.ContentProvider. More...
#include <providerhelper.hxx>
Public Member Functions | |
ContentProviderImplHelper (css::uno::Reference< css::uno::XComponentContext > xContext) | |
virtual | ~ContentProviderImplHelper () 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 css::uno::Reference< css::ucb::XContent > SAL_CALL | queryContent (const css::uno::Reference< css::ucb::XContentIdentifier > &Identifier) override=0 |
This method returns a content with the requested id. More... | |
virtual sal_Int32 SAL_CALL | compareContentIds (const css::uno::Reference< css::ucb::XContentIdentifier > &Id1, const css::uno::Reference< css::ucb::XContentIdentifier > &Id2) override |
osl::Mutex & | getContentListMutex () |
This method returns a mutex, which protects the content list of the provider. More... | |
void | queryExistingContents (ContentRefList &rContents) |
This method fills a list with all contents existing at calling time. More... | |
css::uno::Reference< css::ucb::XPersistentPropertySet > | getAdditionalPropertySet (const OUString &rKey, bool bCreate) |
This method returns the propertyset containing the Additional Core Properties of a content. More... | |
bool | renameAdditionalPropertySet (const OUString &rOldKey, const OUString &rNewKey, bool bRecursive) |
This method renames the propertyset containing the Additional Core Properties of a content. More... | |
bool | copyAdditionalPropertySet (const OUString &rSourceKey, const OUString &rTargetKey, bool bRecursive) |
This method copies the propertyset containing the Additional Core Properties of a content. More... | |
bool | removeAdditionalPropertySet (const OUString &rKey, bool bRecursive) |
This method removes the propertyset containing the Additional Core Properties of a content. More... | |
Protected Member Functions | |
rtl::Reference< ContentImplHelper > | queryExistingContent (const css::uno::Reference< css::ucb::XContentIdentifier > &Identifier) |
This method returns a content with the given id, if it already exists. More... | |
rtl::Reference< ContentImplHelper > | queryExistingContent (const OUString &rURL) |
This method returns a content with the given URL, if it already exists. More... | |
void | registerNewContent (const css::uno::Reference< css::ucb::XContent > &xContent) |
This method registers a newly created content instance with the content provider. More... | |
Protected Attributes | |
osl::Mutex | m_aMutex |
css::uno::Reference< css::uno::XComponentContext > | m_xContext |
Private Member Functions | |
UCBHELPER_DLLPRIVATE void | removeContent (ContentImplHelper *pContent) |
UCBHELPER_DLLPRIVATE css::uno::Reference< css::ucb::XPropertySetRegistry > | getAdditionalPropertySetRegistry () |
UCBHELPER_DLLPRIVATE void | cleanupRegisteredContents () |
Private Attributes | |
std::unique_ptr< ucbhelper_impl::ContentProviderImplHelper_Impl > | m_pImpl |
Friends | |
class | ContentImplHelper |
This is an abstract base class for implementations of the service com.sun.star.ucb.ContentProvider.
It provides contents derived from class ucb::ContentImplHelper.
Features of the base class implementation:
Definition at line 63 of file providerhelper.hxx.
ucbhelper::ContentProviderImplHelper::ContentProviderImplHelper | ( | css::uno::Reference< css::uno::XComponentContext > | xContext | ) |
Definition at line 63 of file providerhelper.cxx.
References m_pImpl, and m_xContext.
|
overridevirtual |
Definition at line 71 of file providerhelper.cxx.
|
private |
Definition at line 95 of file providerhelper.cxx.
References m_aMutex, and m_pImpl.
Referenced by queryExistingContent(), queryExistingContents(), registerNewContent(), and removeContent().
|
overridevirtual |
Definition at line 83 of file providerhelper.cxx.
bool ucbhelper::ContentProviderImplHelper::copyAdditionalPropertySet | ( | const OUString & | rSourceKey, |
const OUString & | rTargetKey, | ||
bool | bRecursive | ||
) |
This method copies the propertyset containing the Additional Core Properties of a content.
rSourceKey | is the key of the source propertyset. |
rTargetKey | is the key of the target propertyset. |
bRecursive | is a flag indicating whether propertysets for children described by rSourceKey shall be copied, too. |
Definition at line 312 of file providerhelper.cxx.
References copyAdditionalPropertySet(), getAdditionalPropertySet(), getAdditionalPropertySetRegistry(), m_aMutex, and m_pImpl.
Referenced by copyAdditionalPropertySet().
uno::Reference< css::ucb::XPersistentPropertySet > ucbhelper::ContentProviderImplHelper::getAdditionalPropertySet | ( | const OUString & | rKey, |
bool | bCreate | ||
) |
This method returns the propertyset containing the Additional Core Properties of a content.
rKey | is the key for the propertyset. |
bCreate | is a flag indicating whether the propertyset shall be created in case it does not exist. |
Definition at line 223 of file providerhelper.cxx.
References getAdditionalPropertySetRegistry(), and m_pImpl.
Referenced by copyAdditionalPropertySet(), and renameAdditionalPropertySet().
|
private |
Definition at line 199 of file providerhelper.cxx.
References m_aMutex, m_pImpl, and m_xContext.
Referenced by copyAdditionalPropertySet(), getAdditionalPropertySet(), removeAdditionalPropertySet(), and renameAdditionalPropertySet().
|
inline |
This method returns a mutex, which protects the content list of the provider.
So you can prevent modifications of that list easily.
Definition at line 178 of file providerhelper.hxx.
References m_aMutex.
|
overridepure virtual |
References supportsService().
|
overridepure virtual |
|
overridepure virtual |
This method returns a content with the requested id.
The implementation should:
|
protected |
This method returns a content with the given id, if it already exists.
Use this method in your "queryContent" implementation to ensure unique objects.
Identifier | is the content identifier, for that an existing content object is requested. |
|
protected |
This method returns a content with the given URL, if it already exists.
rURL | is the URL ( content identifier string ), for that an existing content object is requested. |
Definition at line 140 of file providerhelper.cxx.
References cleanupRegisteredContents(), m_aMutex, and m_pImpl.
void ucbhelper::ContentProviderImplHelper::queryExistingContents | ( | ContentRefList & | rContents | ) |
This method fills a list with all contents existing at calling time.
Note: You may prevent modifications of the content list at any time by acquiring the content list mutex of the provider.
rContents | is the list to fill with the children. |
Definition at line 162 of file providerhelper.cxx.
References cleanupRegisteredContents(), m_aMutex, and m_pImpl.
|
protected |
This method registers a newly created content instance with the content provider.
It should be called directly after creating a new content instance. The provider can reuse a registered instance upon subsequent requests for content instances with an identifier of a registered instance. Note that the provider does not hold a hard reference on the registered instance. If last external reference is gone, the provider will remove the instance from its inventory of known instances. Nothing will happen in case an already registered instance shall be registered more than once.
the | content instance that is to be registered. |
Definition at line 180 of file providerhelper.cxx.
References aURL, cleanupRegisteredContents(), m_aMutex, and m_pImpl.
bool ucbhelper::ContentProviderImplHelper::removeAdditionalPropertySet | ( | const OUString & | rKey, |
bool | bRecursive | ||
) |
This method removes the propertyset containing the Additional Core Properties of a content.
rKey | is the key of the propertyset. |
bRecursive | is a flag indicating whether propertysets for children described by rOldKey shall be removed, too. |
Definition at line 437 of file providerhelper.cxx.
References getAdditionalPropertySetRegistry(), m_aMutex, m_pImpl, and removeAdditionalPropertySet().
Referenced by removeAdditionalPropertySet().
|
private |
Definition at line 117 of file providerhelper.cxx.
References aURL, cleanupRegisteredContents(), ucbhelper::ContentImplHelper::getIdentifier(), m_aMutex, and m_pImpl.
bool ucbhelper::ContentProviderImplHelper::renameAdditionalPropertySet | ( | const OUString & | rOldKey, |
const OUString & | rNewKey, | ||
bool | bRecursive | ||
) |
This method renames the propertyset containing the Additional Core Properties of a content.
rOldKey | is the old key of the propertyset. |
rNewKey | is the new key for the propertyset. |
bRecursive | is a flag indicating whether propertysets for children described by rOldKey shall be renamed, too. |
Definition at line 239 of file providerhelper.cxx.
References getAdditionalPropertySet(), getAdditionalPropertySetRegistry(), m_aMutex, m_pImpl, and renameAdditionalPropertySet().
Referenced by renameAdditionalPropertySet().
|
overridevirtual |
Definition at line 76 of file providerhelper.cxx.
References ServiceName, and cppu::supportsService().
|
friend |
Definition at line 68 of file providerhelper.hxx.
|
protected |
Definition at line 73 of file providerhelper.hxx.
Referenced by cleanupRegisteredContents(), copyAdditionalPropertySet(), getAdditionalPropertySetRegistry(), queryExistingContent(), queryExistingContents(), registerNewContent(), removeAdditionalPropertySet(), removeContent(), and renameAdditionalPropertySet().
|
private |
Definition at line 70 of file providerhelper.hxx.
Referenced by cleanupRegisteredContents(), copyAdditionalPropertySet(), getAdditionalPropertySet(), getAdditionalPropertySetRegistry(), queryExistingContent(), queryExistingContents(), registerNewContent(), removeAdditionalPropertySet(), removeContent(), and renameAdditionalPropertySet().
|
protected |
Definition at line 74 of file providerhelper.hxx.
Referenced by getAdditionalPropertySetRegistry().