Update ooo320-m1
[ooovba.git] / framework / inc / uielement / complextoolbarcontroller.hxx
blob1c120fe71e08e519cc29c5c3879dd454905095e4
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: complextoolbarcontroller.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_COMPLEXTOOLBARCONTROLLER_HXX_
32 #define __FRAMEWORK_UIELEMENT_COMPLEXTOOLBARCONTROLLER_HXX_
34 #include <com/sun/star/util/URL.hpp>
35 #include <com/sun/star/beans/NamedValue.hpp>
36 #include <com/sun/star/frame/XDispatch.hpp>
37 #include <com/sun/star/frame/ControlCommand.hpp>
38 #include <com/sun/star/frame/XControlNotificationListener.hpp>
40 //_________________________________________________________________________________________________________________
41 // includes of other projects
42 //_________________________________________________________________________________________________________________
43 #include <svtools/toolboxcontroller.hxx>
45 #include <vcl/toolbox.hxx>
47 namespace framework
50 struct ExecuteInfo
52 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
53 ::com::sun::star::util::URL aTargetURL;
54 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs;
57 struct NotifyInfo
59 ::rtl::OUString aEventName;
60 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XControlNotificationListener > xNotifyListener;
61 ::com::sun::star::util::URL aSourceURL;
62 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > aInfoSeq;
65 class ToolBar;
67 class ComplexToolbarController : public svt::ToolboxController
70 public:
71 ComplexToolbarController( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager,
72 const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame,
73 ToolBox* pToolBar,
74 USHORT nID,
75 const rtl::OUString& aCommand );
76 virtual ~ComplexToolbarController();
78 // XComponent
79 virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException );
81 // XToolbarController
82 virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw (::com::sun::star::uno::RuntimeException);
84 // XStatusListener
85 virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
87 DECL_STATIC_LINK( ComplexToolbarController, ExecuteHdl_Impl, ExecuteInfo* );
88 DECL_STATIC_LINK( ComplexToolbarController, Notify_Impl, NotifyInfo* );
90 protected:
91 static sal_Int32 getFontSizePixel( const Window* pWindow );
92 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > getDispatchFromCommand( const rtl::OUString& aCommand ) const;
93 void addNotifyInfo( const ::rtl::OUString& aEventName,
94 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& xDispatch,
95 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rInfo );
97 virtual void executeControlCommand( const ::com::sun::star::frame::ControlCommand& rControlCommand ) = 0;
98 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> getExecuteArgs(sal_Int16 KeyModifier) const;
99 const ::com::sun::star::util::URL& getInitializedURL();
100 void notifyFocusGet();
101 void notifyFocusLost();
102 void notifyTextChanged( const ::rtl::OUString& aText );
104 ToolBox* m_pToolbar;
105 sal_uInt16 m_nID;
106 sal_Bool m_bMadeInvisible;
107 mutable ::com::sun::star::util::URL m_aURL;
108 ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
113 #endif // __FRAMEWORK_UIELEMENT_COMPLEXTOOLBARCONTROLLER_HXX_