update dev300-m58
[ooovba.git] / framework / inc / uiconfiguration / moduleuicfgsupplier.hxx
blob0de43a30cf54b05c5133c2959eb20f4f5f1ce960
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: moduleuicfgsupplier.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __FRAMEWORK_UICONFIGURATION_MODULEUICFGSUPPLIER_HXX_
32 #define __FRAMEWORK_UICONFIGURATION_MODULEUICFGSUPPLIER_HXX_
35 /** Attention: stl headers must(!) be included at first. Otherwhise it can make trouble
36 with solaris headers ...
38 #include <vector>
39 #include <list>
40 #include <hash_map>
42 //_________________________________________________________________________________________________________________
43 // my own includes
44 //_________________________________________________________________________________________________________________
45 #include <threadhelp/threadhelpbase.hxx>
46 #include <macros/generic.hxx>
47 #include <macros/xinterface.hxx>
48 #include <macros/xtypeprovider.hxx>
49 #include <macros/xserviceinfo.hxx>
50 #include <stdtypes.h>
52 //_________________________________________________________________________________________________________________
53 // interface includes
54 //_________________________________________________________________________________________________________________
55 #include <com/sun/star/lang/XServiceInfo.hpp>
56 #include <com/sun/star/lang/XTypeProvider.hpp>
57 #include <com/sun/star/lang/XComponent.hpp>
58 #include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
59 #include <com/sun/star/ui/XUIConfigurationManager.hpp>
60 #include <com/sun/star/frame/XModuleManager.hpp>
61 #include <com/sun/star/embed/XStorage.hpp>
62 #include <com/sun/star/embed/XTransactedObject.hpp>
64 //_________________________________________________________________________________________________________________
65 // other includes
66 //_________________________________________________________________________________________________________________
67 #include <cppuhelper/weak.hxx>
68 #include <cppuhelper/interfacecontainer.hxx>
69 #include <rtl/ustring.hxx>
72 namespace framework
74 class ModuleUIConfigurationManagerSupplier : public com::sun::star::lang::XTypeProvider ,
75 public com::sun::star::lang::XServiceInfo ,
76 public com::sun::star::lang::XComponent ,
77 public ::com::sun::star::ui::XModuleUIConfigurationManagerSupplier ,
78 private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
79 public ::cppu::OWeakObject
81 public:
82 // XInterface, XTypeProvider, XServiceInfo
83 FWK_DECLARE_XINTERFACE
84 FWK_DECLARE_XTYPEPROVIDER
85 DECLARE_XSERVICEINFO
87 ModuleUIConfigurationManagerSupplier( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
88 virtual ~ModuleUIConfigurationManagerSupplier();
90 // XComponent
91 virtual void SAL_CALL dispose()
92 throw (::com::sun::star::uno::RuntimeException);
93 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener )
94 throw (::com::sun::star::uno::RuntimeException);
95 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener )
96 throw (::com::sun::star::uno::RuntimeException);
98 // XModuleUIConfigurationManagerSupplier
99 virtual ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > SAL_CALL getUIConfigurationManager( const ::rtl::OUString& ModuleIdentifier )
100 throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
102 private:
103 typedef ::std::hash_map< rtl::OUString, com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager >, OUStringHashCode, ::std::equal_to< rtl::OUString > > ModuleToModuleCfgMgr;
105 //TODO_AS void impl_initStorages();
107 // private methods
108 ModuleToModuleCfgMgr m_aModuleToModuleUICfgMgrMap;
109 bool m_bDisposed;
110 // TODO_AS bool m_bInit;
111 rtl::OUString m_aDefaultConfigURL;
112 rtl::OUString m_aUserConfigURL;
113 com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xDefaultCfgRootStorage;
114 com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xUserCfgRootStorage;
115 com::sun::star::uno::Reference< com::sun::star::embed::XTransactedObject > m_xUserRootCommit;
116 com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > m_xModuleMgr;
117 com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
118 ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
122 #endif // __FRAMEWORK_UICONFIGURATION_MODULEUICFGSUPPLIER_HXX_