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