1f8e07b45SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3f8e07b45SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4f8e07b45SAndrew Rist * or more contributor license agreements. See the NOTICE file 5f8e07b45SAndrew Rist * distributed with this work for additional information 6f8e07b45SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7f8e07b45SAndrew Rist * to you under the Apache License, Version 2.0 (the 8f8e07b45SAndrew Rist * "License"); you may not use this file except in compliance 9f8e07b45SAndrew Rist * with the License. You may obtain a copy of the License at 10f8e07b45SAndrew Rist * 11f8e07b45SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12f8e07b45SAndrew Rist * 13f8e07b45SAndrew Rist * Unless required by applicable law or agreed to in writing, 14f8e07b45SAndrew Rist * software distributed under the License is distributed on an 15f8e07b45SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16f8e07b45SAndrew Rist * KIND, either express or implied. See the License for the 17f8e07b45SAndrew Rist * specific language governing permissions and limitations 18f8e07b45SAndrew Rist * under the License. 19f8e07b45SAndrew Rist * 20f8e07b45SAndrew Rist *************************************************************/ 21f8e07b45SAndrew Rist 22f8e07b45SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef __FRAMEWORK_UICONFIGURATION_MODULEUICFGSUPPLIER_HXX_ 25cdf0e10cSrcweir #define __FRAMEWORK_UICONFIGURATION_MODULEUICFGSUPPLIER_HXX_ 26cdf0e10cSrcweir 27cdf0e10cSrcweir 28cdf0e10cSrcweir /** Attention: stl headers must(!) be included at first. Otherwhise it can make trouble 29cdf0e10cSrcweir with solaris headers ... 30cdf0e10cSrcweir */ 31cdf0e10cSrcweir #include <vector> 32cdf0e10cSrcweir #include <list> 33cdf0e10cSrcweir #include <hash_map> 34cdf0e10cSrcweir 35cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 36cdf0e10cSrcweir // my own includes 37cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 38cdf0e10cSrcweir #include <threadhelp/threadhelpbase.hxx> 39cdf0e10cSrcweir #include <macros/generic.hxx> 40cdf0e10cSrcweir #include <macros/xinterface.hxx> 41cdf0e10cSrcweir #include <macros/xtypeprovider.hxx> 42cdf0e10cSrcweir #include <macros/xserviceinfo.hxx> 43cdf0e10cSrcweir #include <stdtypes.h> 44cdf0e10cSrcweir 45cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 46cdf0e10cSrcweir // interface includes 47cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 48cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 49cdf0e10cSrcweir #include <com/sun/star/lang/XTypeProvider.hpp> 50cdf0e10cSrcweir #include <com/sun/star/lang/XComponent.hpp> 51cdf0e10cSrcweir #include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> 52cdf0e10cSrcweir #include <com/sun/star/ui/XUIConfigurationManager.hpp> 53cdf0e10cSrcweir #include <com/sun/star/frame/XModuleManager.hpp> 54cdf0e10cSrcweir #include <com/sun/star/embed/XStorage.hpp> 55cdf0e10cSrcweir #include <com/sun/star/embed/XTransactedObject.hpp> 56cdf0e10cSrcweir 57cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 58cdf0e10cSrcweir // other includes 59cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 60cdf0e10cSrcweir #include <cppuhelper/weak.hxx> 61cdf0e10cSrcweir #include <cppuhelper/interfacecontainer.hxx> 62cdf0e10cSrcweir #include <rtl/ustring.hxx> 63cdf0e10cSrcweir 64cdf0e10cSrcweir 65cdf0e10cSrcweir namespace framework 66cdf0e10cSrcweir { 67cdf0e10cSrcweir class ModuleUIConfigurationManagerSupplier : public com::sun::star::lang::XTypeProvider , 68cdf0e10cSrcweir public com::sun::star::lang::XServiceInfo , 69cdf0e10cSrcweir public com::sun::star::lang::XComponent , 70cdf0e10cSrcweir public ::com::sun::star::ui::XModuleUIConfigurationManagerSupplier , 71*30acf5e8Spfg private ThreadHelpBase , // Struct for right initialization of mutex member! Must be first of baseclasses. 72cdf0e10cSrcweir public ::cppu::OWeakObject 73cdf0e10cSrcweir { 74cdf0e10cSrcweir public: 75cdf0e10cSrcweir // XInterface, XTypeProvider, XServiceInfo 76cdf0e10cSrcweir FWK_DECLARE_XINTERFACE 77cdf0e10cSrcweir FWK_DECLARE_XTYPEPROVIDER 78cdf0e10cSrcweir DECLARE_XSERVICEINFO 79cdf0e10cSrcweir 80cdf0e10cSrcweir ModuleUIConfigurationManagerSupplier( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager ); 81cdf0e10cSrcweir virtual ~ModuleUIConfigurationManagerSupplier(); 82cdf0e10cSrcweir 83cdf0e10cSrcweir // XComponent 84cdf0e10cSrcweir virtual void SAL_CALL dispose() 85cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 86cdf0e10cSrcweir virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) 87cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 88cdf0e10cSrcweir virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) 89cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 90cdf0e10cSrcweir 91cdf0e10cSrcweir // XModuleUIConfigurationManagerSupplier 92cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > SAL_CALL getUIConfigurationManager( const ::rtl::OUString& ModuleIdentifier ) 93cdf0e10cSrcweir throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); 94cdf0e10cSrcweir 95cdf0e10cSrcweir private: 965758ad8cSAriel Constenla-Haile typedef ::std::hash_map< rtl::OUString, com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager >, rtl::OUStringHash, ::std::equal_to< rtl::OUString > > ModuleToModuleCfgMgr; 97cdf0e10cSrcweir 98cdf0e10cSrcweir //TODO_AS void impl_initStorages(); 99cdf0e10cSrcweir 100cdf0e10cSrcweir // private methods 101cdf0e10cSrcweir ModuleToModuleCfgMgr m_aModuleToModuleUICfgMgrMap; 102cdf0e10cSrcweir bool m_bDisposed; 103cdf0e10cSrcweir // TODO_AS bool m_bInit; 104cdf0e10cSrcweir rtl::OUString m_aDefaultConfigURL; 105cdf0e10cSrcweir rtl::OUString m_aUserConfigURL; 106cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xDefaultCfgRootStorage; 107cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xUserCfgRootStorage; 108cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::embed::XTransactedObject > m_xUserRootCommit; 109cdf0e10cSrcweir com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > m_xModuleMgr; 110cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager; 111cdf0e10cSrcweir ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener 112cdf0e10cSrcweir }; 113cdf0e10cSrcweir } 114cdf0e10cSrcweir 115cdf0e10cSrcweir #endif // __FRAMEWORK_UICONFIGURATION_MODULEUICFGSUPPLIER_HXX_ 116