summaryrefslogtreecommitdiff
path: root/configmgr
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2004-03-30 14:01:00 +0000
committerRüdiger Timm <rt@openoffice.org>2004-03-30 14:01:00 +0000
commitd6cc136c69bb02a92bd7dcaff44127bebcdbd971 (patch)
treec4b9ab703293c8adba60e8a6d7ad41704eac7655 /configmgr
parentf0b730d6d5933601253646d5ef2d1e7b2fbad272 (diff)
INTEGRATION: CWS cfg04 (1.1.2); FILE ADDED
2004/02/03 10:21:46 ssmith 1.1.2.3: #114070# updating to use XComponentFactory 2003/12/18 13:30:19 ssmith 1.1.2.2: #114070# support for system integration feature 2003/12/10 17:18:05 ssmith 1.1.2.1: #114070# partial implementation
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/source/platformbe/systemintegrationmanager.hxx199
1 files changed, 199 insertions, 0 deletions
diff --git a/configmgr/source/platformbe/systemintegrationmanager.hxx b/configmgr/source/platformbe/systemintegrationmanager.hxx
new file mode 100644
index 000000000000..2d67302a6dac
--- /dev/null
+++ b/configmgr/source/platformbe/systemintegrationmanager.hxx
@@ -0,0 +1,199 @@
+#ifndef CONFIGMGR_BACKEND_SYSTEMINTEGRATIONMANAGER_HXX_
+#define CONFIGMGR_BACKEND_SYSTEMINTEGRATIONMANAGER_HXX_
+
+#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XBACKEND_HPP_
+#include <com/sun/star/configuration/backend/XBackend.hpp>
+#endif // _COM_SUN_STAR_CONFIGURATION_BACKEND_XBACKEND_HPP_
+
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include <com/sun/star/uno/XComponentContext.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
+#include <com/sun/star/lang/XInitialization.hpp>
+#endif // _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
+
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif // _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+
+#ifndef _COM_SUN_STAR_UNO_XINTERFACE_HPP_
+#include <com/sun/star/uno/XInterface.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_BACKENDSETUPEXCEPTION_HPP_
+#include <com/sun/star/configuration/backend/BackendSetupException.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XBACKENDCHANGESNOTIFIER_HPP_
+#include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_LANG_XSINGLECOMPONENTFACTORY_HPP_
+#include <com/sun/star/lang/XSingleComponentFactory.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XSINGLELAYERSTRATUM_HPP_
+#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#endif
+
+#ifndef _CPPUHELPER_COMPBASE4_HXX_
+#include <cppuhelper/compbase4.hxx>
+#endif // _CPPUHELPER_COMPBASE4_HXX_
+
+#ifndef INCLUDED_MAP
+#include <map>
+#define INCLUDED_MAP
+#endif
+
+namespace configmgr { namespace backend {
+
+namespace css = com::sun::star ;
+namespace uno = css::uno ;
+namespace lang = css::lang ;
+namespace backenduno = css::configuration::backend ;
+
+
+
+typedef uno::Reference<lang::XSingleComponentFactory> BackendFactory;
+typedef uno::Reference<backenduno::XSingleLayerStratum> XSingleLayerStratum;
+
+
+/* Struct containing a reference to a service factory(XSingleComponentFactory)
+ object and a platform backend (XSingleLayerStratum).
+ The reference to the platform backend will be NULL until the platform backend
+ is initialised */
+struct BackendRefsStruct
+{
+ BackendFactory mFactory;
+ XSingleLayerStratum mBackend;
+
+ BackendRefsStruct(const BackendFactory& aFactory,
+ const XSingleLayerStratum& aBackend)
+ :mFactory(aFactory),mBackend(aBackend){}
+
+
+};
+
+typedef struct BackendRefsStruct BackendRefs;
+typedef cppu::WeakComponentImplHelper4< backenduno::XBackend,
+ backenduno::XBackendChangesNotifier,
+ lang::XInitialization,
+ lang::XServiceInfo> BackendBase ;
+
+
+/**
+ Class implementing the Backend service for system integration backend access.
+ It creates the required backends and coordinates access to them.
+ */
+class SystemIntegrationManager : public BackendBase {
+ public :
+ /**
+ Service constructor from a service factory.
+
+ @param xContext component context
+ */
+ explicit
+ SystemIntegrationManager(
+ const uno::Reference<uno::XComponentContext>& xContext) ;
+ /** Destructor */
+ ~SystemIntegrationManager() ;
+
+ // XBackend
+ virtual uno::Sequence<uno::Reference<backenduno::XLayer> >
+ SAL_CALL listOwnLayers(const rtl::OUString& aComponent)
+ throw (backenduno::BackendAccessException,
+ lang::IllegalArgumentException,
+ uno::RuntimeException) ;
+
+ virtual uno::Reference<backenduno::XUpdateHandler>
+ SAL_CALL getOwnUpdateHandler(const rtl::OUString& aComponent)
+ throw (backenduno::BackendAccessException,
+ lang::IllegalArgumentException,
+ lang::NoSupportException,
+ uno::RuntimeException) ;
+ virtual uno::Sequence<uno::Reference<backenduno::XLayer> > SAL_CALL
+ listLayers(const rtl::OUString& aComponent,
+ const rtl::OUString& aEntity)
+ throw (backenduno::BackendAccessException,
+ lang::IllegalArgumentException,
+ uno::RuntimeException) ;
+ virtual uno::Reference<backenduno::XUpdateHandler> SAL_CALL
+ getUpdateHandler(const rtl::OUString& aComponent,
+ const rtl::OUString& aEntity)
+ throw (backenduno::BackendAccessException,
+ lang::IllegalArgumentException,
+ lang::NoSupportException,
+ uno::RuntimeException) ;
+
+ // XInitialize
+ virtual void SAL_CALL initialize(
+ const uno::Sequence<uno::Any>& aParameters)
+ throw (uno::RuntimeException, uno::Exception,
+ lang::IllegalArgumentException,
+ backenduno::BackendSetupException) ;
+
+ // XServiceInfo
+ virtual rtl::OUString SAL_CALL getImplementationName()
+ throw (uno::RuntimeException) ;
+ virtual sal_Bool SAL_CALL supportsService(
+ const rtl::OUString& aServiceName)
+ throw (uno::RuntimeException) ;
+ virtual uno::Sequence<rtl::OUString> SAL_CALL
+ getSupportedServiceNames(void) throw (uno::RuntimeException) ;
+
+ // XBackendChangesNotifier
+ virtual void SAL_CALL addChangesListener( const uno::Reference<backenduno::XBackendChangesListener>& xListner,
+ const rtl::OUString& aComponent)
+ throw (::com::sun::star::uno::RuntimeException);
+
+
+ virtual void SAL_CALL removeChangesListener( const uno::Reference<backenduno::XBackendChangesListener>& xListner,
+ const rtl::OUString& aComponent)
+ throw (::com::sun::star::uno::RuntimeException);
+
+ /**
+ Provides the implementation name.
+
+ @return implementation name
+ */
+ static rtl::OUString SAL_CALL getSystemIntegrationManagerName(void) ;
+ /**
+ Provides the list of supported services.
+
+ @return list of service names
+ */
+ static uno::Sequence<rtl::OUString> SAL_CALL getServiceNames(void) ;
+ protected:
+ // ComponentHelper
+ virtual void SAL_CALL disposing();
+ private :
+ typedef std::multimap<rtl::OUString, BackendRefs> BackendFactoryList;
+ /** build lookup up table
+ */
+ void buildPlatformBeLookupTable();
+ /** get list of supported components
+ */
+ uno::Sequence<rtl::OUString>
+ getSupportedComponents(const BackendFactory& xFactory);
+ /**
+ get supporting backends from lookup table
+ */
+ std::vector<XSingleLayerStratum>
+ getSupportingBackends(const rtl::OUString& aComponent);
+ /** Mutex for resource protection */
+ osl::Mutex mMutex ;
+ /** Component Context */
+ uno::Reference<uno::XComponentContext> mContext ;
+
+ BackendFactoryList mPlatformBackends;
+
+} ;
+
+} } // configmgr.backend
+
+#endif // CONFIGMGR_BACKEND_SYSTEMINTEGRATIONMANAGER_HXX_