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