1*9ee13d13SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*9ee13d13SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*9ee13d13SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*9ee13d13SAndrew Rist * distributed with this work for additional information 6*9ee13d13SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*9ee13d13SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*9ee13d13SAndrew Rist * "License"); you may not use this file except in compliance 9*9ee13d13SAndrew Rist * with the License. You may obtain a copy of the License at 10*9ee13d13SAndrew Rist * 11*9ee13d13SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*9ee13d13SAndrew Rist * 13*9ee13d13SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*9ee13d13SAndrew Rist * software distributed under the License is distributed on an 15*9ee13d13SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*9ee13d13SAndrew Rist * KIND, either express or implied. See the License for the 17*9ee13d13SAndrew Rist * specific language governing permissions and limitations 18*9ee13d13SAndrew Rist * under the License. 19*9ee13d13SAndrew Rist * 20*9ee13d13SAndrew Rist *************************************************************/ 21*9ee13d13SAndrew Rist 22*9ee13d13SAndrew Rist 23cdf0e10cSrcweir #ifndef RPTUI_TOOLBOXCONTROLLER_HXX 24cdf0e10cSrcweir #define RPTUI_TOOLBOXCONTROLLER_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <svtools/toolboxcontroller.hxx> 27cdf0e10cSrcweir #include <comphelper/stl_types.hxx> 28cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 29cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp> 30cdf0e10cSrcweir #include <com/sun/star/frame/XSubToolbarController.hpp> 31cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx> 32cdf0e10cSrcweir #include <comphelper/implementationreference.hxx> 33cdf0e10cSrcweir 34cdf0e10cSrcweir class SfxToolBoxControl; 35cdf0e10cSrcweir namespace rptui 36cdf0e10cSrcweir { 37cdf0e10cSrcweir typedef ::cppu::ImplHelper2 < ::com::sun::star::lang::XServiceInfo, 38cdf0e10cSrcweir ::com::sun::star::frame::XSubToolbarController> TToolboxController_BASE; 39cdf0e10cSrcweir typedef ::comphelper::ImplementationReference<SfxToolBoxControl,::com::sun::star::frame::XToolbarController> TToolbarHelper; 40cdf0e10cSrcweir 41cdf0e10cSrcweir class OToolboxController : public ::svt::ToolboxController 42cdf0e10cSrcweir ,public TToolboxController_BASE 43cdf0e10cSrcweir { 44cdf0e10cSrcweir DECLARE_STL_USTRINGACCESS_MAP(sal_Bool,TCommandState); 45cdf0e10cSrcweir TCommandState m_aStates; 46cdf0e10cSrcweir TToolbarHelper m_pToolbarController; 47cdf0e10cSrcweir sal_uInt16 m_nToolBoxId; 48cdf0e10cSrcweir sal_uInt16 m_nSlotId; 49cdf0e10cSrcweir OToolboxController(const OToolboxController&); 50cdf0e10cSrcweir void operator =(const OToolboxController&); 51cdf0e10cSrcweir public: 52cdf0e10cSrcweir OToolboxController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB); 53cdf0e10cSrcweir virtual ~OToolboxController(); 54cdf0e10cSrcweir 55cdf0e10cSrcweir // XInterface 56cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException); 57cdf0e10cSrcweir virtual void SAL_CALL acquire() throw (); 58cdf0e10cSrcweir virtual void SAL_CALL release() throw (); 59cdf0e10cSrcweir // XServiceInfo 60cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException); 61cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); 62cdf0e10cSrcweir // need by registration 63cdf0e10cSrcweir static ::rtl::OUString getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException ); 64cdf0e10cSrcweir static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException ); 65cdf0e10cSrcweir static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL 66cdf0e10cSrcweir create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext); 67cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); 68cdf0e10cSrcweir 69cdf0e10cSrcweir // XInitialization 70cdf0e10cSrcweir 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); 71cdf0e10cSrcweir // XStatusListener 72cdf0e10cSrcweir virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ); 73cdf0e10cSrcweir // XToolbarController 74cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException); 75cdf0e10cSrcweir 76cdf0e10cSrcweir // XSubToolbarController 77cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL opensSubToolbar( ) throw (::com::sun::star::uno::RuntimeException); 78cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getSubToolbarName( ) throw (::com::sun::star::uno::RuntimeException); 79cdf0e10cSrcweir virtual void SAL_CALL functionSelected( const ::rtl::OUString& aCommand ) throw (::com::sun::star::uno::RuntimeException); 80cdf0e10cSrcweir virtual void SAL_CALL updateImage( ) throw (::com::sun::star::uno::RuntimeException); 81cdf0e10cSrcweir 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); 82cdf0e10cSrcweir }; 83cdf0e10cSrcweir //.......................................................................... 84cdf0e10cSrcweir } // rptui 85cdf0e10cSrcweir //.......................................................................... 86cdf0e10cSrcweir #endif //RPTUI_TOOLBOXCONTROLLER_HXX 87cdf0e10cSrcweir 88