xref: /trunk/main/sd/source/ui/sidebar/PanelFactory.hxx (revision 62024513)
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 #ifndef SD_SIDEBAR_PANEL_FACTORY_HXX
23 #define SD_SIDEBAR_PANEL_FACTORY_HXX
24 
25 #include <cppuhelper/compbase1.hxx>
26 #include <cppuhelper/basemutex.hxx>
27 #include <rtl/ref.hxx>
28 #include "framework/Pane.hxx"
29 
30 #include <com/sun/star/ui/XUIElementFactory.hpp>
31 #include <com/sun/star/uno/XComponentContext.hpp>
32 #include <com/sun/star/lang/XInitialization.hpp>
33 
34 #include <map>
35 #include <boost/noncopyable.hpp>
36 #include <boost/shared_ptr.hpp>
37 
38 
39 namespace css = ::com::sun::star;
40 namespace cssu = ::com::sun::star::uno;
41 
42 
43 namespace sd {
44     class ViewShellBase;
45 }
46 
47 namespace sd { namespace sidebar {
48 
49 namespace
50 {
51     typedef ::cppu::WeakComponentImplHelper1 <
52         css::ui::XUIElementFactory
53         > PanelFactoryInterfaceBase;
54 }
55 
56 
57 class PanelFactory
58     : private ::boost::noncopyable,
59       private ::cppu::BaseMutex,
60       public PanelFactoryInterfaceBase
61 {
62 public:
63     static ::rtl::OUString SAL_CALL getImplementationName (void);
64     static cssu::Reference<cssu::XInterface> SAL_CALL createInstance (
65         const cssu::Reference<css::lang::XMultiServiceFactory>& rxFactory);
66     static cssu::Sequence<rtl::OUString> SAL_CALL getSupportedServiceNames (void);
67 
68     PanelFactory (const cssu::Reference<cssu::XComponentContext>& rxContext);
69     virtual ~PanelFactory (void);
70 
71     virtual void SAL_CALL disposing (void);
72 
73 
74     // XUIElementFactory
75 
76     cssu::Reference<css::ui::XUIElement> SAL_CALL createUIElement (
77         const ::rtl::OUString& rsResourceURL,
78         const ::cssu::Sequence<css::beans::PropertyValue>& rArguments)
79         throw(
80             css::container::NoSuchElementException,
81             css::lang::IllegalArgumentException,
82             cssu::RuntimeException);
83 };
84 
85 
86 } } // end of namespace sd::sidebar
87 
88 #endif
89