summaryrefslogtreecommitdiff
path: root/ucbhelper/source/provider
diff options
context:
space:
mode:
authorStephan Bergmann <sb@openoffice.org>2000-11-09 12:23:55 +0000
committerStephan Bergmann <sb@openoffice.org>2000-11-09 12:23:55 +0000
commit4645fea1c3e99ab89cca11bfd9cde2a655e91ea9 (patch)
treeab073442cef95be5cd2f449b598b432086c14d6f /ucbhelper/source/provider
parent662a7028f0529f114b9bd201a80f405f8936d4c4 (diff)
Complete redesign of the UCB configuration mechanism.
Diffstat (limited to 'ucbhelper/source/provider')
-rw-r--r--ucbhelper/source/provider/configureucb.cxx214
-rw-r--r--ucbhelper/source/provider/registerucb.cxx240
-rw-r--r--ucbhelper/source/provider/registerucb.hxx132
3 files changed, 402 insertions, 184 deletions
diff --git a/ucbhelper/source/provider/configureucb.cxx b/ucbhelper/source/provider/configureucb.cxx
index 56f16ebe0e99..3828f7b6a4e2 100644
--- a/ucbhelper/source/provider/configureucb.cxx
+++ b/ucbhelper/source/provider/configureucb.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: configureucb.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:03:37 $
+ * last change: $Author: sb $ $Date: 2000-11-09 13:23:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -63,53 +63,39 @@
#include <ucbhelper/configureucb.hxx>
#endif
-#ifndef _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HPP_
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#endif
#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#endif
-#ifndef _COM_SUN_STAR_UCB_CONTENTPROVIDERSERVICEINFO2_HPP_
-#include <com/sun/star/ucb/ContentProviderServiceInfo2.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UCB_DUPLICATEPROVIDEREXCEPTION_HPP_
-#include <com/sun/star/ucb/DuplicateProviderException.hpp>
-#endif
#ifndef _COM_SUN_STAR_UCB_XCONTENTPROVIDER_HPP_
#include <com/sun/star/ucb/XContentProvider.hpp>
#endif
-#ifndef _COM_SUN_STAR_UCB_XCONTENTPROVIDERCONFIGURATION_HPP_
-#include <com/sun/star/ucb/XContentProviderConfiguration.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UCB_XCONTENTPROVIDERCONFIGURATIONMANAGER_HPP_
-#include <com/sun/star/ucb/XContentProviderConfigurationManager.hpp>
-#endif
#ifndef _COM_SUN_STAR_UCB_XCONTENTPROVIDERMANAGER_HPP_
#include <com/sun/star/ucb/XContentProviderManager.hpp>
#endif
-#ifndef _COM_SUN_STAR_UCB_XPARAMETERIZEDCONTENTPROVIDER_HPP_
-#include <com/sun/star/ucb/XParameterizedContentProvider.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UNO_EXCEPTION_HPP_
-#include <com/sun/star/uno/Exception.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX_
-#include <com/sun/star/uno/Reference.hxx>
+#ifndef _COM_SUN_STAR_UNO_ANY_HXX_
+#include <com/sun/star/uno/Any.hxx>
#endif
#ifndef _COM_SUN_STAR_UNO_RUNTIMEEXCEPTION_HPP_
#include <com/sun/star/uno/RuntimeException.hpp>
#endif
-#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
-#include <com/sun/star/uno/Sequence.hxx>
+#ifndef _RTL_USTRBUF_HXX_
+#include <rtl/ustrbuf.hxx>
#endif
-#ifndef _RTL_USTRING_HXX_
-#include <rtl/ustring.hxx>
+#ifndef _VOS_DIAGNOSE_H_
+#include <vos/diagnose.hxx>
#endif
+#ifndef _UCBHELPER_PROVCONF_HXX_
+#include <provconf.hxx>
+#endif
#ifndef _UCBHELPER_REGISTERUCB_HXX_
-#include <ucbhelper/registerucb.hxx>
+#include <registerucb.hxx>
#endif
+namespace unnamed_ucbhelper_configureucb {}
+using namespace unnamed_ucbhelper_configureucb;
+ // unnamed namespaces don't work well yet...
+
using namespace com::sun;
using namespace com::sun::star;
@@ -119,49 +105,161 @@ using namespace com::sun::star;
//
//============================================================================
+namespace unnamed_ucbhelper_configureucb {
+
+bool fillPlaceholders(rtl::OUString const & rInput,
+ uno::Sequence< uno::Any > const & rReplacements,
+ rtl::OUString * pOutput)
+{
+ sal_Unicode const * p = rInput.getStr();
+ sal_Unicode const * pEnd = p + rInput.getLength();
+ sal_Unicode const * pCopy = p;
+ rtl::OUStringBuffer aBuffer;
+ while (p != pEnd)
+ switch (*p++)
+ {
+ case '&':
+ if (pEnd - p >= 4
+ && p[0] == 'a' && p[1] == 'm' && p[2] == 'p'
+ && p[3] == ';')
+ {
+ aBuffer.append(pCopy, p - 1 - pCopy);
+ aBuffer.append(sal_Unicode('&'));
+ p += 4;
+ pCopy = p;
+ }
+ else if (pEnd - p >= 3
+ && p[0] == 'l' && p[1] == 't' && p[2] == ';')
+ {
+ aBuffer.append(pCopy, p - 1 - pCopy);
+ aBuffer.append(sal_Unicode('<'));
+ p += 3;
+ pCopy = p;
+ }
+ else if (pEnd - p >= 3
+ && p[0] == 'g' && p[1] == 't' && p[2] == ';')
+ {
+ aBuffer.append(pCopy, p - 1 - pCopy);
+ aBuffer.append(sal_Unicode('>'));
+ p += 3;
+ pCopy = p;
+ }
+ break;
+
+ case '<':
+ sal_Unicode const * q = p;
+ while (q != pEnd && *q != '>')
+ ++q;
+ if (q == pEnd)
+ break;
+ rtl::OUString aKey(p, q - p);
+ rtl::OUString aValue;
+ bool bFound = false;
+ for (sal_Int32 i = 2; i + 1 < rReplacements.getLength();
+ i += 2)
+ {
+ rtl::OUString aReplaceKey;
+ if ((rReplacements[i] >>= aReplaceKey)
+ && aReplaceKey == aKey
+ && (rReplacements[i + 1] >>= aValue))
+ {
+ bFound = true;
+ break;
+ }
+ }
+ if (!bFound)
+ return false;
+ aBuffer.append(pCopy, p - 1 - pCopy);
+ aBuffer.append(aValue);
+ p = q + 1;
+ pCopy = p;
+ break;
+ }
+ aBuffer.append(pCopy, pEnd - pCopy);
+ *pOutput = aBuffer.makeStringAndClear();
+ return true;
+}
+
+}
+
namespace ucb {
bool
configureUcb(
- uno::Reference< star::ucb::XContentProviderManager > const & rUcb,
- uno::Reference< lang::XMultiServiceFactory > const & rFactory,
- rtl::OUString const & rConfigurationKey)
+ uno::Reference< star::ucb::XContentProviderManager > const & rManager,
+ uno::Reference< lang::XMultiServiceFactory > const & rServiceFactory,
+ uno::Sequence< uno::Any > const & rArguments,
+ std::vector< ContentProviderRegistrationInfo > * pInfos)
throw (uno::RuntimeException)
{
- if (!(rUcb.is() && rFactory.is()))
+ rtl::OUString aKey1;
+ rtl::OUString aKey2;
+ if (rArguments.getLength() < 2
+ || !(rArguments[0] >>= aKey1) || !(rArguments[1] >>= aKey2))
+ {
+ VOS_ENSURE(false, "ucb::configureUcb(): Bad arguments");
return false;
+ }
- uno::Reference< star::ucb::XContentProviderConfigurationManager >
- xManager;
- try
+ ContentProviderDataList aData;
+ if (!getContentProviderData(rServiceFactory, aKey1, aKey2, aData))
{
- xManager
- = uno::Reference<
- star::ucb::XContentProviderConfigurationManager >(
- rFactory->
- createInstance(rtl::OUString::createFromAscii(
- "com.sun.star.ucb.Configuration")),
- uno::UNO_QUERY);
- }
- catch (uno::RuntimeException const &) { throw; }
- catch (uno::Exception const &) {}
- if (!xManager.is())
+ VOS_ENSURE(false, "ucb::configureUcb(): No configuration");
return false;
+ }
- uno::Reference< star::ucb::XContentProviderConfiguration >
- xConfiguration(xManager->queryContentProviderConfiguration(
- rConfigurationKey));
- if (!xConfiguration.is())
- return false;
+ ContentProviderDataList::const_iterator aEnd(aData.end());
+ for (ContentProviderDataList::const_iterator aIt(aData.begin());
+ aIt != aEnd; ++aIt)
+ {
+ rtl::OUString aProviderArguments;
+ if (fillPlaceholders(aIt->Arguments,
+ rArguments,
+ &aProviderArguments))
+ {
+ ContentProviderRegistrationInfo aInfo;
+ registerAtUcb(rManager,
+ rServiceFactory,
+ aIt->ServiceName,
+ aProviderArguments,
+ aIt->URLTemplate,
+ &aInfo);
+ VOS_ENSURE(aInfo.m_xProvider.is(),
+ "ucb::configureUcb(): Bad content provider");
+
+ if (pInfos)
+ pInfos->push_back(aInfo);
+ }
+ else
+ VOS_ENSURE(false,
+ "ucb::configureUcb(): Bad argument placeholders");
+ }
- registerAtUcb(rUcb,
- rFactory,
- xConfiguration->
- queryContentProviderServiceInfo(rtl::OUString()),
- 0);
return true;
}
}
+//============================================================================
+//
+// unconfigureUcb
+//
+//============================================================================
+
+namespace ucb {
+void
+unconfigureUcb(
+ uno::Reference< star::ucb::XContentProviderManager > const & rManager,
+ std::vector< ContentProviderRegistrationInfo > const & rInfos)
+ throw (uno::RuntimeException)
+{
+ std::vector< ContentProviderRegistrationInfo >::const_iterator
+ aEnd(rInfos.end());
+ for (std::vector< ContentProviderRegistrationInfo >::const_iterator
+ aIt(rInfos.begin());
+ aIt != aEnd; ++aIt)
+ deregisterFromUcb(rManager, *aIt);
+}
+
+}
diff --git a/ucbhelper/source/provider/registerucb.cxx b/ucbhelper/source/provider/registerucb.cxx
index a86aa199427e..9fadf87f0c1a 100644
--- a/ucbhelper/source/provider/registerucb.cxx
+++ b/ucbhelper/source/provider/registerucb.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: registerucb.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:03:37 $
+ * last change: $Author: sb $ $Date: 2000-11-09 13:23:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -60,15 +60,12 @@
************************************************************************/
#ifndef _UCBHELPER_REGISTERUCB_HXX_
-#include <ucbhelper/registerucb.hxx>
+#include <registerucb.hxx>
#endif
#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#endif
-#ifndef _COM_SUN_STAR_UCB_CONTENTPROVIDERSERVICEINFO2_HPP_
-#include <com/sun/star/ucb/ContentProviderServiceInfo2.hpp>
-#endif
#ifndef _COM_SUN_STAR_UCB_XCONTENTPROVIDERMANAGER_HPP_
#include <com/sun/star/ucb/XContentProviderManager.hpp>
#endif
@@ -78,122 +75,125 @@
#ifndef _COM_SUN_STAR_UCB_XCONTENTPROVIDERFACTORY_HPP_
#include <com/sun/star/ucb/XContentProviderFactory.hpp>
#endif
+#ifndef _COM_SUN_STAR_UNO_RUNTIMEEXCEPTION_HPP_
+#include <com/sun/star/uno/RuntimeException.hpp>
+#endif
+#ifndef _VOS_DIAGNOSE_H_
+#include <vos/diagnose.hxx>
+#endif
+
+#ifndef _UCBHELPER_CONFIGUREUCB_HXX_
+#include <ucbhelper/configureucb.hxx>
+#endif
using namespace com::sun;
using namespace com::sun::star;
+namespace ucb {
+
//============================================================================
//
// registerAtUcb
//
//============================================================================
-namespace ucb {
-
void
registerAtUcb(
- uno::Reference< star::ucb::XContentProviderManager > const & rUcb,
- uno::Reference< lang::XMultiServiceFactory > const & rFactory,
- uno::Sequence< star::ucb::ContentProviderServiceInfo2 > const &
- rProviders,
- std::vector< ContentProviderRegistrationInfo > * pResults)
+ uno::Reference< star::ucb::XContentProviderManager > const & rManager,
+ uno::Reference< lang::XMultiServiceFactory > const & rServiceFactory,
+ rtl::OUString const & rName,
+ rtl::OUString const & rArguments,
+ rtl::OUString const & rTemplate,
+ ContentProviderRegistrationInfo * pInfo)
throw (uno::RuntimeException)
{
- uno::Reference< star::ucb::XContentProviderFactory > xFac;
+ VOS_ENSURE(rServiceFactory.is(),
+ "ucb::registerAtUcb(): No service factory");
+
+ uno::Reference< star::ucb::XContentProviderFactory > xProxyFactory;
try
{
- xFac = uno::Reference< star::ucb::XContentProviderFactory >(
- rFactory->createInstance(
- rtl::OUString::createFromAscii(
- "com.sun.star.ucb.ContentProviderProxyFactory")),
- uno::UNO_QUERY);
+ xProxyFactory
+ = uno::Reference< star::ucb::XContentProviderFactory >(
+ rServiceFactory->
+ createInstance(
+ rtl::OUString::createFromAscii(
+ "com.sun.star.ucb."
+ "ContentProviderProxyFactory")),
+ uno::UNO_QUERY);
}
catch (uno::RuntimeException const &) { throw; }
catch (uno::Exception const &) {}
- star::ucb::ContentProviderServiceInfo2 const * pInfo
- = rProviders.getConstArray();
- for (sal_Int32 n = rProviders.getLength(); n > 0; --n)
+ // First, try to instantiate proxy for provider:
+ uno::Reference< star::ucb::XContentProvider > xProvider;
+ if (xProxyFactory.is())
+ xProvider = xProxyFactory->createContentProvider(rName);
+
+ // Then, try to instantiate provider directly:
+ if (!xProvider.is())
+ try
+ {
+ xProvider = uno::Reference< star::ucb::XContentProvider >(
+ rServiceFactory->createInstance(rName),
+ uno::UNO_QUERY);
+ }
+ catch (uno::RuntimeException const &) { throw; }
+ catch (uno::Exception const &) {}
+
+ uno::Reference< star::ucb::XContentProvider >
+ xOriginalProvider(xProvider);
+ uno::Reference< star::ucb::XParameterizedContentProvider >
+ xParameterized(xProvider, uno::UNO_QUERY);
+ if (xParameterized.is())
{
- uno::Reference< star::ucb::XContentProvider > xProvider;
- if (xFac.is())
+ uno::Reference< star::ucb::XContentProvider > xInstance;
+ try
{
- // Try to instantiate proxy for provider.
- xProvider = xFac->createContentProvider(pInfo->Service);
+ xInstance
+ = xParameterized->registerInstance(rTemplate,
+ rArguments,
+ true);
+ //@@@ if this call replaces an old instance, the commit-or-
+ // rollback code below will not work
}
+ catch (lang::IllegalArgumentException const &) {}
+
+ if (xInstance.is())
+ xProvider = xInstance;
+ }
- if (!xProvider.is())
+ if (rManager.is() && xProvider.is())
+ try
{
- // Try to instantiate provider directly.
- try
- {
- xProvider = uno::Reference< star::ucb::XContentProvider >(
- rFactory->createInstance(pInfo->Service),
- uno::UNO_QUERY);
- }
- catch (uno::RuntimeException const &) { throw; }
- catch (uno::Exception const &) {}
+ rManager->registerContentProvider(xProvider, rTemplate, true);
}
-
- uno::Reference< star::ucb::XContentProvider >
- xOriginalProvider(xProvider);
- uno::Reference< star::ucb::XParameterizedContentProvider >
- xParameterized(xProvider, uno::UNO_QUERY);
- if (xParameterized.is())
+ catch (star::ucb::DuplicateProviderException const &)
{
- uno::Reference< star::ucb::XContentProvider > xInstance;
- try
- {
- xInstance
- = xParameterized->registerInstance(pInfo->Scheme,
- pInfo->Arguments,
- pInfo->
- ReplaceExisting);
- //@@@ if this call replaces an old instance, the commit-
- // or-rollback code below will not work
- }
- catch (lang::IllegalArgumentException const &) {}
-
- if (xInstance.is())
- xProvider = xInstance;
+ if (xParameterized.is())
+ try
+ {
+ xParameterized->deregisterInstance(rTemplate, rArguments);
+ }
+ catch (lang::IllegalArgumentException const &) {}
+ xOriginalProvider = 0;
+ }
+ catch (...)
+ {
+ if (xParameterized.is())
+ try
+ {
+ xParameterized->deregisterInstance(rTemplate, rArguments);
+ }
+ catch (lang::IllegalArgumentException const &) {}
+ throw;
}
- if (rUcb.is() && xProvider.is())
- try
- {
- rUcb->registerContentProvider(xProvider, pInfo->Scheme,
- pInfo->ReplaceExisting);
- }
- catch (star::ucb::DuplicateProviderException const &)
- {
- if (xParameterized.is())
- try
- {
- xParameterized->deregisterInstance(pInfo->Scheme,
- pInfo->Arguments);
- }
- catch (lang::IllegalArgumentException const &) {}
- xOriginalProvider = 0;
- }
- catch (...)
- {
- if (xParameterized.is())
- try
- {
- xParameterized->deregisterInstance(pInfo->Scheme,
- pInfo->Arguments);
- }
- catch (lang::IllegalArgumentException const &) {}
- throw;
- }
-
- if (pResults)
- pResults->
- push_back(ContentProviderRegistrationInfo(xOriginalProvider,
- pInfo->Arguments,
- pInfo->Scheme));
-
- ++pInfo;
+ if (pInfo)
+ {
+ pInfo->m_xProvider = xOriginalProvider;
+ pInfo->m_aArguments = rArguments;
+ pInfo->m_aTemplate = rTemplate;
}
}
@@ -205,45 +205,33 @@ registerAtUcb(
void
deregisterFromUcb(
- uno::Reference< star::ucb::XContentProviderManager > const & rUcb,
- std::vector< ContentProviderRegistrationInfo > const & rProviders)
+ uno::Reference< star::ucb::XContentProviderManager > const & rManager,
+ ContentProviderRegistrationInfo const & rInfo)
throw (uno::RuntimeException)
{
- std::vector< ContentProviderRegistrationInfo >::const_iterator
- aEnd(rProviders.end());
- for (std::vector< ContentProviderRegistrationInfo >::const_iterator
- aIt(rProviders.begin());
- aIt != aEnd; ++aIt)
+ uno::Reference< star::ucb::XContentProvider >
+ xProvider(rInfo.m_xProvider);
+ uno::Reference< star::ucb::XParameterizedContentProvider >
+ xParameterized(xProvider, uno::UNO_QUERY);
+ if (xParameterized.is())
{
- uno::Reference< star::ucb::XContentProvider >
- xProvider(aIt->m_xProvider);
- if (xProvider.is())
+ uno::Reference< star::ucb::XContentProvider > xInstance;
+ try
{
- uno::Reference< star::ucb::XParameterizedContentProvider >
- xParameterized(xProvider, uno::UNO_QUERY);
- if (xParameterized.is())
- {
- uno::Reference< star::ucb::XContentProvider > xInstance;
- try
- {
- xInstance
- = xParameterized->
- deregisterInstance(aIt->m_aTemplate,
- aIt->m_aArguments);
- }
- catch (lang::IllegalArgumentException const &) {}
-
- if (xInstance.is())
- xProvider = xInstance;
- }
-
- if (rUcb.is() && xProvider.is())
- rUcb->deregisterContentProvider(xProvider, aIt->m_aTemplate);
- //@@@ if this fails, a roll-back of deregisterInstance()
- // is missing
+ xInstance
+ = xParameterized->deregisterInstance(rInfo.m_aTemplate,
+ rInfo.m_aArguments);
}
+ catch (lang::IllegalArgumentException const &) {}
+
+ if (xInstance.is())
+ xProvider = xInstance;
}
-}
+ if (rManager.is() && xProvider.is())
+ rManager->deregisterContentProvider(xProvider, rInfo.m_aTemplate);
+ //@@@ if this fails, a roll-back of deregisterInstance() is
+ // missing
}
+}
diff --git a/ucbhelper/source/provider/registerucb.hxx b/ucbhelper/source/provider/registerucb.hxx
new file mode 100644
index 000000000000..99bc7dee7965
--- /dev/null
+++ b/ucbhelper/source/provider/registerucb.hxx
@@ -0,0 +1,132 @@
+/*************************************************************************
+ *
+ * $RCSfile: registerucb.hxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: sb $ $Date: 2000-11-09 13:23:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_REGISTERUCB_HXX_
+#define _UCBHELPER_REGISTERUCB_HXX_
+
+#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_
+#include <com/sun/star/uno/Reference.h>
+#endif
+
+namespace com { namespace sun { namespace star {
+ namespace lang { class XMultiServiceFactory; }
+ namespace ucb { class XContentProviderManager; }
+ namespace uno { class RuntimeException; }
+} } }
+namespace rtl { class OUString; }
+
+namespace ucb {
+
+struct ContentProviderRegistrationInfo;
+
+//============================================================================
+/** Register a content provider at a Universal Content Broker.
+
+ @param rManager A content provider manager (normally, this would be a
+ UCB). May be null, which is only useful if the content provider is an
+ <type>XParamterizedContentProvider</type>s.
+
+ @param rServiceFactory A factory through which to obtain the required
+ services.
+
+ @param rName The service name of the content provider.
+
+ @param rArguments Any arguments to instantiate the content provider with.
+
+ @param rTemplate The URL template to register the content provider on.
+
+ @param pInfo If not null, this output parameter is filled with
+ information about the (atemptively) registered provider.
+ */
+void
+registerAtUcb(
+ com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentProviderManager > const &
+ rManager,
+ com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory > const &
+ rServiceFactory,
+ rtl::OUString const & rName,
+ rtl::OUString const & rArguments,
+ rtl::OUString const & rTemplate,
+ ContentProviderRegistrationInfo * pInfo)
+ throw (com::sun::star::uno::RuntimeException);
+
+//============================================================================
+/** Deregister a content provider from a Universal Content Broker.
+
+ @param rManager A content provider manager (normally, this would be a
+ UCB). May be null, which is only useful if the content provider is an
+ <type>XParamterizedContentProvider</type>s.
+
+ @param rInfo Information about the content provider to deregister.
+ */
+void
+deregisterFromUcb(
+ com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentProviderManager > const &
+ rManager,
+ ContentProviderRegistrationInfo const & rInfo)
+ throw (com::sun::star::uno::RuntimeException);
+
+}
+
+#endif // _UCBHELPER_REGISTERUCB_HXX_