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 SD_WORKBENCH_CTP_FACTORY_HXX
25 #define SD_WORKBENCH_CTP_FACTORY_HXX
26 
27 /** === begin UNO includes === **/
28 #include <com/sun/star/uno/XComponentContext.hpp>
29 #include <com/sun/star/ui/XUIElementFactory.hpp>
30 #include <com/sun/star/lang/XServiceInfo.hpp>
31 /** === end UNO includes === **/
32 
33 #include <cppuhelper/implbase2.hxx>
34 #include <cppuhelper/basemutex.hxx>
35 
36 //......................................................................................................................
37 namespace sd { namespace colortoolpanel
38 {
39 //......................................................................................................................
40 
41     class FactoryGuard;
42 
43 	//==================================================================================================================
44 	//= ToolPanelFactory
45 	//==================================================================================================================
46     typedef ::cppu::WeakImplHelper2 <   ::com::sun::star::ui::XUIElementFactory
47                                     ,   ::com::sun::star::lang::XServiceInfo
48                                     >   ToolPanelFactory_Base;
49     class ToolPanelFactory   :public ::cppu::BaseMutex
50                             ,public ToolPanelFactory_Base
51 	{
52     public:
53         ToolPanelFactory(
54             const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext
55         );
56         ~ToolPanelFactory();
57 
58         // XUIElementFactory
59         virtual ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement > SAL_CALL createUIElement( const ::rtl::OUString& i_rResourceURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_rArgs ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
60 
61         // XServiceInfo
62         virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw (::com::sun::star::uno::RuntimeException);
63         virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
64         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException);
65 
66         // XServiceInfo - static versions
67         static ::rtl::OUString SAL_CALL getImplementationName_static(  ) throw (::com::sun::star::uno::RuntimeException);
68         static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_static(  ) throw (::com::sun::star::uno::RuntimeException);
69         static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Create( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext ) throw (::com::sun::star::uno::RuntimeException);
70 
71     private:
72         const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
73                 m_xContext;
74 	};
75 
76 //......................................................................................................................
77 } } // namespace sd::colortoolpanel
78 //......................................................................................................................
79 
80 #endif // SD_WORKBENCH_CTP_FACTORY_HXX
81