xref: /AOO41X/main/sw/source/ui/inc/workctrl.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef _WORKCTRL_HXX
28*cdf0e10cSrcweir #define _WORKCTRL_HXX
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #include <sfx2/tbxctrl.hxx>
31*cdf0e10cSrcweir #include <vcl/toolbox.hxx>
32*cdf0e10cSrcweir #include <svtools/stdctrl.hxx>
33*cdf0e10cSrcweir #ifndef _IMAGEBTN_HXX //autogen
34*cdf0e10cSrcweir #include <vcl/button.hxx>
35*cdf0e10cSrcweir #endif
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir class PopupMenu;
38*cdf0e10cSrcweir class SwView;
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir // doppelter Eintrag! hrc und hxx
41*cdf0e10cSrcweir // diese Ids bestimmen, was die Buttons unter dem Scrollbar tun
42*cdf0e10cSrcweir #define NID_START   20000
43*cdf0e10cSrcweir #define NID_NEXT 	20000
44*cdf0e10cSrcweir #define NID_PREV	20001
45*cdf0e10cSrcweir #define NID_TBL     20002
46*cdf0e10cSrcweir #define NID_FRM     20003
47*cdf0e10cSrcweir #define NID_PGE     20004
48*cdf0e10cSrcweir #define NID_DRW     20005
49*cdf0e10cSrcweir #define NID_CTRL    20006
50*cdf0e10cSrcweir #define NID_REG     20007
51*cdf0e10cSrcweir #define NID_BKM     20008
52*cdf0e10cSrcweir #define NID_GRF    	20009
53*cdf0e10cSrcweir #define NID_OLE    	20010
54*cdf0e10cSrcweir #define NID_OUTL   	20011
55*cdf0e10cSrcweir #define NID_SEL    	20012
56*cdf0e10cSrcweir #define NID_FTN   	20013
57*cdf0e10cSrcweir #define NID_MARK	20014
58*cdf0e10cSrcweir #define NID_POSTIT  20015
59*cdf0e10cSrcweir #define NID_SRCH_REP 20016
60*cdf0e10cSrcweir #define NID_INDEX_ENTRY  20017
61*cdf0e10cSrcweir #define NID_TABLE_FORMULA	20018
62*cdf0e10cSrcweir #define NID_TABLE_FORMULA_ERROR		20019
63*cdf0e10cSrcweir #define NID_COUNT  20
64*cdf0e10cSrcweir 
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir 
67*cdf0e10cSrcweir //----------------------------------------------------------------------------
68*cdf0e10cSrcweir //
69*cdf0e10cSrcweir //----------------------------------------------------------------------------
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir class SwTbxInsertCtrl : public SfxToolBoxControl
72*cdf0e10cSrcweir {
73*cdf0e10cSrcweir 	sal_uInt16 					nLastSlotId;
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir     using SfxToolBoxControl::Select;
76*cdf0e10cSrcweir 	virtual void			Select( sal_Bool bMod1 = sal_False );
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir public:
79*cdf0e10cSrcweir 	SFX_DECL_TOOLBOX_CONTROL();
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir 	SwTbxInsertCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
82*cdf0e10cSrcweir 	~SwTbxInsertCtrl();
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir 	virtual SfxPopupWindowType	GetPopupWindowType() const;
85*cdf0e10cSrcweir 	virtual SfxPopupWindow* 	CreatePopupWindow();
86*cdf0e10cSrcweir 	virtual void				StateChanged( sal_uInt16 nSID,
87*cdf0e10cSrcweir 											  SfxItemState eState,
88*cdf0e10cSrcweir 											  const SfxPoolItem* pState );
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir     virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException);
91*cdf0e10cSrcweir };
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir //----------------------------------------------------------------------------
94*cdf0e10cSrcweir //
95*cdf0e10cSrcweir //----------------------------------------------------------------------------
96*cdf0e10cSrcweir 
97*cdf0e10cSrcweir class SwTbxAutoTextCtrl : public SfxToolBoxControl
98*cdf0e10cSrcweir {
99*cdf0e10cSrcweir 	PopupMenu*				pPopup;
100*cdf0e10cSrcweir 	SwView* 				pView;
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir 	void					DelPopup();
104*cdf0e10cSrcweir public:
105*cdf0e10cSrcweir 	SFX_DECL_TOOLBOX_CONTROL();
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir 	SwTbxAutoTextCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
108*cdf0e10cSrcweir 	~SwTbxAutoTextCtrl();
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir 	virtual SfxPopupWindowType	GetPopupWindowType() const;
111*cdf0e10cSrcweir 	virtual SfxPopupWindow* 	CreatePopupWindow();
112*cdf0e10cSrcweir 	virtual void				StateChanged( sal_uInt16 nSID,
113*cdf0e10cSrcweir 											  SfxItemState eState,
114*cdf0e10cSrcweir 											  const SfxPoolItem* pState );
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir 	DECL_LINK(PopupHdl, PopupMenu*);
117*cdf0e10cSrcweir };
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir //----------------------------------------------------------------------------
121*cdf0e10cSrcweir //
122*cdf0e10cSrcweir //----------------------------------------------------------------------------
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir class SwScrollNaviToolBox : public ToolBox
125*cdf0e10cSrcweir {
126*cdf0e10cSrcweir 	virtual void	MouseButtonUp( const MouseEvent& rMEvt );
127*cdf0e10cSrcweir 	virtual void	RequestHelp( const HelpEvent& rHEvt );
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir 	public:
130*cdf0e10cSrcweir         SwScrollNaviToolBox(Window* pParent, WinBits nWinStyle ) :
131*cdf0e10cSrcweir             ToolBox(pParent, nWinStyle ) {}
132*cdf0e10cSrcweir };
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir class SwScrollNaviPopup : public SfxPopupWindow
135*cdf0e10cSrcweir {
136*cdf0e10cSrcweir     SwScrollNaviToolBox    aToolBox;
137*cdf0e10cSrcweir     FixedLine       aSeparator;
138*cdf0e10cSrcweir     FixedInfo       aInfoField;
139*cdf0e10cSrcweir 	ImageList		aIList;
140*cdf0e10cSrcweir     ImageList       aIListH;
141*cdf0e10cSrcweir 
142*cdf0e10cSrcweir 	String			sQuickHelp[2 * NID_COUNT];
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir 	sal_uInt16			nFwdId;
145*cdf0e10cSrcweir 	sal_uInt16			nBackId;
146*cdf0e10cSrcweir 
147*cdf0e10cSrcweir     void            ApplyImageList();
148*cdf0e10cSrcweir 
149*cdf0e10cSrcweir     using Window::GetQuickHelpText;
150*cdf0e10cSrcweir 
151*cdf0e10cSrcweir protected:
152*cdf0e10cSrcweir         DECL_LINK(SelectHdl, ToolBox*);
153*cdf0e10cSrcweir         virtual void        DataChanged( const DataChangedEvent& rDCEvt );
154*cdf0e10cSrcweir 
155*cdf0e10cSrcweir public:
156*cdf0e10cSrcweir         SwScrollNaviPopup( sal_uInt16 nId, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
157*cdf0e10cSrcweir 		~SwScrollNaviPopup();
158*cdf0e10cSrcweir 
159*cdf0e10cSrcweir 	static String			GetQuickHelpText(sal_Bool bNext);
160*cdf0e10cSrcweir 
161*cdf0e10cSrcweir 	virtual SfxPopupWindow* Clone() const;
162*cdf0e10cSrcweir     void                GrabFocus(){aToolBox.GrabFocus();}
163*cdf0e10cSrcweir };
164*cdf0e10cSrcweir 
165*cdf0e10cSrcweir //----------------------------------------------------------------------------
166*cdf0e10cSrcweir //
167*cdf0e10cSrcweir //----------------------------------------------------------------------------
168*cdf0e10cSrcweir 
169*cdf0e10cSrcweir class SwNaviImageButton : public ImageButton
170*cdf0e10cSrcweir {
171*cdf0e10cSrcweir 		SwScrollNaviPopup* 	pPopup;
172*cdf0e10cSrcweir 		Image				aImage;
173*cdf0e10cSrcweir         Image               aImageH;
174*cdf0e10cSrcweir         String              sQuickText;
175*cdf0e10cSrcweir         SfxPopupWindow*     pPopupWindow;
176*cdf0e10cSrcweir         SfxPopupWindow*     pFloatingWindow;
177*cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir 	protected:
180*cdf0e10cSrcweir 	    DECL_LINK( PopupModeEndHdl, void * );
181*cdf0e10cSrcweir 	    DECL_LINK( ClosePopupWindow, SfxPopupWindow * );
182*cdf0e10cSrcweir 
183*cdf0e10cSrcweir         virtual void    Click();
184*cdf0e10cSrcweir         virtual void    DataChanged( const DataChangedEvent& rDCEvt );
185*cdf0e10cSrcweir         void            SetPopupWindow( SfxPopupWindow* pWindow );
186*cdf0e10cSrcweir 
187*cdf0e10cSrcweir     public:
188*cdf0e10cSrcweir 		SwNaviImageButton(Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
189*cdf0e10cSrcweir };
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir //----------------------------------------------------------------------------
192*cdf0e10cSrcweir //	Die ImageButtons muessen sich bei Bedarf den HelpText selbst setzen
193*cdf0e10cSrcweir //----------------------------------------------------------------------------
194*cdf0e10cSrcweir 
195*cdf0e10cSrcweir class SwHlpImageButton : public ImageButton
196*cdf0e10cSrcweir {
197*cdf0e10cSrcweir 	sal_Bool		bUp;
198*cdf0e10cSrcweir 	public:
199*cdf0e10cSrcweir 		SwHlpImageButton(Window* pParent, const ResId& rResId, sal_Bool bUpBtn) :
200*cdf0e10cSrcweir 			ImageButton(pParent, rResId), bUp(bUpBtn){}
201*cdf0e10cSrcweir 
202*cdf0e10cSrcweir 	virtual void	RequestHelp( const HelpEvent& rHEvt );
203*cdf0e10cSrcweir 
204*cdf0e10cSrcweir };
205*cdf0e10cSrcweir /* -----------------26.11.2002 09:25-----------------
206*cdf0e10cSrcweir  *
207*cdf0e10cSrcweir  * --------------------------------------------------*/
208*cdf0e10cSrcweir class SwPreviewZoomControl : public SfxToolBoxControl
209*cdf0e10cSrcweir {
210*cdf0e10cSrcweir public:
211*cdf0e10cSrcweir     SFX_DECL_TOOLBOX_CONTROL();
212*cdf0e10cSrcweir 
213*cdf0e10cSrcweir     SwPreviewZoomControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
214*cdf0e10cSrcweir     ~SwPreviewZoomControl();
215*cdf0e10cSrcweir 
216*cdf0e10cSrcweir     virtual void            StateChanged( sal_uInt16 nSID,
217*cdf0e10cSrcweir                                               SfxItemState eState,
218*cdf0e10cSrcweir                                               const SfxPoolItem* pState );
219*cdf0e10cSrcweir 
220*cdf0e10cSrcweir     virtual Window*         CreateItemWindow( Window *pParent );
221*cdf0e10cSrcweir };
222*cdf0e10cSrcweir #endif
223*cdf0e10cSrcweir 
224*cdf0e10cSrcweir 
225*cdf0e10cSrcweir 
226