1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _SVX_EXTRUSION_CONTROLS_HXX
20 #define _SVX_EXTRUSION_CONTROLS_HXX
22 #include "svx/svxdllapi.h"
24 #include <svtools/treelistbox.hxx>
25 #include <vcl/button.hxx>
26 #include <vcl/dialog.hxx>
27 #include <vcl/field.hxx>
28 #include <vcl/fixed.hxx>
30 #include <svtools/toolbarmenu.hxx>
31 #include <svtools/popupwindowcontroller.hxx>
32 #include <svtools/popupmenucontrollerbase.hxx>
36 //========================================================================
40 class ExtrusionDirectionWindow
: public svtools::ToolbarMenu
43 ExtrusionDirectionWindow( svt::ToolboxController
& rController
, const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& rFrame
, Window
* pParentWindow
);
45 virtual void SAL_CALL
statusChanged( const ::com::sun::star::frame::FeatureStateEvent
& Event
) throw ( ::com::sun::star::uno::RuntimeException
);
46 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
49 svt::ToolboxController
& mrController
;
50 ValueSet
* mpDirectionSet
;
52 Image maImgDirection
[9];
53 Image maImgPerspective
;
56 const OUString msExtrusionDirection
;
57 const OUString msExtrusionProjection
;
59 DECL_LINK( SelectHdl
, void * );
62 void implSetDirection( sal_Int32 nSkew
, bool bEnabled
= true );
63 void implSetProjection( sal_Int32 nProjection
, bool bEnabled
= true );
67 //========================================================================
69 class ExtrusionDirectionControl
: public svt::PopupWindowController
72 ExtrusionDirectionControl( const com::sun::star::uno::Reference
< com::sun::star::uno::XComponentContext
>& rxContext
);
74 virtual ::Window
* createPopupWindow( ::Window
* pParent
);
77 virtual OUString SAL_CALL
getImplementationName() throw( ::com::sun::star::uno::RuntimeException
);
78 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException
);
80 using svt::PopupWindowController::createPopupWindow
;
83 //========================================================================
85 class ExtrusionDepthWindow
: public svtools::ToolbarMenu
88 svt::ToolboxController
& mrController
;
95 Image maImgDepthInfinity
;
100 const OUString msExtrusionDepth
;
101 const OUString msMetricUnit
;
103 DECL_LINK( SelectHdl
, void * );
105 void implFillStrings( FieldUnit eUnit
);
106 void implSetDepth( double fDepth
);
109 ExtrusionDepthWindow( svt::ToolboxController
& rController
, const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& rFrame
, Window
* pParentWindow
);
111 virtual void SAL_CALL
statusChanged( const ::com::sun::star::frame::FeatureStateEvent
& Event
) throw ( ::com::sun::star::uno::RuntimeException
);
112 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
115 //========================================================================
117 class ExtrusionDepthController
: public svt::PopupWindowController
120 ExtrusionDepthController( const com::sun::star::uno::Reference
< com::sun::star::uno::XComponentContext
>& rxContext
);
122 virtual ::Window
* createPopupWindow( ::Window
* pParent
);
125 virtual OUString SAL_CALL
getImplementationName() throw( ::com::sun::star::uno::RuntimeException
);
126 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException
);
128 using svt::PopupWindowController::createPopupWindow
;
131 //========================================================================
133 class ExtrusionLightingWindow
: public svtools::ToolbarMenu
136 svt::ToolboxController
& mrController
;
137 ValueSet
* mpLightingSet
;
139 Image maImgLightingOff
[9];
140 Image maImgLightingOn
[9];
141 Image maImgLightingPreview
[9];
150 bool mbDirectionEnabled
;
152 const OUString msExtrusionLightingDirection
;
153 const OUString msExtrusionLightingIntensity
;
155 void implSetIntensity( int nLevel
, bool bEnabled
);
156 void implSetDirection( int nDirection
, bool bEnabled
);
158 DECL_LINK( SelectHdl
, void * );
160 ExtrusionLightingWindow( svt::ToolboxController
& rController
, const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& rFrame
, Window
* pParentWindow
);
162 virtual void SAL_CALL
statusChanged( const ::com::sun::star::frame::FeatureStateEvent
& Event
) throw ( ::com::sun::star::uno::RuntimeException
);
163 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
166 //========================================================================
168 class ExtrusionLightingControl
: public svt::PopupWindowController
171 ExtrusionLightingControl( const com::sun::star::uno::Reference
< com::sun::star::uno::XComponentContext
>& rxContext
);
173 virtual ::Window
* createPopupWindow( ::Window
* pParent
);
176 virtual OUString SAL_CALL
getImplementationName() throw( ::com::sun::star::uno::RuntimeException
);
177 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException
);
179 using svt::PopupWindowController::createPopupWindow
;
182 //========================================================================
184 class ExtrusionSurfaceWindow
: public svtools::ToolbarMenu
187 svt::ToolboxController
& mrController
;
194 const OUString msExtrusionSurface
;
196 DECL_LINK( SelectHdl
, void * );
198 void implSetSurface( int nSurface
, bool bEnabled
);
201 ExtrusionSurfaceWindow( svt::ToolboxController
& rController
, const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& rFrame
, Window
* pParentWindow
);
203 virtual void SAL_CALL
statusChanged( const ::com::sun::star::frame::FeatureStateEvent
& Event
) throw ( ::com::sun::star::uno::RuntimeException
);
206 //========================================================================
208 class ExtrusionSurfaceControl
: public svt::PopupWindowController
211 ExtrusionSurfaceControl( const com::sun::star::uno::Reference
< com::sun::star::uno::XComponentContext
>& rxContext
);
213 virtual ::Window
* createPopupWindow( ::Window
* pParent
);
216 virtual OUString SAL_CALL
getImplementationName() throw( ::com::sun::star::uno::RuntimeException
);
217 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException
);
219 using svt::PopupWindowController::createPopupWindow
;
222 //========================================================================
227 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */