1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef __FRAMEWORK_UICONFIGURATION_MODULEIMAGEMANAGER_HXX_
25 #define __FRAMEWORK_UICONFIGURATION_MODULEIMAGEMANAGER_HXX_
26 
27 
28 /** Attention: stl headers must(!) be included at first. Otherwise it can make trouble
29                with solaris headers ...
30 */
31 #include <vector>
32 #include <list>
33 #include <hash_map>
34 #include <memory>
35 
36 //_________________________________________________________________________________________________________________
37 //	my own includes
38 //_________________________________________________________________________________________________________________
39 #include <threadhelp/threadhelpbase.hxx>
40 #include <macros/generic.hxx>
41 #include <macros/xinterface.hxx>
42 #include <macros/xtypeprovider.hxx>
43 #include <macros/xserviceinfo.hxx>
44 #include <stdtypes.h>
45 #include <uiconfiguration/imagetype.hxx>
46 
47 //_________________________________________________________________________________________________________________
48 //	interface includes
49 //_________________________________________________________________________________________________________________
50 #include <com/sun/star/lang/XServiceInfo.hpp>
51 #include <com/sun/star/lang/XTypeProvider.hpp>
52 #include <com/sun/star/lang/XComponent.hpp>
53 #include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
54 #include <com/sun/star/ui/XUIConfigurationStorage.hpp>
55 #include <com/sun/star/ui/XUIConfiguration.hpp>
56 #include <com/sun/star/ui/XImageManager.hpp>
57 #include <com/sun/star/lang/XInitialization.hpp>
58 #include <com/sun/star/ui/ConfigurationEvent.hpp>
59 #include <com/sun/star/embed/XTransactedObject.hpp>
60 #include <com/sun/star/ui/XImageManager.hpp>
61 
62 //_________________________________________________________________________________________________________________
63 //	other includes
64 //_________________________________________________________________________________________________________________
65 #include <cppuhelper/implbase1.hxx>
66 #include <cppuhelper/interfacecontainer.hxx>
67 #include <rtl/ustring.hxx>
68 
69 #include <vcl/image.hxx>
70 #include <tools/color.hxx>
71 #include <rtl/ref.hxx>
72 
73 #include <vector>
74 
75 namespace framework
76 {
77     class ImageManagerImpl;
78 
79     class ModuleImageManager :    private ThreadHelpBase						                  ,	// Struct for right initialization of mutex member! Must be first of baseclasses.
80 							      public ::cppu::WeakImplHelper1< ::com::sun::star::ui::XImageManager>
81     {
82         public:
83             ModuleImageManager( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xServiceManager );
84             virtual ~ModuleImageManager();
85 
86             // XComponent
87             virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
88             virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
89             virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
90 
91             // XInitialization
92             virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
93 
94             // XImageManager
95             virtual void SAL_CALL reset() throw (::com::sun::star::uno::RuntimeException);
96             virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllImageNames( ::sal_Int16 nImageType ) throw (::com::sun::star::uno::RuntimeException);
97             virtual ::sal_Bool SAL_CALL hasImage( ::sal_Int16 nImageType, const ::rtl::OUString& aCommandURL ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
98             virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > > SAL_CALL getImages( ::sal_Int16 nImageType, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aCommandURLSequence ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
99             virtual void SAL_CALL replaceImages( ::sal_Int16 nImageType, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aCommandURLSequence, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > >& aGraphicsSequence ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IllegalAccessException, ::com::sun::star::uno::RuntimeException);
100             virtual void SAL_CALL removeImages( ::sal_Int16 nImageType, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aResourceURLSequence ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IllegalAccessException, ::com::sun::star::uno::RuntimeException);
101             virtual void SAL_CALL insertImages( ::sal_Int16 nImageType, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aCommandURLSequence, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > >& aGraphicSequence ) throw (::com::sun::star::container::ElementExistException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IllegalAccessException, ::com::sun::star::uno::RuntimeException);
102 
103             // XUIConfiguration
104             virtual void SAL_CALL addConfigurationListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
105             virtual void SAL_CALL removeConfigurationListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
106 
107             // XUIConfigurationPersistence
108             virtual void SAL_CALL reload() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
109             virtual void SAL_CALL store() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
110             virtual void SAL_CALL storeToStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& Storage ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
111             virtual sal_Bool SAL_CALL isModified() throw (::com::sun::star::uno::RuntimeException);
112             virtual sal_Bool SAL_CALL isReadOnly() throw (::com::sun::star::uno::RuntimeException);
113 
114         private:
115             ::std::auto_ptr<ImageManagerImpl>                                               m_pImpl;
116    };
117 }
118 
119 #endif // __FRAMEWORK_UICONFIGURATION_MODULEUICONFIGMANAGER_HXX_
120