merge the formfield patch from ooo-build
[ooovba.git] / svx / inc / extrusioncontrols.hxx
blobb2d03ec39745ecae4242c01eb210f666d7104b24
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: extrusioncontrols.hxx,v $
10 * $Revision: 1.10 $
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 ************************************************************************/
30 #ifndef _SVX_EXTRUSION_CONTROLS_HXX
31 #define _SVX_EXTRUSION_CONTROLS_HXX
33 #include <svtools/valueset.hxx>
34 #include <svtools/lstner.hxx>
35 #include <sfx2/tbxctrl.hxx>
36 #include <svtools/svtreebx.hxx>
37 #ifndef _SV_BUTTON_HXX
38 #include <vcl/button.hxx>
39 #endif
40 #include <vcl/dialog.hxx>
41 #include <vcl/field.hxx>
42 #include <com/sun/star/frame/XFrame.hpp>
43 #include "svx/svxdllapi.h"
45 class SfxBindings;
46 class ToolbarMenu;
47 class SfxStatusForwarder;
49 //========================================================================
51 namespace svx
53 class ToolboxButtonColorUpdater;
55 class ExtrusionDirectionWindow : public SfxPopupWindow
57 using FloatingWindow::StateChanged;
59 private:
60 ToolbarMenu* mpMenu;
61 ValueSet* mpDirectionSet;
62 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
64 SfxStatusForwarder* mpDirectionForewarder;
65 SfxStatusForwarder* mpProjectionForewarder;
67 Image maImgDirection[9];
68 Image maImgDirectionH[9];
70 Image maImgPerspective;
71 Image maImgPerspectiveH;
72 Image maImgParallel;
73 Image maImgParallelH;
75 bool mbPopupMode;
77 DECL_LINK( SelectHdl, void * );
78 void FillValueSet();
80 void implSetDirection( sal_Int32 nSkew, bool bEnabled = true );
81 void implSetProjection( sal_Int32 nProjection, bool bEnabled = true );
82 void implInit();
84 protected:
85 virtual BOOL Close();
86 virtual void PopupModeEnd();
88 /** This function is called when the window gets the focus. It grabs
89 the focus to the line ends value set so that it can be controlled with
90 the keyboard.
92 virtual void GetFocus (void);
94 public:
95 ExtrusionDirectionWindow( USHORT nId,
96 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
97 ExtrusionDirectionWindow( USHORT nId,
98 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
99 Window* pParentWindow );
100 ~ExtrusionDirectionWindow();
102 void StartSelection();
104 virtual SfxPopupWindow* Clone() const;
106 virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );
107 virtual void DataChanged( const DataChangedEvent& rDCEvt );
110 //========================================================================
112 class SVX_DLLPUBLIC ExtrusionDirectionControl : public SfxToolBoxControl
114 public:
115 SFX_DECL_TOOLBOX_CONTROL();
116 ExtrusionDirectionControl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
117 ~ExtrusionDirectionControl();
119 virtual void StateChanged( USHORT nSID, SfxItemState eState,
120 const SfxPoolItem* pState );
121 virtual SfxPopupWindowType GetPopupWindowType() const;
122 virtual SfxPopupWindow* CreatePopupWindow();
125 //========================================================================
127 class ExtrusionDepthWindow : public SfxPopupWindow
129 using FloatingWindow::StateChanged;
131 private:
132 ToolbarMenu* mpMenu;
134 Image maImgDepth0;
135 Image maImgDepth1;
136 Image maImgDepth2;
137 Image maImgDepth3;
138 Image maImgDepth4;
139 Image maImgDepthInfinity;
141 Image maImgDepth0h;
142 Image maImgDepth1h;
143 Image maImgDepth2h;
144 Image maImgDepth3h;
145 Image maImgDepth4h;
146 Image maImgDepthInfinityh;
148 SfxStatusForwarder* mpDepthForewarder;
149 SfxStatusForwarder* mpMetricForewarder;
150 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
152 bool mbPopupMode;
153 FieldUnit meUnit;
154 double mfDepth;
155 bool mbEnabled;
157 DECL_LINK( SelectHdl, void * );
159 void implFillStrings( FieldUnit eUnit );
160 void implSetDepth( double fDepth, bool bEnabled );
161 void implInit();
163 protected:
164 virtual BOOL Close();
165 virtual void PopupModeEnd();
167 /** This function is called when the window gets the focus. It grabs
168 the focus to the line ends value set so that it can be controlled with
169 the keyboard.
171 virtual void GetFocus (void);
173 public:
174 ExtrusionDepthWindow( USHORT nId,
175 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
176 ExtrusionDepthWindow( USHORT nId,
177 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
178 Window* pParentWindow );
179 ~ExtrusionDepthWindow();
181 void StartSelection();
183 virtual SfxPopupWindow* Clone() const;
185 virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );
186 virtual void DataChanged( const DataChangedEvent& rDCEvt );
189 //========================================================================
191 class SVX_DLLPUBLIC ExtrusionDepthControl : public SfxToolBoxControl
193 public:
194 SFX_DECL_TOOLBOX_CONTROL();
195 ExtrusionDepthControl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
196 ~ExtrusionDepthControl();
198 virtual void StateChanged( USHORT nSID, SfxItemState eState,
199 const SfxPoolItem* pState );
200 virtual SfxPopupWindowType GetPopupWindowType() const;
201 virtual SfxPopupWindow* CreatePopupWindow();
204 //========================================================================
206 class ExtrusionLightingWindow : public SfxPopupWindow
208 using FloatingWindow::StateChanged;
210 private:
211 ToolbarMenu* mpMenu;
212 ValueSet* mpLightingSet;
214 Image maImgLightingOff[9];
215 Image maImgLightingOn[9];
216 Image maImgLightingPreview[9];
218 Image maImgLightingOffh[9];
219 Image maImgLightingOnh[9];
220 Image maImgLightingPreviewh[9];
222 Image maImgBright;
223 Image maImgNormal;
224 Image maImgDim;
225 Image maImgBrighth;
226 Image maImgNormalh;
227 Image maImgDimh;
229 SfxStatusForwarder* mpLightingDirectionForewarder;
230 SfxStatusForwarder* mpLightingIntensityForewarder;
231 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
233 bool mbPopupMode;
234 int mnLevel;
235 bool mbLevelEnabled;
236 int mnDirection;
237 bool mbDirectionEnabled;
239 void implSetIntensity( int nLevel, bool bEnabled );
240 void implSetDirection( int nDirection, bool bEnabled );
241 void implInit();
243 DECL_LINK( SelectHdl, void * );
245 protected:
246 virtual BOOL Close();
247 virtual void PopupModeEnd();
249 /** This function is called when the window gets the focus. It grabs
250 the focus to the line ends value set so that it can be controlled with
251 the keyboard.
253 virtual void GetFocus (void);
255 public:
256 ExtrusionLightingWindow( USHORT nId,
257 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
258 ExtrusionLightingWindow( USHORT nId,
259 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
260 Window* pParentWindow );
261 ~ExtrusionLightingWindow();
263 void StartSelection();
265 virtual SfxPopupWindow* Clone() const;
267 virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );
268 virtual void DataChanged( const DataChangedEvent& rDCEvt );
271 //========================================================================
273 class SVX_DLLPUBLIC ExtrusionLightingControl : public SfxToolBoxControl
275 public:
276 SFX_DECL_TOOLBOX_CONTROL();
277 ExtrusionLightingControl( USHORT nSlotid, USHORT nId, ToolBox& rTbx );
278 ~ExtrusionLightingControl();
280 virtual void StateChanged( USHORT nSID, SfxItemState eState,
281 const SfxPoolItem* pState );
282 virtual SfxPopupWindowType GetPopupWindowType() const;
283 virtual SfxPopupWindow* CreatePopupWindow();
286 //========================================================================
288 class ExtrusionSurfaceWindow : public SfxPopupWindow
290 using FloatingWindow::StateChanged;
291 private:
292 ToolbarMenu* mpMenu;
294 Image maImgSurface1;
295 Image maImgSurface2;
296 Image maImgSurface3;
297 Image maImgSurface4;
298 Image maImgSurface1h;
299 Image maImgSurface2h;
300 Image maImgSurface3h;
301 Image maImgSurface4h;
303 SfxStatusForwarder* mpSurfaceForewarder;
304 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
306 bool mbPopupMode;
308 DECL_LINK( SelectHdl, void * );
310 void implSetSurface( int nSurface, bool bEnabled );
311 void implInit();
313 protected:
314 virtual BOOL Close();
315 virtual void PopupModeEnd();
317 /** This function is called when the window gets the focus. It grabs
318 the focus to the line ends value set so that it can be controlled with
319 the keyboard.
321 virtual void GetFocus (void);
323 public:
324 ExtrusionSurfaceWindow( USHORT nId,
325 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
326 ExtrusionSurfaceWindow( USHORT nId,
327 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
328 Window* pParentWindow );
329 ~ExtrusionSurfaceWindow();
331 void StartSelection();
333 virtual SfxPopupWindow* Clone() const;
335 virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );
336 virtual void DataChanged( const DataChangedEvent& rDCEvt );
339 //========================================================================
341 class SVX_DLLPUBLIC ExtrusionSurfaceControl : public SfxToolBoxControl
343 public:
344 SFX_DECL_TOOLBOX_CONTROL();
345 ExtrusionSurfaceControl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
346 ~ExtrusionSurfaceControl();
348 virtual void StateChanged( USHORT nSID, SfxItemState eState,
349 const SfxPoolItem* pState );
350 virtual SfxPopupWindowType GetPopupWindowType() const;
351 virtual SfxPopupWindow* CreatePopupWindow();
354 //========================================================================
356 class SVX_DLLPUBLIC ExtrusionColorControl : public SfxToolBoxControl
358 private:
359 ToolboxButtonColorUpdater* mpBtnUpdater;
361 public:
362 SFX_DECL_TOOLBOX_CONTROL();
363 ExtrusionColorControl( USHORT nSlotId, USHORT nId, ToolBox& rTbx );
364 ~ExtrusionColorControl();
366 virtual void StateChanged( USHORT nSID, SfxItemState eState,
367 const SfxPoolItem* pState );
368 virtual SfxPopupWindowType GetPopupWindowType() const;
369 virtual SfxPopupWindow* CreatePopupWindow();
372 //========================================================================
374 class ExtrusionDepthDialog : public ModalDialog
376 FixedText maFLDepth;
377 MetricField maMtrDepth;
378 OKButton maOKButton;
379 CancelButton maCancelButton;
380 HelpButton maHelpButton;
382 FieldUnit meDefaultUnit;
384 public:
385 ExtrusionDepthDialog( Window* pParent, double fDepth, FieldUnit eDefaultUnit );
386 ~ExtrusionDepthDialog();
388 double getDepth() const;
392 #endif