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 #ifndef RPTUI_TOOLBOXCONTROLLER_HXX
24 #define RPTUI_TOOLBOXCONTROLLER_HXX
25 
26 #include <svtools/toolboxcontroller.hxx>
27 #include <comphelper/stl_types.hxx>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <com/sun/star/uno/XComponentContext.hpp>
30 #include <com/sun/star/frame/XSubToolbarController.hpp>
31 #include <cppuhelper/implbase2.hxx>
32 #include <comphelper/implementationreference.hxx>
33 
34 class SfxToolBoxControl;
35 namespace rptui
36 {
37 	typedef ::cppu::ImplHelper2	<	::com::sun::star::lang::XServiceInfo,
38                                     ::com::sun::star::frame::XSubToolbarController> TToolboxController_BASE;
39     typedef ::comphelper::ImplementationReference<SfxToolBoxControl,::com::sun::star::frame::XToolbarController> TToolbarHelper;
40 
41 	class OToolboxController : public ::svt::ToolboxController
42 							  ,public TToolboxController_BASE
43 	{
44 		DECLARE_STL_USTRINGACCESS_MAP(sal_Bool,TCommandState);
45 		TCommandState	m_aStates;
46 		TToolbarHelper  m_pToolbarController;
47 		sal_uInt16		m_nToolBoxId;
48 		sal_uInt16		m_nSlotId;
49         OToolboxController(const OToolboxController&);
50         void operator =(const OToolboxController&);
51 	public:
52 		OToolboxController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
53 		virtual ~OToolboxController();
54 
55 		// XInterface
56 		virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
57 		virtual void SAL_CALL acquire() throw ();
58 		virtual void SAL_CALL release() throw ();
59 		// XServiceInfo
60 		virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
61 		virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
62 		// need by registration
63 		static ::rtl::OUString getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException );
64 		static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
65 		static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
66 			create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
67 		virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
68 
69 		// XInitialization
70         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);
71 		// XStatusListener
72 		virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
73 		// XToolbarController
74         virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException);
75 
76         // XSubToolbarController
77         virtual ::sal_Bool SAL_CALL opensSubToolbar(  ) throw (::com::sun::star::uno::RuntimeException);
78         virtual ::rtl::OUString SAL_CALL getSubToolbarName(  ) throw (::com::sun::star::uno::RuntimeException);
79         virtual void SAL_CALL functionSelected( const ::rtl::OUString& aCommand ) throw (::com::sun::star::uno::RuntimeException);
80         virtual void SAL_CALL updateImage(  ) throw (::com::sun::star::uno::RuntimeException);
81         virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& Parent ) throw (::com::sun::star::uno::RuntimeException);
82 	};
83 //..........................................................................
84 } // rptui
85 //..........................................................................
86 #endif //RPTUI_TOOLBOXCONTROLLER_HXX
87 
88