update dev300-m58
[ooovba.git] / sw / source / ui / inc / workctrl.hxx
blob18e59ee9195d7ec6307e896d24091ee35560e33c
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: workctrl.hxx,v $
10 * $Revision: 1.12 $
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 ************************************************************************/
30 #ifndef _WORKCTRL_HXX
31 #define _WORKCTRL_HXX
33 #include <sfx2/tbxctrl.hxx>
34 #include <vcl/toolbox.hxx>
35 #include <svtools/stdctrl.hxx>
36 #ifndef _IMAGEBTN_HXX //autogen
37 #include <vcl/imagebtn.hxx>
38 #endif
40 class PopupMenu;
41 class SwView;
43 // doppelter Eintrag! hrc und hxx
44 // diese Ids bestimmen, was die Buttons unter dem Scrollbar tun
45 #define NID_START 20000
46 #define NID_NEXT 20000
47 #define NID_PREV 20001
48 #define NID_TBL 20002
49 #define NID_FRM 20003
50 #define NID_PGE 20004
51 #define NID_DRW 20005
52 #define NID_CTRL 20006
53 #define NID_REG 20007
54 #define NID_BKM 20008
55 #define NID_GRF 20009
56 #define NID_OLE 20010
57 #define NID_OUTL 20011
58 #define NID_SEL 20012
59 #define NID_FTN 20013
60 #define NID_MARK 20014
61 #define NID_POSTIT 20015
62 #define NID_SRCH_REP 20016
63 #define NID_INDEX_ENTRY 20017
64 #define NID_TABLE_FORMULA 20018
65 #define NID_TABLE_FORMULA_ERROR 20019
66 #define NID_COUNT 20
70 //----------------------------------------------------------------------------
72 //----------------------------------------------------------------------------
74 class SwTbxInsertCtrl : public SfxToolBoxControl
76 USHORT nLastSlotId;
78 using SfxToolBoxControl::Select;
79 virtual void Select( BOOL bMod1 = FALSE );
81 public:
82 SFX_DECL_TOOLBOX_CONTROL();
84 SwTbxInsertCtrl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
85 ~SwTbxInsertCtrl();
87 virtual SfxPopupWindowType GetPopupWindowType() const;
88 virtual SfxPopupWindow* CreatePopupWindow();
89 virtual void StateChanged( USHORT nSID,
90 SfxItemState eState,
91 const SfxPoolItem* pState );
93 virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException);
96 //----------------------------------------------------------------------------
98 //----------------------------------------------------------------------------
100 class SwTbxAutoTextCtrl : public SfxToolBoxControl
102 PopupMenu* pPopup;
103 SwView* pView;
106 void DelPopup();
107 public:
108 SFX_DECL_TOOLBOX_CONTROL();
110 SwTbxAutoTextCtrl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
111 ~SwTbxAutoTextCtrl();
113 virtual SfxPopupWindowType GetPopupWindowType() const;
114 virtual SfxPopupWindow* CreatePopupWindow();
115 virtual void StateChanged( USHORT nSID,
116 SfxItemState eState,
117 const SfxPoolItem* pState );
119 DECL_LINK(PopupHdl, PopupMenu*);
123 //----------------------------------------------------------------------------
125 //----------------------------------------------------------------------------
127 class SwScrollNaviToolBox : public ToolBox
129 virtual void MouseButtonUp( const MouseEvent& rMEvt );
130 virtual void RequestHelp( const HelpEvent& rHEvt );
132 public:
133 SwScrollNaviToolBox(Window* pParent, WinBits nWinStyle ) :
134 ToolBox(pParent, nWinStyle ) {}
137 class SwScrollNaviPopup : public SfxPopupWindow
139 SwScrollNaviToolBox aToolBox;
140 FixedLine aSeparator;
141 FixedInfo aInfoField;
142 ImageList aIList;
143 ImageList aIListH;
145 String sQuickHelp[2 * NID_COUNT];
147 USHORT nFwdId;
148 USHORT nBackId;
150 void ApplyImageList();
152 using Window::GetQuickHelpText;
154 protected:
155 DECL_LINK(SelectHdl, ToolBox*);
156 virtual void DataChanged( const DataChangedEvent& rDCEvt );
158 public:
159 SwScrollNaviPopup( USHORT nId, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
160 ~SwScrollNaviPopup();
162 static String GetQuickHelpText(BOOL bNext);
164 virtual SfxPopupWindow* Clone() const;
165 void GrabFocus(){aToolBox.GrabFocus();}
168 //----------------------------------------------------------------------------
170 //----------------------------------------------------------------------------
172 class SwNaviImageButton : public ImageButton
174 SwScrollNaviPopup* pPopup;
175 Image aImage;
176 Image aImageH;
177 String sQuickText;
178 SfxPopupWindow* pPopupWindow;
179 SfxPopupWindow* pFloatingWindow;
180 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
182 protected:
183 DECL_LINK( PopupModeEndHdl, void * );
184 DECL_LINK( ClosePopupWindow, SfxPopupWindow * );
186 virtual void Click();
187 virtual void DataChanged( const DataChangedEvent& rDCEvt );
188 void SetPopupWindow( SfxPopupWindow* pWindow );
190 public:
191 SwNaviImageButton(Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
194 //----------------------------------------------------------------------------
195 // Die ImageButtons muessen sich bei Bedarf den HelpText selbst setzen
196 //----------------------------------------------------------------------------
198 class SwHlpImageButton : public ImageButton
200 BOOL bUp;
201 public:
202 SwHlpImageButton(Window* pParent, const ResId& rResId, BOOL bUpBtn) :
203 ImageButton(pParent, rResId), bUp(bUpBtn){}
205 virtual void RequestHelp( const HelpEvent& rHEvt );
208 /* -----------------26.11.2002 09:25-----------------
210 * --------------------------------------------------*/
211 class SwPreviewZoomControl : public SfxToolBoxControl
213 public:
214 SFX_DECL_TOOLBOX_CONTROL();
216 SwPreviewZoomControl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
217 ~SwPreviewZoomControl();
219 virtual void StateChanged( USHORT nSID,
220 SfxItemState eState,
221 const SfxPoolItem* pState );
223 virtual Window* CreateItemWindow( Window *pParent );
225 #endif