update credits
[LibreOffice.git] / framework / inc / uiconfiguration / moduleuicfgsupplier.hxx
blob1ca6d2383df216c08ee42f7bf79f7e6681ff0212
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __FRAMEWORK_UICONFIGURATION_MODULEUICFGSUPPLIER_HXX_
21 #define __FRAMEWORK_UICONFIGURATION_MODULEUICFGSUPPLIER_HXX_
24 /** Attention: stl headers must(!) be included at first. Otherwhise it can make trouble
25 with solaris headers ...
27 #include <vector>
28 #include <list>
29 #include <boost/unordered_map.hpp>
31 #include <threadhelp/threadhelpbase.hxx>
32 #include <macros/generic.hxx>
33 #include <macros/xinterface.hxx>
34 #include <macros/xtypeprovider.hxx>
35 #include <macros/xserviceinfo.hxx>
36 #include <stdtypes.h>
38 #include <com/sun/star/lang/XServiceInfo.hpp>
39 #include <com/sun/star/lang/XTypeProvider.hpp>
40 #include <com/sun/star/lang/XComponent.hpp>
41 #include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
42 #include <com/sun/star/ui/XUIConfigurationManager.hpp>
43 #include <com/sun/star/frame/XModuleManager2.hpp>
44 #include <com/sun/star/embed/XStorage.hpp>
45 #include <com/sun/star/embed/XTransactedObject.hpp>
47 #include <cppuhelper/weak.hxx>
48 #include <cppuhelper/interfacecontainer.hxx>
49 #include <rtl/ustring.hxx>
52 namespace framework
54 class ModuleUIConfigurationManagerSupplier : public com::sun::star::lang::XTypeProvider ,
55 public com::sun::star::lang::XServiceInfo ,
56 public com::sun::star::lang::XComponent ,
57 public ::com::sun::star::ui::XModuleUIConfigurationManagerSupplier ,
58 private ThreadHelpBase , // Struct for right initalization of mutex member! Must be first of baseclasses.
59 public ::cppu::OWeakObject
61 public:
62 // XInterface, XTypeProvider, XServiceInfo
63 FWK_DECLARE_XINTERFACE
64 FWK_DECLARE_XTYPEPROVIDER
65 DECLARE_XSERVICEINFO
67 ModuleUIConfigurationManagerSupplier( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager );
68 virtual ~ModuleUIConfigurationManagerSupplier();
70 // XComponent
71 virtual void SAL_CALL dispose()
72 throw (::com::sun::star::uno::RuntimeException);
73 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener )
74 throw (::com::sun::star::uno::RuntimeException);
75 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener )
76 throw (::com::sun::star::uno::RuntimeException);
78 // XModuleUIConfigurationManagerSupplier
79 virtual ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > SAL_CALL getUIConfigurationManager( const OUString& ModuleIdentifier )
80 throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
82 private:
83 typedef ::boost::unordered_map< OUString, com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager >, OUStringHash, ::std::equal_to< OUString > > ModuleToModuleCfgMgr;
85 //TODO_AS void impl_initStorages();
87 // private methods
88 ModuleToModuleCfgMgr m_aModuleToModuleUICfgMgrMap;
89 bool m_bDisposed;
90 // TODO_AS bool m_bInit;
91 OUString m_aDefaultConfigURL;
92 OUString m_aUserConfigURL;
93 com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xDefaultCfgRootStorage;
94 com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xUserCfgRootStorage;
95 com::sun::star::uno::Reference< com::sun::star::embed::XTransactedObject > m_xUserRootCommit;
96 com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager2 > m_xModuleMgr;
97 com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
98 ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
102 #endif // __FRAMEWORK_UICONFIGURATION_MODULEUICFGSUPPLIER_HXX_
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */