xref: /aoo41x/main/sfx2/inc/sfx2/tbxctrl.hxx (revision 595fd105)
1*353d8f4dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*353d8f4dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*353d8f4dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*353d8f4dSAndrew Rist  * distributed with this work for additional information
6*353d8f4dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*353d8f4dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*353d8f4dSAndrew Rist  * "License"); you may not use this file except in compliance
9*353d8f4dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*353d8f4dSAndrew Rist  *
11*353d8f4dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*353d8f4dSAndrew Rist  *
13*353d8f4dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*353d8f4dSAndrew Rist  * software distributed under the License is distributed on an
15*353d8f4dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*353d8f4dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*353d8f4dSAndrew Rist  * specific language governing permissions and limitations
18*353d8f4dSAndrew Rist  * under the License.
19*353d8f4dSAndrew Rist  *
20*353d8f4dSAndrew Rist  *************************************************************/
21*353d8f4dSAndrew Rist 
22*353d8f4dSAndrew Rist 
23cdf0e10cSrcweir #ifndef _SFXTBXCTRL_HXX
24cdf0e10cSrcweir #define _SFXTBXCTRL_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include "sal/config.h"
27cdf0e10cSrcweir #include "sfx2/dllapi.h"
28cdf0e10cSrcweir #include "sal/types.h"
29cdf0e10cSrcweir #include <vcl/timer.hxx>
30cdf0e10cSrcweir #ifndef _MENU_HXX //autogen
31cdf0e10cSrcweir #include <vcl/menu.hxx>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #ifndef _FIXED_HXX //autogen
34cdf0e10cSrcweir #include <vcl/fixed.hxx>
35cdf0e10cSrcweir #endif
36cdf0e10cSrcweir #ifndef _FLOATWIN_HXX //autogen
37cdf0e10cSrcweir #include <vcl/floatwin.hxx>
38cdf0e10cSrcweir #endif
39cdf0e10cSrcweir #include <sfx2/ctrlitem.hxx>
40cdf0e10cSrcweir #include <sfx2/sfxstatuslistener.hxx>
41cdf0e10cSrcweir #include <svtools/toolboxcontroller.hxx>
42cdf0e10cSrcweir #include <svtools/framestatuslistener.hxx>
43cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
44cdf0e10cSrcweir #include <com/sun/star/frame/XDispatchProvider.hpp>
45cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp>
46cdf0e10cSrcweir #include <com/sun/star/awt/XDockableWindowListener.hpp>
47cdf0e10cSrcweir #include <com/sun/star/awt/XDockableWindow.hpp>
48cdf0e10cSrcweir #include <com/sun/star/frame/XSubToolbarController.hpp>
49cdf0e10cSrcweir 
50cdf0e10cSrcweir //------------------------------------------------------------------
51cdf0e10cSrcweir 
52cdf0e10cSrcweir class SfxUnoToolBoxControl;
53cdf0e10cSrcweir class SfxToolBoxControl;
54cdf0e10cSrcweir class SfxBindings;
55cdf0e10cSrcweir class SfxModule;
56cdf0e10cSrcweir class SfxUnoControllerItem;
57cdf0e10cSrcweir 
58cdf0e10cSrcweir svt::ToolboxController* SAL_CALL SfxToolBoxControllerFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, ToolBox* pToolbox, unsigned short nID, const ::rtl::OUString& aCommandURL );
59cdf0e10cSrcweir 
60cdf0e10cSrcweir //typedef SfxToolBoxControl* (*SfxToolBoxControlCtor)( sal_uInt16 nId, ToolBox &rTbx, SfxBindings & );
61cdf0e10cSrcweir typedef SfxToolBoxControl* (*SfxToolBoxControlCtor)( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rBox );
62cdf0e10cSrcweir 
63cdf0e10cSrcweir struct SfxTbxCtrlFactory
64cdf0e10cSrcweir {
65cdf0e10cSrcweir 	SfxToolBoxControlCtor	pCtor;
66cdf0e10cSrcweir 	TypeId					nTypeId;
67cdf0e10cSrcweir 	sal_uInt16					nSlotId;
68cdf0e10cSrcweir 
SfxTbxCtrlFactorySfxTbxCtrlFactory69cdf0e10cSrcweir 	SfxTbxCtrlFactory( SfxToolBoxControlCtor pTheCtor,
70cdf0e10cSrcweir 			TypeId nTheTypeId, sal_uInt16 nTheSlotId ):
71cdf0e10cSrcweir 		pCtor(pTheCtor),
72cdf0e10cSrcweir 		nTypeId(nTheTypeId),
73cdf0e10cSrcweir 		nSlotId(nTheSlotId)
74cdf0e10cSrcweir 	{}
75cdf0e10cSrcweir };
76cdf0e10cSrcweir 
77cdf0e10cSrcweir //------------------------------------------------------------------
78cdf0e10cSrcweir 
79cdf0e10cSrcweir enum SfxPopupWindowType
80cdf0e10cSrcweir {
81cdf0e10cSrcweir 	SFX_POPUPWINDOW_NONE,
82cdf0e10cSrcweir 	SFX_POPUPWINDOW_ONCLICK,
83cdf0e10cSrcweir 	SFX_POPUPWINDOW_ONTIMEOUT,
84cdf0e10cSrcweir 	SFX_POPUPWINDOW_ONCLICKANDMOVE,
85cdf0e10cSrcweir 	SFX_POPUPWINDOW_ONTIMEOUTANDMOVE,
86cdf0e10cSrcweir 	SFX_POPUPWINDOW_CONTEXTMENU
87cdf0e10cSrcweir };
88cdf0e10cSrcweir 
89cdf0e10cSrcweir //------------------------------------------------------------------
90cdf0e10cSrcweir 
91cdf0e10cSrcweir class SfxFrameStatusListener : public svt::FrameStatusListener
92cdf0e10cSrcweir {
93cdf0e10cSrcweir     public:
94cdf0e10cSrcweir         SfxFrameStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rServiceManager,
95cdf0e10cSrcweir                                 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
96cdf0e10cSrcweir                                 SfxStatusListenerInterface* pCallee );
97cdf0e10cSrcweir         virtual ~SfxFrameStatusListener();
98cdf0e10cSrcweir 
99cdf0e10cSrcweir         // XStatusListener
100cdf0e10cSrcweir     	virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event )
101cdf0e10cSrcweir             throw ( ::com::sun::star::uno::RuntimeException );
102cdf0e10cSrcweir 
103cdf0e10cSrcweir     private:
104cdf0e10cSrcweir         SfxStatusListenerInterface* m_pCallee;
105cdf0e10cSrcweir };
106cdf0e10cSrcweir 
107cdf0e10cSrcweir //------------------------------------------------------------------
108cdf0e10cSrcweir 
109cdf0e10cSrcweir /*	FloatingWindows, die aus ToolBoxen abgerissen werden k"onnen, sollten
110cdf0e10cSrcweir 	dieser Klasse abgeleitet werden. Da sie ebenfalls von SfxControllerItem
111cdf0e10cSrcweir 	abgeleitet ist, erhalten ihre Instanzen auch die StateChanged Aufrufe.
112cdf0e10cSrcweir */
113cdf0e10cSrcweir 
114cdf0e10cSrcweir class SFX2_DLLPUBLIC SfxPopupWindow: public FloatingWindow, public SfxStatusListenerInterface
115cdf0e10cSrcweir {
116cdf0e10cSrcweir friend class SfxToolBox_Impl;
117cdf0e10cSrcweir     sal_Bool                                                                             m_bFloating;
118cdf0e10cSrcweir     sal_uIntPtr                                                                            m_nEventId;
119cdf0e10cSrcweir     sal_Bool                                                                             m_bCascading;
120cdf0e10cSrcweir     Link                                                                             m_aDeleteLink;
121cdf0e10cSrcweir     sal_uInt16                                                                           m_nId;
122cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >              m_xFrame;
123cdf0e10cSrcweir     SfxFrameStatusListener*                                                          m_pStatusListener;
124cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >           m_xStatusListener;
125cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
126cdf0e10cSrcweir 
127cdf0e10cSrcweir private:
128cdf0e10cSrcweir     SfxFrameStatusListener* GetOrCreateStatusListener();
129cdf0e10cSrcweir 
130cdf0e10cSrcweir     SAL_DLLPRIVATE SfxPopupWindow(SfxPopupWindow &); // not defined
131cdf0e10cSrcweir     SAL_DLLPRIVATE void operator =(SfxPopupWindow &); // not defined
132cdf0e10cSrcweir 
133cdf0e10cSrcweir //#if 0 // _SOLAR__PRIVATE
134cdf0e10cSrcweir 	DECL_DLLPRIVATE_LINK( Delete, void * );
135cdf0e10cSrcweir //#endif
136cdf0e10cSrcweir 
137cdf0e10cSrcweir protected:
138cdf0e10cSrcweir 	virtual void			PopupModeEnd();
139cdf0e10cSrcweir 	virtual sal_Bool			Close();
140cdf0e10cSrcweir 	virtual void			DeleteFloatingWindow();
141cdf0e10cSrcweir 
GetId() const142cdf0e10cSrcweir     sal_uInt16                  GetId() const { return m_nId; }
GetFrame() const143cdf0e10cSrcweir     const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& GetFrame() const { return m_xFrame; }
GetServiceManager() const144cdf0e10cSrcweir     const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& GetServiceManager() const { return m_xServiceManager; }
145cdf0e10cSrcweir 
146cdf0e10cSrcweir     void                    BindListener();
147cdf0e10cSrcweir     void                    UnbindListener();
148cdf0e10cSrcweir     void                    AddStatusListener( const rtl::OUString& rCommandURL );
149cdf0e10cSrcweir     void                    RemoveStatusListener( const rtl::OUString& rCommandURL );
150cdf0e10cSrcweir     void                    UpdateStatus( const rtl::OUString& rCommandURL );
151cdf0e10cSrcweir 
152cdf0e10cSrcweir     // SfxStatusListenerInterface
153cdf0e10cSrcweir     using FloatingWindow::StateChanged;
154cdf0e10cSrcweir     virtual void			StateChanged( sal_uInt16 nSID, SfxItemState eState,
155cdf0e10cSrcweir 										  const SfxPoolItem* pState );
156cdf0e10cSrcweir 
157cdf0e10cSrcweir public:
158cdf0e10cSrcweir                             SfxPopupWindow( sal_uInt16 nId,
159cdf0e10cSrcweir                                             const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
160cdf0e10cSrcweir                                             WinBits nBits );
161cdf0e10cSrcweir 							SfxPopupWindow( sal_uInt16 nId,
162cdf0e10cSrcweir                                             const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
163cdf0e10cSrcweir                                             const ResId &rId );
164cdf0e10cSrcweir 							SfxPopupWindow( sal_uInt16 nId,
165cdf0e10cSrcweir                                             const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
166cdf0e10cSrcweir                                             Window* pParentWindow,
167cdf0e10cSrcweir                                             const ResId &rId );
168cdf0e10cSrcweir                             SfxPopupWindow( sal_uInt16 nId,
169cdf0e10cSrcweir                                             const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
170cdf0e10cSrcweir                                             Window* pParentWindow,
171cdf0e10cSrcweir                                             WinBits nBits );
172cdf0e10cSrcweir                             ~SfxPopupWindow();
173cdf0e10cSrcweir 
174cdf0e10cSrcweir 	virtual SfxPopupWindow* Clone() const;
175cdf0e10cSrcweir 	virtual void			MouseMove( const MouseEvent& rMEvt );
176cdf0e10cSrcweir 
177cdf0e10cSrcweir 	void					StartCascading();
178cdf0e10cSrcweir 	void					EndCascading();
SetDeleteLink_Impl(const Link & rLink)179cdf0e10cSrcweir 	SAL_DLLPRIVATE void SetDeleteLink_Impl( const Link& rLink )
180cdf0e10cSrcweir 							{
181cdf0e10cSrcweir 								m_aDeleteLink = rLink;
182cdf0e10cSrcweir 							}
183cdf0e10cSrcweir };
184cdf0e10cSrcweir 
185cdf0e10cSrcweir //------------------------------------------------------------------
186cdf0e10cSrcweir //------------------------------------------------------------------
187cdf0e10cSrcweir 
188cdf0e10cSrcweir #define SFX_DECL_TOOLBOX_CONTROL() \
189cdf0e10cSrcweir 		static SfxToolBoxControl* CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ); \
190cdf0e10cSrcweir 		static void RegisterControl(sal_uInt16 nSlotId = 0, SfxModule *pMod=NULL)
191cdf0e10cSrcweir 
192cdf0e10cSrcweir /*	F"ur spezielle ToolBox-Controls, z.B. eine Font-Auswahl-Box oder
193cdf0e10cSrcweir 	aus ToolBoxen abrei"sbare FloatingWindows mu"s passend zur Item-Subclass
194cdf0e10cSrcweir 	eine Subclass von SfxTooBoxControl implementiert werden.
195cdf0e10cSrcweir 
196cdf0e10cSrcweir 	Diese Klasse mu"s in SfxApplication::Init() mit der statischen Methode
197cdf0e10cSrcweir 	RegisterControl() registriert werden. Der SFx erzeugt dann automatisch
198cdf0e10cSrcweir 	diese Controls in ToolBoxen, wenn die dazugeh"origen Slots von dem
199cdf0e10cSrcweir 	angegebenen Typ sind.
200cdf0e10cSrcweir  */
201cdf0e10cSrcweir 
202cdf0e10cSrcweir struct SfxToolBoxControl_Impl;
203cdf0e10cSrcweir class SFX2_DLLPUBLIC SfxToolBoxControl:
204cdf0e10cSrcweir                          public ::com::sun::star::awt::XDockableWindowListener,
205cdf0e10cSrcweir                          public ::com::sun::star::frame::XSubToolbarController,
206cdf0e10cSrcweir                          public svt::ToolboxController
207cdf0e10cSrcweir 
208cdf0e10cSrcweir {
209cdf0e10cSrcweir friend class SfxToolbox;
210cdf0e10cSrcweir friend class SfxToolBox_Impl;
211cdf0e10cSrcweir friend class SfxToolboxCustomizer;
212cdf0e10cSrcweir friend class SfxPopupWindow;
213cdf0e10cSrcweir friend struct SfxTbxCtrlFactory;
214cdf0e10cSrcweir 
215cdf0e10cSrcweir     SfxToolBoxControl_Impl*    pImpl;
216cdf0e10cSrcweir 
217cdf0e10cSrcweir protected:
218cdf0e10cSrcweir 	DECL_LINK( PopupModeEndHdl, void * );
219cdf0e10cSrcweir 	DECL_LINK( ClosePopupWindow, SfxPopupWindow * );
220cdf0e10cSrcweir 
221cdf0e10cSrcweir     // old SfxToolBoxControl methods
222cdf0e10cSrcweir     virtual void			   StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
223cdf0e10cSrcweir 	virtual void			   Select( sal_Bool bMod1 = sal_False );
224cdf0e10cSrcweir 	virtual void			   Select( sal_uInt16 nModifier );
225cdf0e10cSrcweir 
226cdf0e10cSrcweir 	virtual void			   DoubleClick();
227cdf0e10cSrcweir 	virtual void			   Click();
228cdf0e10cSrcweir 	virtual SfxPopupWindowType GetPopupWindowType() const;
229cdf0e10cSrcweir 	virtual SfxPopupWindow*    CreatePopupWindow();
230cdf0e10cSrcweir 	virtual	SfxPopupWindow*    CreatePopupWindowCascading();
231cdf0e10cSrcweir 	virtual Window*            CreateItemWindow( Window *pParent );
232cdf0e10cSrcweir 
233cdf0e10cSrcweir     // Must be called by subclass to set a new popup window instance
234cdf0e10cSrcweir     void                       SetPopupWindow( SfxPopupWindow* pWindow );
235cdf0e10cSrcweir 
236cdf0e10cSrcweir     // XInterface
237cdf0e10cSrcweir     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
238cdf0e10cSrcweir 	virtual void			   SAL_CALL acquire() throw();
239cdf0e10cSrcweir 	virtual void			   SAL_CALL release() throw();
240cdf0e10cSrcweir 
241cdf0e10cSrcweir     // XEventListener
242cdf0e10cSrcweir     using ::cppu::OPropertySetHelper::disposing;
243cdf0e10cSrcweir     virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& aEvent ) throw( ::com::sun::star::uno::RuntimeException );
244cdf0e10cSrcweir 
245cdf0e10cSrcweir     // XComponent
246cdf0e10cSrcweir     virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
247cdf0e10cSrcweir 
248cdf0e10cSrcweir     // new controller API
249cdf0e10cSrcweir     // XStatusListener
250cdf0e10cSrcweir 	virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event )
251cdf0e10cSrcweir         throw ( ::com::sun::star::uno::RuntimeException );
252cdf0e10cSrcweir 
253cdf0e10cSrcweir     // XToolbarController
254cdf0e10cSrcweir     virtual void SAL_CALL execute( sal_Int16 KeyModifier )
255cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
256cdf0e10cSrcweir     virtual void SAL_CALL click()
257cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
258cdf0e10cSrcweir     virtual void SAL_CALL doubleClick()
259cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
260cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow()
261cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
262cdf0e10cSrcweir     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 >& rParent )
263cdf0e10cSrcweir         throw (::com::sun::star::uno::RuntimeException);
264cdf0e10cSrcweir 
265cdf0e10cSrcweir     // XSubToolbarController
266cdf0e10cSrcweir     virtual ::sal_Bool SAL_CALL opensSubToolbar(  ) throw (::com::sun::star::uno::RuntimeException);
267cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getSubToolbarName(  ) throw (::com::sun::star::uno::RuntimeException);
268cdf0e10cSrcweir     virtual void SAL_CALL functionSelected( const ::rtl::OUString& aCommand ) throw (::com::sun::star::uno::RuntimeException);
269cdf0e10cSrcweir     virtual void SAL_CALL updateImage(  ) throw (::com::sun::star::uno::RuntimeException);
270cdf0e10cSrcweir 
271cdf0e10cSrcweir     //  XDockableWindowListener
272cdf0e10cSrcweir     virtual void SAL_CALL startDocking( const ::com::sun::star::awt::DockingEvent& e ) throw (::com::sun::star::uno::RuntimeException);
273cdf0e10cSrcweir     virtual ::com::sun::star::awt::DockingData SAL_CALL docking( const ::com::sun::star::awt::DockingEvent& e ) throw (::com::sun::star::uno::RuntimeException);
274cdf0e10cSrcweir     virtual void SAL_CALL endDocking( const ::com::sun::star::awt::EndDockingEvent& e ) throw (::com::sun::star::uno::RuntimeException);
275cdf0e10cSrcweir     virtual sal_Bool SAL_CALL prepareToggleFloatingMode( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
276cdf0e10cSrcweir     virtual void SAL_CALL toggleFloatingMode( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
277cdf0e10cSrcweir     virtual void SAL_CALL closed( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
278cdf0e10cSrcweir     virtual void SAL_CALL endPopupMode( const ::com::sun::star::awt::EndPopupModeEvent& e ) throw (::com::sun::star::uno::RuntimeException);
279cdf0e10cSrcweir 
280cdf0e10cSrcweir     // helper methods
281cdf0e10cSrcweir     void    createAndPositionSubToolBar( const ::rtl::OUString& rSubToolBarResName );
282cdf0e10cSrcweir     ::Size  getPersistentFloatingSize( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, const ::rtl::OUString& rSubToolBarResName );
283cdf0e10cSrcweir 
284cdf0e10cSrcweir public:
285cdf0e10cSrcweir 							   SFX_DECL_TOOLBOX_CONTROL();
286cdf0e10cSrcweir 
287cdf0e10cSrcweir                                SfxToolBoxControl( sal_uInt16 nSlotID, sal_uInt16 nId, ToolBox& rBox, sal_Bool bShowStrings = sal_False );
288cdf0e10cSrcweir 	virtual 				   ~SfxToolBoxControl();
289cdf0e10cSrcweir 
290cdf0e10cSrcweir     ToolBox&				   GetToolBox() const;
291cdf0e10cSrcweir     unsigned short             GetId() const;
292cdf0e10cSrcweir     unsigned short             GetSlotId() const;
293cdf0e10cSrcweir 
294cdf0e10cSrcweir     void                       Dispatch( const ::rtl::OUString& aCommand,
295cdf0e10cSrcweir                                          ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs );
296cdf0e10cSrcweir     static void                Dispatch( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& rDispatchProvider,
297cdf0e10cSrcweir                                          const rtl::OUString& rCommand,
298cdf0e10cSrcweir                                          ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs );
299cdf0e10cSrcweir 
300cdf0e10cSrcweir     static SfxItemState        GetItemState( const SfxPoolItem* pState );
301cdf0e10cSrcweir     static SfxToolBoxControl*  CreateControl( sal_uInt16 nSlotId, sal_uInt16 nTbxId, ToolBox *pBox, SfxModule *pMod );
302cdf0e10cSrcweir     static void                RegisterToolBoxControl( SfxModule*, SfxTbxCtrlFactory*);
303cdf0e10cSrcweir };
304cdf0e10cSrcweir 
305cdf0e10cSrcweir #define SFX_IMPL_TOOLBOX_CONTROL(Class, nItemClass) \
306cdf0e10cSrcweir 		SfxToolBoxControl* __EXPORT Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \
307cdf0e10cSrcweir 			   { return new Class( nSlotId, nId, rTbx ); } \
308cdf0e10cSrcweir 		void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
309cdf0e10cSrcweir                { SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( \
310cdf0e10cSrcweir 					Class::CreateImpl, TYPE(nItemClass), nSlotId ) ); }
311cdf0e10cSrcweir 
312cdf0e10cSrcweir #define SFX_IMPL_TOOLBOX_CONTROL_ARG(Class, nItemClass, Arg) \
313cdf0e10cSrcweir 		SfxToolBoxControl* __EXPORT Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \
314cdf0e10cSrcweir 			   { return new Class( nSlotId, nId, rTbx, Arg); } \
315cdf0e10cSrcweir 		void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
316cdf0e10cSrcweir                { SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( \
317cdf0e10cSrcweir 					Class::CreateImpl, TYPE(nItemClass), nSlotId ) ); }
318cdf0e10cSrcweir 
319cdf0e10cSrcweir //=========================================================================
320cdf0e10cSrcweir 
321cdf0e10cSrcweir //#if 0 // _SOLAR__PRIVATE
322cdf0e10cSrcweir 
323cdf0e10cSrcweir class SfxDragButton_Impl : public FixedImage
324cdf0e10cSrcweir {
325cdf0e10cSrcweir public:
326cdf0e10cSrcweir 
327cdf0e10cSrcweir                     SfxDragButton_Impl( Window *pParent );
328cdf0e10cSrcweir 	virtual void 	Command ( const CommandEvent& rCEvt );
329cdf0e10cSrcweir 	virtual void	MouseMove( const MouseEvent& rMEvt );
330cdf0e10cSrcweir 	virtual void	MouseButtonDown( const MouseEvent& rMEvt );
331cdf0e10cSrcweir };
332cdf0e10cSrcweir 
333cdf0e10cSrcweir class SfxDragToolBoxControl_Impl : public SfxToolBoxControl
334cdf0e10cSrcweir /*  [Beschreibung]
335cdf0e10cSrcweir 
336cdf0e10cSrcweir */
337cdf0e10cSrcweir 
338cdf0e10cSrcweir {
339cdf0e10cSrcweir public:
340cdf0e10cSrcweir 							SFX_DECL_TOOLBOX_CONTROL();
341cdf0e10cSrcweir 							SfxDragToolBoxControl_Impl( sal_uInt16 nId, ToolBox& rBox );
342cdf0e10cSrcweir 	virtual Window*         CreateItemWindow( Window *pParent );
343cdf0e10cSrcweir     using SfxToolBoxControl::Select;
344cdf0e10cSrcweir     virtual void			Select( sal_Bool bMod1 = sal_False );
345cdf0e10cSrcweir };
346cdf0e10cSrcweir 
347cdf0e10cSrcweir //------------------------------------------------------------------------
348cdf0e10cSrcweir 
349cdf0e10cSrcweir class SfxHistoryToolBoxControl_Impl : public SfxToolBoxControl
350cdf0e10cSrcweir {
351cdf0e10cSrcweir 	Timer					aTimer;
352cdf0e10cSrcweir 
353cdf0e10cSrcweir private:
354cdf0e10cSrcweir 							DECL_LINK( Timeout, Timer * );
355cdf0e10cSrcweir 
356cdf0e10cSrcweir protected:
357cdf0e10cSrcweir     virtual void			Click( );
358cdf0e10cSrcweir     using SfxToolBoxControl::Select;
359cdf0e10cSrcweir     virtual void			Select( sal_Bool );
360cdf0e10cSrcweir 
361cdf0e10cSrcweir public:
362cdf0e10cSrcweir 							SFX_DECL_TOOLBOX_CONTROL();
363cdf0e10cSrcweir 							SfxHistoryToolBoxControl_Impl( sal_uInt16 nId, ToolBox& rBox );
364cdf0e10cSrcweir };
365cdf0e10cSrcweir 
366cdf0e10cSrcweir class SfxReloadToolBoxControl_Impl : public SfxToolBoxControl
367cdf0e10cSrcweir {
368cdf0e10cSrcweir     protected:
369cdf0e10cSrcweir         using SfxToolBoxControl::Select;
370cdf0e10cSrcweir         virtual void Select( sal_uInt16 nSelectModifier );
371cdf0e10cSrcweir 
372cdf0e10cSrcweir     public:
373cdf0e10cSrcweir 	SFX_DECL_TOOLBOX_CONTROL();
374cdf0e10cSrcweir         SfxReloadToolBoxControl_Impl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rBox );
375cdf0e10cSrcweir };
376cdf0e10cSrcweir 
377cdf0e10cSrcweir class SfxPopupMenuManager;
378cdf0e10cSrcweir class SfxAddonsToolBoxControl_Impl : public SfxToolBoxControl
379cdf0e10cSrcweir 
380cdf0e10cSrcweir /*  [Description]
381cdf0e10cSrcweir 
382cdf0e10cSrcweir 	Internal helper class to provide the addons popup menu through the addons
383cdf0e10cSrcweir 	toolbox button.
384cdf0e10cSrcweir */
385cdf0e10cSrcweir 
386cdf0e10cSrcweir {
387cdf0e10cSrcweir 	sal_Bool		bBigImages;
388cdf0e10cSrcweir     PopupMenu*  pMenu;
389cdf0e10cSrcweir 	sal_Bool		m_bWasHiContrastMode;
390cdf0e10cSrcweir 	sal_Bool		m_bShowMenuImages;
391cdf0e10cSrcweir 
392cdf0e10cSrcweir protected:
393cdf0e10cSrcweir     virtual void            Click();
394cdf0e10cSrcweir     using SfxToolBoxControl::Select;
395cdf0e10cSrcweir     virtual void            Select( sal_Bool );
396cdf0e10cSrcweir     virtual void            StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
397cdf0e10cSrcweir 							DECL_LINK( Activate, Menu * ); // Needed to support high contrast images
398cdf0e10cSrcweir public:
399cdf0e10cSrcweir 							SFX_DECL_TOOLBOX_CONTROL();
400cdf0e10cSrcweir                             SfxAddonsToolBoxControl_Impl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rBox );
401cdf0e10cSrcweir                             ~SfxAddonsToolBoxControl_Impl();
402cdf0e10cSrcweir 
403cdf0e10cSrcweir                             void RefreshMenuImages( Menu* pMenu );
404cdf0e10cSrcweir };
405cdf0e10cSrcweir 
406cdf0e10cSrcweir //#endif
407cdf0e10cSrcweir 
408cdf0e10cSrcweir #endif
409