1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef _SVX_EXTRUSION_CONTROLS_HXX
29 #define _SVX_EXTRUSION_CONTROLS_HXX
31 #include "svx/svxdllapi.h"
33 #include <svtools/svtreebx.hxx>
34 #include <vcl/button.hxx>
35 #include <vcl/dialog.hxx>
36 #include <vcl/field.hxx>
37 #include <vcl/fixed.hxx>
39 #include <svtools/toolbarmenu.hxx>
40 #include <svtools/popupwindowcontroller.hxx>
41 #include <svtools/popupmenucontrollerbase.hxx>
44 class SfxStatusForwarder
;
47 //========================================================================
51 class ToolboxButtonColorUpdater
;
53 class ExtrusionDirectionWindow
: public svtools::ToolbarMenu
56 ExtrusionDirectionWindow( svt::ToolboxController
& rController
, const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& rFrame
, Window
* pParentWindow
);
58 virtual void SAL_CALL
statusChanged( const ::com::sun::star::frame::FeatureStateEvent
& Event
) throw ( ::com::sun::star::uno::RuntimeException
);
59 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
62 svt::ToolboxController
& mrController
;
63 ValueSet
* mpDirectionSet
;
65 Image maImgDirection
[9];
66 Image maImgPerspective
;
69 const rtl::OUString msExtrusionDirection
;
70 const rtl::OUString msExtrusionProjection
;
72 DECL_LINK( SelectHdl
, void * );
75 void implSetDirection( sal_Int32 nSkew
, bool bEnabled
= true );
76 void implSetProjection( sal_Int32 nProjection
, bool bEnabled
= true );
80 //========================================================================
82 class ExtrusionDirectionControl
: public svt::PopupWindowController
85 ExtrusionDirectionControl( const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>& rServiceManager
);
87 virtual ::Window
* createPopupWindow( ::Window
* pParent
);
90 virtual ::rtl::OUString SAL_CALL
getImplementationName() throw( ::com::sun::star::uno::RuntimeException
);
91 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException
);
93 using svt::PopupWindowController::createPopupWindow
;
96 //========================================================================
98 class ExtrusionDepthWindow
: public svtools::ToolbarMenu
101 svt::ToolboxController
& mrController
;
108 Image maImgDepthInfinity
;
113 const rtl::OUString msExtrusionDepth
;
114 const rtl::OUString msMetricUnit
;
116 DECL_LINK( SelectHdl
, void * );
118 void implFillStrings( FieldUnit eUnit
);
119 void implSetDepth( double fDepth
);
122 ExtrusionDepthWindow( svt::ToolboxController
& rController
, const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& rFrame
, Window
* pParentWindow
);
124 virtual void SAL_CALL
statusChanged( const ::com::sun::star::frame::FeatureStateEvent
& Event
) throw ( ::com::sun::star::uno::RuntimeException
);
125 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
128 //========================================================================
130 class ExtrusionDepthController
: public svt::PopupWindowController
133 ExtrusionDepthController( const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>& rServiceManager
);
135 virtual ::Window
* createPopupWindow( ::Window
* pParent
);
138 virtual ::rtl::OUString SAL_CALL
getImplementationName() throw( ::com::sun::star::uno::RuntimeException
);
139 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException
);
141 using svt::PopupWindowController::createPopupWindow
;
144 //========================================================================
146 class ExtrusionLightingWindow
: public svtools::ToolbarMenu
149 svt::ToolboxController
& mrController
;
150 ValueSet
* mpLightingSet
;
152 Image maImgLightingOff
[9];
153 Image maImgLightingOn
[9];
154 Image maImgLightingPreview
[9];
163 bool mbDirectionEnabled
;
165 const rtl::OUString msExtrusionLightingDirection
;
166 const rtl::OUString msExtrusionLightingIntensity
;
168 void implSetIntensity( int nLevel
, bool bEnabled
);
169 void implSetDirection( int nDirection
, bool bEnabled
);
171 DECL_LINK( SelectHdl
, void * );
173 ExtrusionLightingWindow( svt::ToolboxController
& rController
, const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& rFrame
, Window
* pParentWindow
);
175 virtual void SAL_CALL
statusChanged( const ::com::sun::star::frame::FeatureStateEvent
& Event
) throw ( ::com::sun::star::uno::RuntimeException
);
176 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
179 //========================================================================
181 class ExtrusionLightingControl
: public svt::PopupWindowController
184 ExtrusionLightingControl( const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>& rServiceManager
);
186 virtual ::Window
* createPopupWindow( ::Window
* pParent
);
189 virtual ::rtl::OUString SAL_CALL
getImplementationName() throw( ::com::sun::star::uno::RuntimeException
);
190 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException
);
192 using svt::PopupWindowController::createPopupWindow
;
195 //========================================================================
197 class ExtrusionSurfaceWindow
: public svtools::ToolbarMenu
200 svt::ToolboxController
& mrController
;
207 const rtl::OUString msExtrusionSurface
;
209 DECL_LINK( SelectHdl
, void * );
211 void implSetSurface( int nSurface
, bool bEnabled
);
214 ExtrusionSurfaceWindow( svt::ToolboxController
& rController
, const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& rFrame
, Window
* pParentWindow
);
216 virtual void SAL_CALL
statusChanged( const ::com::sun::star::frame::FeatureStateEvent
& Event
) throw ( ::com::sun::star::uno::RuntimeException
);
219 //========================================================================
221 class ExtrusionSurfaceControl
: public svt::PopupWindowController
224 ExtrusionSurfaceControl( const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>& rServiceManager
);
226 virtual ::Window
* createPopupWindow( ::Window
* pParent
);
229 virtual ::rtl::OUString SAL_CALL
getImplementationName() throw( ::com::sun::star::uno::RuntimeException
);
230 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException
);
232 using svt::PopupWindowController::createPopupWindow
;
235 //========================================================================
240 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */