bump product version to 4.1.6.2
[LibreOffice.git] / sw / source / ui / inc / workctrl.hxx
blob1c7b231717fa53c39983da18ffb8314c109f0c37
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _WORKCTRL_HXX
20 #define _WORKCTRL_HXX
22 #include <sfx2/tbxctrl.hxx>
23 #include <vcl/toolbox.hxx>
24 #include <svtools/stdctrl.hxx>
25 #include <vcl/button.hxx>
27 class PopupMenu;
28 class SwView;
30 // double entry! hrc and hxx
31 // these Ids say what the buttons below the scrollbar are doing
32 #define NID_START 20000
33 #define NID_NEXT 20000
34 #define NID_PREV 20001
35 #define NID_TBL 20002
36 #define NID_FRM 20003
37 #define NID_PGE 20004
38 #define NID_DRW 20005
39 #define NID_CTRL 20006
40 #define NID_REG 20007
41 #define NID_BKM 20008
42 #define NID_GRF 20009
43 #define NID_OLE 20010
44 #define NID_OUTL 20011
45 #define NID_SEL 20012
46 #define NID_FTN 20013
47 #define NID_MARK 20014
48 #define NID_POSTIT 20015
49 #define NID_SRCH_REP 20016
50 #define NID_INDEX_ENTRY 20017
51 #define NID_TABLE_FORMULA 20018
52 #define NID_TABLE_FORMULA_ERROR 20019
53 #define NID_COUNT 20
57 //----------------------------------------------------------------------------
59 //----------------------------------------------------------------------------
61 class SwTbxInsertCtrl : public SfxToolBoxControl
63 sal_uInt16 nLastSlotId;
65 using SfxToolBoxControl::Select;
66 virtual void Select( sal_Bool bMod1 = sal_False );
68 public:
69 SFX_DECL_TOOLBOX_CONTROL();
71 SwTbxInsertCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
72 ~SwTbxInsertCtrl();
74 virtual SfxPopupWindowType GetPopupWindowType() const;
75 virtual SfxPopupWindow* CreatePopupWindow();
76 virtual void StateChanged( sal_uInt16 nSID,
77 SfxItemState eState,
78 const SfxPoolItem* pState );
80 virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException);
83 //----------------------------------------------------------------------------
85 //----------------------------------------------------------------------------
87 class SwTbxAutoTextCtrl : public SfxToolBoxControl
89 PopupMenu* pPopup;
90 SwView* pView;
93 void DelPopup();
94 public:
95 SFX_DECL_TOOLBOX_CONTROL();
97 SwTbxAutoTextCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
98 virtual ~SwTbxAutoTextCtrl();
100 virtual SfxPopupWindowType GetPopupWindowType() const;
101 virtual SfxPopupWindow* CreatePopupWindow();
102 virtual void StateChanged( sal_uInt16 nSID,
103 SfxItemState eState,
104 const SfxPoolItem* pState );
106 DECL_LINK(PopupHdl, PopupMenu*);
109 class SwTbxFieldCtrl : public SfxToolBoxControl
111 PopupMenu* pPopup;
112 SwView* pView;
115 void DelPopup();
116 public:
117 SFX_DECL_TOOLBOX_CONTROL();
119 SwTbxFieldCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
120 virtual ~SwTbxFieldCtrl();
122 virtual SfxPopupWindowType GetPopupWindowType() const;
123 virtual SfxPopupWindow* CreatePopupWindow();
124 virtual void StateChanged( sal_uInt16 nSID,
125 SfxItemState eState,
126 const SfxPoolItem* pState );
128 DECL_LINK(PopupHdl, PopupMenu*);
133 //----------------------------------------------------------------------------
135 //----------------------------------------------------------------------------
137 class SwScrollNaviToolBox : public ToolBox
139 virtual void MouseButtonUp( const MouseEvent& rMEvt );
140 virtual void RequestHelp( const HelpEvent& rHEvt );
142 public:
143 SwScrollNaviToolBox(Window* pParent, WinBits nWinStyle ) :
144 ToolBox(pParent, nWinStyle ) {}
147 class SwScrollNaviPopup : public SfxPopupWindow
149 SwScrollNaviToolBox aToolBox;
150 FixedLine aSeparator;
151 FixedInfo aInfoField;
152 ImageList aIList;
154 String sQuickHelp[2 * NID_COUNT];
156 void ApplyImageList();
158 using Window::GetQuickHelpText;
160 protected:
161 DECL_LINK(SelectHdl, ToolBox*);
162 virtual void DataChanged( const DataChangedEvent& rDCEvt );
164 public:
165 SwScrollNaviPopup( sal_uInt16 nId, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
166 ~SwScrollNaviPopup();
168 static String GetQuickHelpText(sal_Bool bNext);
170 virtual SfxPopupWindow* Clone() const;
171 void GrabFocus(){aToolBox.GrabFocus();}
174 //----------------------------------------------------------------------------
176 //----------------------------------------------------------------------------
178 class SwNaviImageButton : public ImageButton
180 SwScrollNaviPopup* pPopup;
181 Image aImage;
182 String sQuickText;
183 SfxPopupWindow* pPopupWindow;
184 SfxPopupWindow* pFloatingWindow;
185 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
187 protected:
188 DECL_LINK( PopupModeEndHdl, void * );
189 DECL_LINK( ClosePopupWindow, SfxPopupWindow * );
191 virtual void Click();
192 virtual void DataChanged( const DataChangedEvent& rDCEvt );
193 void SetPopupWindow( SfxPopupWindow* pWindow );
195 public:
196 SwNaviImageButton(Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
199 //----------------------------------------------------------------------------
200 // ImageButtons have to set the HelpText themselves if needed
201 //----------------------------------------------------------------------------
203 class SwHlpImageButton : public ImageButton
205 sal_Bool bUp;
206 public:
207 SwHlpImageButton(Window* pParent, const ResId& rResId, sal_Bool bUpBtn) :
208 ImageButton(pParent, rResId), bUp(bUpBtn){}
210 virtual void RequestHelp( const HelpEvent& rHEvt );
214 class SwPreviewZoomControl : public SfxToolBoxControl
216 public:
217 SFX_DECL_TOOLBOX_CONTROL();
219 SwPreviewZoomControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
220 ~SwPreviewZoomControl();
222 virtual void StateChanged( sal_uInt16 nSID,
223 SfxItemState eState,
224 const SfxPoolItem* pState );
226 virtual Window* CreateItemWindow( Window *pParent );
228 #endif
232 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */