Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef _WORKCTRL_HXX
20 : #define _WORKCTRL_HXX
21 :
22 : #include <sfx2/tbxctrl.hxx>
23 : #include <vcl/toolbox.hxx>
24 : #include <svtools/stdctrl.hxx>
25 : #include <vcl/button.hxx>
26 :
27 : class PopupMenu;
28 : class SwView;
29 :
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
54 :
55 :
56 :
57 : //----------------------------------------------------------------------------
58 : //
59 : //----------------------------------------------------------------------------
60 :
61 : class SwTbxInsertCtrl : public SfxToolBoxControl
62 : {
63 : sal_uInt16 nLastSlotId;
64 :
65 : using SfxToolBoxControl::Select;
66 : virtual void Select( sal_Bool bMod1 = sal_False );
67 :
68 : public:
69 : SFX_DECL_TOOLBOX_CONTROL();
70 :
71 : SwTbxInsertCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
72 : ~SwTbxInsertCtrl();
73 :
74 : virtual SfxPopupWindowType GetPopupWindowType() const;
75 : virtual SfxPopupWindow* CreatePopupWindow();
76 : virtual void StateChanged( sal_uInt16 nSID,
77 : SfxItemState eState,
78 : const SfxPoolItem* pState );
79 :
80 : virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException);
81 : };
82 :
83 : //----------------------------------------------------------------------------
84 : //
85 : //----------------------------------------------------------------------------
86 :
87 : class SwTbxAutoTextCtrl : public SfxToolBoxControl
88 : {
89 : PopupMenu* pPopup;
90 : SwView* pView;
91 :
92 :
93 : void DelPopup();
94 : public:
95 : SFX_DECL_TOOLBOX_CONTROL();
96 :
97 : SwTbxAutoTextCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
98 : ~SwTbxAutoTextCtrl();
99 :
100 : virtual SfxPopupWindowType GetPopupWindowType() const;
101 : virtual SfxPopupWindow* CreatePopupWindow();
102 : virtual void StateChanged( sal_uInt16 nSID,
103 : SfxItemState eState,
104 : const SfxPoolItem* pState );
105 :
106 : DECL_LINK(PopupHdl, PopupMenu*);
107 : };
108 :
109 :
110 : //----------------------------------------------------------------------------
111 : //
112 : //----------------------------------------------------------------------------
113 :
114 0 : class SwScrollNaviToolBox : public ToolBox
115 : {
116 : virtual void MouseButtonUp( const MouseEvent& rMEvt );
117 : virtual void RequestHelp( const HelpEvent& rHEvt );
118 :
119 : public:
120 0 : SwScrollNaviToolBox(Window* pParent, WinBits nWinStyle ) :
121 0 : ToolBox(pParent, nWinStyle ) {}
122 : };
123 :
124 : class SwScrollNaviPopup : public SfxPopupWindow
125 : {
126 : SwScrollNaviToolBox aToolBox;
127 : FixedLine aSeparator;
128 : FixedInfo aInfoField;
129 : ImageList aIList;
130 :
131 : String sQuickHelp[2 * NID_COUNT];
132 :
133 : void ApplyImageList();
134 :
135 : using Window::GetQuickHelpText;
136 :
137 : protected:
138 : DECL_LINK(SelectHdl, ToolBox*);
139 : virtual void DataChanged( const DataChangedEvent& rDCEvt );
140 :
141 : public:
142 : SwScrollNaviPopup( sal_uInt16 nId, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
143 : ~SwScrollNaviPopup();
144 :
145 : static String GetQuickHelpText(sal_Bool bNext);
146 :
147 : virtual SfxPopupWindow* Clone() const;
148 0 : void GrabFocus(){aToolBox.GrabFocus();}
149 : };
150 :
151 : //----------------------------------------------------------------------------
152 : //
153 : //----------------------------------------------------------------------------
154 :
155 126 : class SwNaviImageButton : public ImageButton
156 : {
157 : SwScrollNaviPopup* pPopup;
158 : Image aImage;
159 : String sQuickText;
160 : SfxPopupWindow* pPopupWindow;
161 : SfxPopupWindow* pFloatingWindow;
162 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
163 :
164 : protected:
165 : DECL_LINK( PopupModeEndHdl, void * );
166 : DECL_LINK( ClosePopupWindow, SfxPopupWindow * );
167 :
168 : virtual void Click();
169 : virtual void DataChanged( const DataChangedEvent& rDCEvt );
170 : void SetPopupWindow( SfxPopupWindow* pWindow );
171 :
172 : public:
173 : SwNaviImageButton(Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
174 : };
175 :
176 : //----------------------------------------------------------------------------
177 : // ImageButtons have to set the HelpText themselves if needed
178 : //----------------------------------------------------------------------------
179 :
180 252 : class SwHlpImageButton : public ImageButton
181 : {
182 : sal_Bool bUp;
183 : public:
184 472 : SwHlpImageButton(Window* pParent, const ResId& rResId, sal_Bool bUpBtn) :
185 472 : ImageButton(pParent, rResId), bUp(bUpBtn){}
186 :
187 : virtual void RequestHelp( const HelpEvent& rHEvt );
188 :
189 : };
190 :
191 : class SwPreviewZoomControl : public SfxToolBoxControl
192 : {
193 : public:
194 : SFX_DECL_TOOLBOX_CONTROL();
195 :
196 : SwPreviewZoomControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
197 : ~SwPreviewZoomControl();
198 :
199 : virtual void StateChanged( sal_uInt16 nSID,
200 : SfxItemState eState,
201 : const SfxPoolItem* pState );
202 :
203 : virtual Window* CreateItemWindow( Window *pParent );
204 : };
205 : #endif
206 :
207 :
208 :
209 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|