diff options
author | Stephan Bergmann <sb@openoffice.org> | 2000-11-09 12:16:05 +0000 |
---|---|---|
committer | Stephan Bergmann <sb@openoffice.org> | 2000-11-09 12:16:05 +0000 |
commit | a69e8a5539b1c49e28c135539b6ccd9bd2d6ad68 (patch) | |
tree | 919cac673dee03759ab63a8ceb715f9a49d60a13 /ucbhelper | |
parent | e649185ea3ea943509758afb7dcf978a4078fc2b (diff) |
Complete redesign of the UCB configuration mechanism.
Diffstat (limited to 'ucbhelper')
-rw-r--r-- | ucbhelper/inc/ucbhelper/configureucb.hxx | 116 |
1 files changed, 85 insertions, 31 deletions
diff --git a/ucbhelper/inc/ucbhelper/configureucb.hxx b/ucbhelper/inc/ucbhelper/configureucb.hxx index 63873735348d..51014affe718 100644 --- a/ucbhelper/inc/ucbhelper/configureucb.hxx +++ b/ucbhelper/inc/ucbhelper/configureucb.hxx @@ -2,9 +2,9 @@ * * $RCSfile: configureucb.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:03:36 $ + * last change: $Author: sb $ $Date: 2000-11-09 13:16:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,61 +62,115 @@ #ifndef _UCBHELPER_CONFIGUREUCB_HXX_ #define _UCBHELPER_CONFIGUREUCB_HXX_ -#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_ -#include <com/sun/star/uno/Reference.h> +#include <vector> + +#ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX_ +#include <com/sun/star/uno/Reference.hxx> +#endif +#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_ +#include <com/sun/star/uno/Sequence.hxx> +#endif +#ifndef _RTL_USTRING_HXX_ +#include <rtl/ustring.hxx> #endif namespace com { namespace sun { namespace star { namespace lang { class XMultiServiceFactory; } - namespace ucb { class XContentProviderManager; } - namespace uno { class RuntimeException; } + namespace ucb { + class XContentProvider; + class XContentProviderManager; + } + namespace uno { + class Any; + class RuntimeException; + } } } } -namespace rtl { class OUString; } + +namespace ucb { //============================================================================ -/** The keys under which the com.sun.star.ucb.Configuration service's - com::sun::star::ucb::XContentProviderConfigurationManager stores the - various com::sun::star::ucb::XContentProviderConfigurations. +/** Information about a registered content provider, passed from + <method>configureUcb</method> to <method>unconfigureUcb</method> (and from + <method>registerAtUcb</method> to <method>deregisterFromUcb</method>). */ -#define UCBHELPER_CONFIGURATION_KEY_STANDARD "ContentProviderServices" -#define UCBHELPER_CONFIGURATION_KEY_LOCAL "LocalContentProviderServices" +struct ContentProviderRegistrationInfo +{ + /** The registered content provider (or null if registration failed). + */ + com::sun::star::uno::Reference< com::sun::star::ucb::XContentProvider > + m_xProvider; -//============================================================================ -namespace ucb { + /** The arguments the content provider was instantiated with. + */ + rtl::OUString m_aArguments; + + /** The URL template the content provider is registered on. + */ + rtl::OUString m_aTemplate; +}; + //@@@ if registerucb.hxx were exported, too, this might better reside in + // there... +//============================================================================ /** Configure a (newly instantiated) Universal Content Broker. - @descr This function tries to register at the given UCB all the content - provider services supplied by the given - com::sun::star::ucb::XContentProviderConfiguration. + @descr This function tries to register at the given content provider + manager all the content provider services listed under a given key in the + configuration database. + + @param rManager A content provider manager (normally, this would be a + newly intantiated UCB). - @param rUcb A (newly intantiated) Universal Content Broker. + @param rServiceFactory A service factory through which to obtain the + various services required. - @param rFactory A factory through which to obtain the - com.sun.star.ucb.Configuration service and the various content provider - services. + @param rArguments A sequence of at least two strings: the primary and + secondary key addressing a chosen UCB configuration in the configuration + database. The sequence can be longer, in which case the excess elements + must be strings that form key/value pairs. These key/value pairs will be + used to replace placeholders in the data from the configuration database + with (dynamic) values. This is a (rather unstructured) sequence of + <type>Any<type/>s, since normally this parameter will simply be forwarded + by the UCB's <method>initialize<method/> method, which has a parameter of + the same type. - @param rConfigurationKey The key under which the given - com.sun.star.ucb.Configuration service's - com::sun::star::ucb::XContentProviderConfigurationManager stores the - desired com::sun::star::ucb::XContentProviderConfiguration. + @pInfos If not null, an entry will be added to this vector for every + content provider that is registered (sucessfully or not). @return True if the UCB has successfuly been configured (though not all - content providers have necessarily been registered due to conflicts with - already registered providers). + content providers have necessarily been registered due to individual + problems). */ bool configureUcb( com::sun::star::uno::Reference< com::sun::star::ucb::XContentProviderManager > const & - rUcb, + rManager, com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > const & - rFactory, - rtl::OUString const & rConfigurationKey) + rServiceFactory, + com::sun::star::uno::Sequence< com::sun::star::uno::Any > const & + rArguments, + std::vector< ContentProviderRegistrationInfo > * pInfos) + throw (com::sun::star::uno::RuntimeException); + +//============================================================================ +/** Undo the configuration of a Universal Content Broker. + + @descr This function is the reverse of <method>configureUcb</method>. + + @param rManager A content provider manager. + + @param rInfos Information about all the registered content providers. + */ +void +unconfigureUcb( + com::sun::star::uno::Reference< + com::sun::star::ucb::XContentProviderManager > const & + rManager, + std::vector< ContentProviderRegistrationInfo > const & rInfos) throw (com::sun::star::uno::RuntimeException); } #endif // _UCBHELPER_CONFIGUREUCB_HXX_ - |