xref: /AOO41X/main/sw/source/ui/inc/workctrl.hxx (revision 1d2dbeb0b7301723c6d13094e87a8714ef81a328)
1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1d2dbeb0SAndrew Rist  * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*1d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef _WORKCTRL_HXX
24cdf0e10cSrcweir #define _WORKCTRL_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <sfx2/tbxctrl.hxx>
27cdf0e10cSrcweir #include <vcl/toolbox.hxx>
28cdf0e10cSrcweir #include <svtools/stdctrl.hxx>
29cdf0e10cSrcweir #ifndef _IMAGEBTN_HXX //autogen
30cdf0e10cSrcweir #include <vcl/button.hxx>
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir 
33cdf0e10cSrcweir class PopupMenu;
34cdf0e10cSrcweir class SwView;
35cdf0e10cSrcweir 
36cdf0e10cSrcweir // doppelter Eintrag! hrc und hxx
37cdf0e10cSrcweir // diese Ids bestimmen, was die Buttons unter dem Scrollbar tun
38cdf0e10cSrcweir #define NID_START   20000
39cdf0e10cSrcweir #define NID_NEXT 	20000
40cdf0e10cSrcweir #define NID_PREV	20001
41cdf0e10cSrcweir #define NID_TBL     20002
42cdf0e10cSrcweir #define NID_FRM     20003
43cdf0e10cSrcweir #define NID_PGE     20004
44cdf0e10cSrcweir #define NID_DRW     20005
45cdf0e10cSrcweir #define NID_CTRL    20006
46cdf0e10cSrcweir #define NID_REG     20007
47cdf0e10cSrcweir #define NID_BKM     20008
48cdf0e10cSrcweir #define NID_GRF    	20009
49cdf0e10cSrcweir #define NID_OLE    	20010
50cdf0e10cSrcweir #define NID_OUTL   	20011
51cdf0e10cSrcweir #define NID_SEL    	20012
52cdf0e10cSrcweir #define NID_FTN   	20013
53cdf0e10cSrcweir #define NID_MARK	20014
54cdf0e10cSrcweir #define NID_POSTIT  20015
55cdf0e10cSrcweir #define NID_SRCH_REP 20016
56cdf0e10cSrcweir #define NID_INDEX_ENTRY  20017
57cdf0e10cSrcweir #define NID_TABLE_FORMULA	20018
58cdf0e10cSrcweir #define NID_TABLE_FORMULA_ERROR		20019
59cdf0e10cSrcweir #define NID_COUNT  20
60cdf0e10cSrcweir 
61cdf0e10cSrcweir 
62cdf0e10cSrcweir 
63cdf0e10cSrcweir //----------------------------------------------------------------------------
64cdf0e10cSrcweir //
65cdf0e10cSrcweir //----------------------------------------------------------------------------
66cdf0e10cSrcweir 
67cdf0e10cSrcweir class SwTbxInsertCtrl : public SfxToolBoxControl
68cdf0e10cSrcweir {
69cdf0e10cSrcweir 	sal_uInt16 					nLastSlotId;
70cdf0e10cSrcweir 
71cdf0e10cSrcweir     using SfxToolBoxControl::Select;
72cdf0e10cSrcweir 	virtual void			Select( sal_Bool bMod1 = sal_False );
73cdf0e10cSrcweir 
74cdf0e10cSrcweir public:
75cdf0e10cSrcweir 	SFX_DECL_TOOLBOX_CONTROL();
76cdf0e10cSrcweir 
77cdf0e10cSrcweir 	SwTbxInsertCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
78cdf0e10cSrcweir 	~SwTbxInsertCtrl();
79cdf0e10cSrcweir 
80cdf0e10cSrcweir 	virtual SfxPopupWindowType	GetPopupWindowType() const;
81cdf0e10cSrcweir 	virtual SfxPopupWindow* 	CreatePopupWindow();
82cdf0e10cSrcweir 	virtual void				StateChanged( sal_uInt16 nSID,
83cdf0e10cSrcweir 											  SfxItemState eState,
84cdf0e10cSrcweir 											  const SfxPoolItem* pState );
85cdf0e10cSrcweir 
86cdf0e10cSrcweir     virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException);
87cdf0e10cSrcweir };
88cdf0e10cSrcweir 
89cdf0e10cSrcweir //----------------------------------------------------------------------------
90cdf0e10cSrcweir //
91cdf0e10cSrcweir //----------------------------------------------------------------------------
92cdf0e10cSrcweir 
93cdf0e10cSrcweir class SwTbxAutoTextCtrl : public SfxToolBoxControl
94cdf0e10cSrcweir {
95cdf0e10cSrcweir 	PopupMenu*				pPopup;
96cdf0e10cSrcweir 	SwView* 				pView;
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 
99cdf0e10cSrcweir 	void					DelPopup();
100cdf0e10cSrcweir public:
101cdf0e10cSrcweir 	SFX_DECL_TOOLBOX_CONTROL();
102cdf0e10cSrcweir 
103cdf0e10cSrcweir 	SwTbxAutoTextCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
104cdf0e10cSrcweir 	~SwTbxAutoTextCtrl();
105cdf0e10cSrcweir 
106cdf0e10cSrcweir 	virtual SfxPopupWindowType	GetPopupWindowType() const;
107cdf0e10cSrcweir 	virtual SfxPopupWindow* 	CreatePopupWindow();
108cdf0e10cSrcweir 	virtual void				StateChanged( sal_uInt16 nSID,
109cdf0e10cSrcweir 											  SfxItemState eState,
110cdf0e10cSrcweir 											  const SfxPoolItem* pState );
111cdf0e10cSrcweir 
112cdf0e10cSrcweir 	DECL_LINK(PopupHdl, PopupMenu*);
113cdf0e10cSrcweir };
114cdf0e10cSrcweir 
115cdf0e10cSrcweir 
116cdf0e10cSrcweir //----------------------------------------------------------------------------
117cdf0e10cSrcweir //
118cdf0e10cSrcweir //----------------------------------------------------------------------------
119cdf0e10cSrcweir 
120cdf0e10cSrcweir class SwScrollNaviToolBox : public ToolBox
121cdf0e10cSrcweir {
122cdf0e10cSrcweir 	virtual void	MouseButtonUp( const MouseEvent& rMEvt );
123cdf0e10cSrcweir 	virtual void	RequestHelp( const HelpEvent& rHEvt );
124cdf0e10cSrcweir 
125cdf0e10cSrcweir 	public:
SwScrollNaviToolBox(Window * pParent,WinBits nWinStyle)126cdf0e10cSrcweir         SwScrollNaviToolBox(Window* pParent, WinBits nWinStyle ) :
127cdf0e10cSrcweir             ToolBox(pParent, nWinStyle ) {}
128cdf0e10cSrcweir };
129cdf0e10cSrcweir 
130cdf0e10cSrcweir class SwScrollNaviPopup : public SfxPopupWindow
131cdf0e10cSrcweir {
132cdf0e10cSrcweir     SwScrollNaviToolBox    aToolBox;
133cdf0e10cSrcweir     FixedLine       aSeparator;
134cdf0e10cSrcweir     FixedInfo       aInfoField;
135cdf0e10cSrcweir 	ImageList		aIList;
136cdf0e10cSrcweir     ImageList       aIListH;
137cdf0e10cSrcweir 
138cdf0e10cSrcweir 	String			sQuickHelp[2 * NID_COUNT];
139cdf0e10cSrcweir 
140cdf0e10cSrcweir 	sal_uInt16			nFwdId;
141cdf0e10cSrcweir 	sal_uInt16			nBackId;
142cdf0e10cSrcweir 
143cdf0e10cSrcweir     void            ApplyImageList();
144cdf0e10cSrcweir 
145cdf0e10cSrcweir     using Window::GetQuickHelpText;
146cdf0e10cSrcweir 
147cdf0e10cSrcweir protected:
148cdf0e10cSrcweir         DECL_LINK(SelectHdl, ToolBox*);
149cdf0e10cSrcweir         virtual void        DataChanged( const DataChangedEvent& rDCEvt );
150cdf0e10cSrcweir 
151cdf0e10cSrcweir public:
152cdf0e10cSrcweir         SwScrollNaviPopup( sal_uInt16 nId, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
153cdf0e10cSrcweir 		~SwScrollNaviPopup();
154cdf0e10cSrcweir 
155cdf0e10cSrcweir 	static String			GetQuickHelpText(sal_Bool bNext);
156cdf0e10cSrcweir 
157cdf0e10cSrcweir 	virtual SfxPopupWindow* Clone() const;
GrabFocus()158cdf0e10cSrcweir     void                GrabFocus(){aToolBox.GrabFocus();}
159cdf0e10cSrcweir };
160cdf0e10cSrcweir 
161cdf0e10cSrcweir //----------------------------------------------------------------------------
162cdf0e10cSrcweir //
163cdf0e10cSrcweir //----------------------------------------------------------------------------
164cdf0e10cSrcweir 
165cdf0e10cSrcweir class SwNaviImageButton : public ImageButton
166cdf0e10cSrcweir {
167cdf0e10cSrcweir 		SwScrollNaviPopup* 	pPopup;
168cdf0e10cSrcweir 		Image				aImage;
169cdf0e10cSrcweir         Image               aImageH;
170cdf0e10cSrcweir         String              sQuickText;
171cdf0e10cSrcweir         SfxPopupWindow*     pPopupWindow;
172cdf0e10cSrcweir         SfxPopupWindow*     pFloatingWindow;
173cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
174cdf0e10cSrcweir 
175cdf0e10cSrcweir 	protected:
176cdf0e10cSrcweir 	    DECL_LINK( PopupModeEndHdl, void * );
177cdf0e10cSrcweir 	    DECL_LINK( ClosePopupWindow, SfxPopupWindow * );
178cdf0e10cSrcweir 
179cdf0e10cSrcweir         virtual void    Click();
180cdf0e10cSrcweir         virtual void    DataChanged( const DataChangedEvent& rDCEvt );
181cdf0e10cSrcweir         void            SetPopupWindow( SfxPopupWindow* pWindow );
182cdf0e10cSrcweir 
183cdf0e10cSrcweir     public:
184cdf0e10cSrcweir 		SwNaviImageButton(Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
185cdf0e10cSrcweir };
186cdf0e10cSrcweir 
187cdf0e10cSrcweir //----------------------------------------------------------------------------
188cdf0e10cSrcweir //	Die ImageButtons muessen sich bei Bedarf den HelpText selbst setzen
189cdf0e10cSrcweir //----------------------------------------------------------------------------
190cdf0e10cSrcweir 
191cdf0e10cSrcweir class SwHlpImageButton : public ImageButton
192cdf0e10cSrcweir {
193cdf0e10cSrcweir 	sal_Bool		bUp;
194cdf0e10cSrcweir 	public:
SwHlpImageButton(Window * pParent,const ResId & rResId,sal_Bool bUpBtn)195cdf0e10cSrcweir 		SwHlpImageButton(Window* pParent, const ResId& rResId, sal_Bool bUpBtn) :
196cdf0e10cSrcweir 			ImageButton(pParent, rResId), bUp(bUpBtn){}
197cdf0e10cSrcweir 
198cdf0e10cSrcweir 	virtual void	RequestHelp( const HelpEvent& rHEvt );
199cdf0e10cSrcweir 
200cdf0e10cSrcweir };
201cdf0e10cSrcweir /* -----------------26.11.2002 09:25-----------------
202cdf0e10cSrcweir  *
203cdf0e10cSrcweir  * --------------------------------------------------*/
204cdf0e10cSrcweir class SwPreviewZoomControl : public SfxToolBoxControl
205cdf0e10cSrcweir {
206cdf0e10cSrcweir public:
207cdf0e10cSrcweir     SFX_DECL_TOOLBOX_CONTROL();
208cdf0e10cSrcweir 
209cdf0e10cSrcweir     SwPreviewZoomControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
210cdf0e10cSrcweir     ~SwPreviewZoomControl();
211cdf0e10cSrcweir 
212cdf0e10cSrcweir     virtual void            StateChanged( sal_uInt16 nSID,
213cdf0e10cSrcweir                                               SfxItemState eState,
214cdf0e10cSrcweir                                               const SfxPoolItem* pState );
215cdf0e10cSrcweir 
216cdf0e10cSrcweir     virtual Window*         CreateItemWindow( Window *pParent );
217cdf0e10cSrcweir };
218cdf0e10cSrcweir #endif
219cdf0e10cSrcweir 
220cdf0e10cSrcweir 
221cdf0e10cSrcweir 
222