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