Update ooo320-m1
[ooovba.git] / framework / inc / uielement / buttontoolbarcontroller.hxx
blobd32ea6b8444a1824fd50d11fa9392fb8aee579aa
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: buttontoolbarcontroller.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __FRAMEWORK_UIELEMENT_BUTTONTOOLBARCONTROLLER_HXX_
32 #define __FRAMEWORK_UIELEMENT_BUTTONTOOLBARCONTROLLER_HXX_
34 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
35 #include <com/sun/star/lang/XInitialization.hpp>
36 #include <com/sun/star/util/XUpdatable.hpp>
37 #include <com/sun/star/frame/XFrame.hpp>
38 #include <com/sun/star/frame/XDispatch.hpp>
39 #include <com/sun/star/frame/XStatusListener.hpp>
40 #include <com/sun/star/util/XURLTransformer.hpp>
41 #include <com/sun/star/beans/NamedValue.hpp>
42 #include <com/sun/star/frame/XDispatch.hpp>
43 #include <com/sun/star/frame/ControlCommand.hpp>
44 #include <com/sun/star/frame/XLayoutManager.hpp>
45 #include <com/sun/star/frame/XToolbarController.hpp>
47 //_________________________________________________________________________________________________________________
48 // includes of other projects
49 //_________________________________________________________________________________________________________________
51 #include <comphelper/broadcasthelper.hxx>
52 #include <cppuhelper/weak.hxx>
53 #include <vcl/toolbox.hxx>
55 namespace framework
58 class ToolBar;
59 class ButtonToolbarController : public ::com::sun::star::frame::XStatusListener,
60 public ::com::sun::star::frame::XToolbarController,
61 public ::com::sun::star::lang::XInitialization,
62 public ::com::sun::star::util::XUpdatable,
63 public ::com::sun::star::lang::XComponent,
64 public ::comphelper::OBaseMutex,
65 public ::cppu::OWeakObject
67 public:
68 ButtonToolbarController( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager,
69 ToolBox* pToolBar,
70 const rtl::OUString& aCommand );
71 virtual ~ButtonToolbarController();
73 // XInterface
74 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
75 virtual void SAL_CALL acquire() throw ();
76 virtual void SAL_CALL release() throw ();
78 // XInitialization
79 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);
81 // XUpdatable
82 virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException);
84 // XComponent
85 virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
86 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
87 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
89 // XEventListener
90 virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
92 // XStatusListener
93 virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
95 // XToolbarController
96 virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
97 virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);
98 virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);
99 virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException);
100 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);
102 private:
103 sal_Bool m_bInitialized : 1,
104 m_bDisposed : 1;
105 rtl::OUString m_aCommandURL;
106 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
107 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
108 ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
109 ToolBox* m_pToolbar;
114 #endif // __FRAMEWORK_UIELEMENT_BUTTONTOOLBARCONTROLLER_HXX_