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_UIFACTORY_ADDONSTOOLBOXFACTORY_HXX_
25 #define __FRAMEWORK_UIFACTORY_ADDONSTOOLBOXFACTORY_HXX_
26 
27 //_________________________________________________________________________________________________________________
28 //	my own includes
29 //_________________________________________________________________________________________________________________
30 
31 #include <stdtypes.h>
32 #include <threadhelp/threadhelpbase.hxx>
33 #include <macros/generic.hxx>
34 #include <macros/xinterface.hxx>
35 #include <macros/xtypeprovider.hxx>
36 #include <macros/xserviceinfo.hxx>
37 #include <services.h>
38 
39 //_________________________________________________________________________________________________________________
40 //	interface includes
41 //_________________________________________________________________________________________________________________
42 #include <com/sun/star/lang/XServiceInfo.hpp>
43 #include <com/sun/star/lang/XTypeProvider.hpp>
44 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
45 #include <com/sun/star/beans/PropertyValue.hpp>
46 #include <com/sun/star/ui/XUIElementFactory.hpp>
47 #include <com/sun/star/frame/XModuleManager.hpp>
48 #include <com/sun/star/frame/XFrame.hpp>
49 #include <com/sun/star/frame/XModel.hpp>
50 
51 //_________________________________________________________________________________________________________________
52 //	includes of other projects
53 //_________________________________________________________________________________________________________________
54 #include <cppuhelper/implbase2.hxx>
55 #include <rtl/ustring.hxx>
56 
57 namespace framework
58 {
59 
60 class AddonsToolBoxFactory :  protected ThreadHelpBase							        ,	// Struct for right initialization of mutex member! Must be first of baseclasses.
61 						      public ::cppu::WeakImplHelper2< com::sun::star::lang::XServiceInfo		,
62 							                                  com::sun::star::ui::XUIElementFactory >
63 {
64 	public:
65         AddonsToolBoxFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
66 		virtual ~AddonsToolBoxFactory();
67 
68         //  XInterface, XTypeProvider, XServiceInfo
69 		DECLARE_XSERVICEINFO
70 
71         // XUIElementFactory
72         virtual ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement > SAL_CALL createUIElement( const ::rtl::OUString& ResourceURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Args ) throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
73 
74         sal_Bool hasButtonsInContext( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& rPropSeq,
75                                       const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
76 
77     private:
78         ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
79         ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > m_xModuleManager;
80 };
81 
82 }
83 
84 #endif // __FRAMEWORK_UIFACTORY_ADDONSTOOLBOXFACTORY_HXX_
85