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 DBACCESS_TOOLBOXCONTROLLER_HXX
24 #define DBACCESS_TOOLBOXCONTROLLER_HXX
25 
26 #ifndef _SVTOOLS_TOOLBOXCONTROLLER_HXX
27 #include <svtools/toolboxcontroller.hxx>
28 #endif
29 #ifndef _COMPHELPER_STLTYPES_HXX_
30 #include <comphelper/stl_types.hxx>
31 #endif
32 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
33 #include <com/sun/star/lang/XServiceInfo.hpp>
34 #endif
35 #ifndef _CPPUHELPER_IMPLBASE1_HXX_
36 #include <cppuhelper/implbase1.hxx>
37 #endif
38 #ifndef _DBASHARED_APITOOLS_HXX_
39 #include "apitools.hxx"
40 #endif
41 #ifndef _DBAUI_MODULE_DBU_HXX_
42 #include "moduledbu.hxx"
43 #endif
44 #include <memory>
45 
46 class PopupMenu;
47 namespace dbaui
48 {
49 	typedef ::cppu::ImplHelper1	<	::com::sun::star::lang::XServiceInfo> TToolboxController_BASE;
50 
51 	class OToolboxController : public ::svt::ToolboxController
52 							  ,public TToolboxController_BASE
53 	{
54 		DECLARE_STL_USTRINGACCESS_MAP(sal_Bool,TCommandState);
55         OModuleClient 	m_aModuleClient;
56 		TCommandState	m_aStates;
57 		sal_uInt16		m_nToolBoxId;
58 
59         ::std::auto_ptr<PopupMenu> getMenu();
60 	public:
61 		OToolboxController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
62 
63 		// XInterface
64 		virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
65 		virtual void SAL_CALL acquire() throw ();
66 		virtual void SAL_CALL release() throw ();
67 		// XServiceInfo
68 		DECLARE_SERVICE_INFO_STATIC();
69 
70 		// XInitialization
71         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);
72 		// XStatusListener
73 		virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
74 		// XToolbarController
75         virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException);
76 	};
77 //..........................................................................
78 } // dbaui
79 //..........................................................................
80 #endif //DBACCESS_TOOLBOXCONTROLLER_HXX
81 
82