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: extrusioncontrols.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 ************************************************************************/
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>
40 #include <vcl/dialog.hxx>
41 #include <vcl/field.hxx>
42 #include <com/sun/star/frame/XFrame.hpp>
43 #include "svx/svxdllapi.h"
47 class SfxStatusForwarder
;
49 //========================================================================
53 class ToolboxButtonColorUpdater
;
55 class ExtrusionDirectionWindow
: public SfxPopupWindow
57 using FloatingWindow::StateChanged
;
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
;
77 DECL_LINK( SelectHdl
, void * );
80 void implSetDirection( sal_Int32 nSkew
, bool bEnabled
= true );
81 void implSetProjection( sal_Int32 nProjection
, bool bEnabled
= true );
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
92 virtual void GetFocus (void);
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
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
;
139 Image maImgDepthInfinity
;
146 Image maImgDepthInfinityh
;
148 SfxStatusForwarder
* mpDepthForewarder
;
149 SfxStatusForwarder
* mpMetricForewarder
;
150 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
> mxFrame
;
157 DECL_LINK( SelectHdl
, void * );
159 void implFillStrings( FieldUnit eUnit
);
160 void implSetDepth( double fDepth
, bool bEnabled
);
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
171 virtual void GetFocus (void);
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
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
;
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];
229 SfxStatusForwarder
* mpLightingDirectionForewarder
;
230 SfxStatusForwarder
* mpLightingIntensityForewarder
;
231 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
> mxFrame
;
237 bool mbDirectionEnabled
;
239 void implSetIntensity( int nLevel
, bool bEnabled
);
240 void implSetDirection( int nDirection
, bool bEnabled
);
243 DECL_LINK( SelectHdl
, void * );
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
253 virtual void GetFocus (void);
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
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
;
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
;
308 DECL_LINK( SelectHdl
, void * );
310 void implSetSurface( int nSurface
, bool bEnabled
);
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
321 virtual void GetFocus (void);
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
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
359 ToolboxButtonColorUpdater
* mpBtnUpdater
;
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
377 MetricField maMtrDepth
;
379 CancelButton maCancelButton
;
380 HelpButton maHelpButton
;
382 FieldUnit meDefaultUnit
;
385 ExtrusionDepthDialog( Window
* pParent
, double fDepth
, FieldUnit eDefaultUnit
);
386 ~ExtrusionDepthDialog();
388 double getDepth() const;