1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: workctrl.hxx,v $
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 ************************************************************************/
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>
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
52 #define NID_CTRL 20006
57 #define NID_OUTL 20011
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
70 //----------------------------------------------------------------------------
72 //----------------------------------------------------------------------------
74 class SwTbxInsertCtrl
: public SfxToolBoxControl
78 using SfxToolBoxControl::Select
;
79 virtual void Select( BOOL bMod1
= FALSE
);
82 SFX_DECL_TOOLBOX_CONTROL();
84 SwTbxInsertCtrl( USHORT nSlotId
, USHORT nId
, ToolBox
& rTbx
);
87 virtual SfxPopupWindowType
GetPopupWindowType() const;
88 virtual SfxPopupWindow
* CreatePopupWindow();
89 virtual void StateChanged( USHORT nSID
,
91 const SfxPoolItem
* pState
);
93 virtual void SAL_CALL
update() throw (::com::sun::star::uno::RuntimeException
);
96 //----------------------------------------------------------------------------
98 //----------------------------------------------------------------------------
100 class SwTbxAutoTextCtrl
: public SfxToolBoxControl
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
,
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
);
133 SwScrollNaviToolBox(Window
* pParent
, WinBits nWinStyle
) :
134 ToolBox(pParent
, nWinStyle
) {}
137 class SwScrollNaviPopup
: public SfxPopupWindow
139 SwScrollNaviToolBox aToolBox
;
140 FixedLine aSeparator
;
141 FixedInfo aInfoField
;
145 String sQuickHelp
[2 * NID_COUNT
];
150 void ApplyImageList();
152 using Window::GetQuickHelpText
;
155 DECL_LINK(SelectHdl
, ToolBox
*);
156 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
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
;
178 SfxPopupWindow
* pPopupWindow
;
179 SfxPopupWindow
* pFloatingWindow
;
180 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
> m_xFrame
;
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
);
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
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
214 SFX_DECL_TOOLBOX_CONTROL();
216 SwPreviewZoomControl( USHORT nSlotId
, USHORT nId
, ToolBox
& rTbx
);
217 ~SwPreviewZoomControl();
219 virtual void StateChanged( USHORT nSID
,
221 const SfxPoolItem
* pState
);
223 virtual Window
* CreateItemWindow( Window
*pParent
);