Adjust includes
[LibreOffice.git] / svx / source / tbxctrls / extrusioncontrols.hxx
blob1dfb6f521ad9e682d01a6c6dcc6ec7bd7fff2ef5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 INCLUDED_SVX_SOURCE_TBXCTRLS_EXTRUSIONCONTROLS_HXX
20 #define INCLUDED_SVX_SOURCE_TBXCTRLS_EXTRUSIONCONTROLS_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>
34 class ValueSet;
36 // enum to index light images
37 #define FROM_TOP_LEFT 0
38 #define FROM_TOP 1
39 #define FROM_TOP_RIGHT 2
40 #define FROM_LEFT 3
41 #define FROM_FRONT 4
42 #define FROM_RIGHT 5
43 #define FROM_BOTTOM_LEFT 6
44 #define FROM_BOTTOM 7
45 #define FROM_BOTTOM_RIGHT 8
47 #define DIRECTION_NW 0
48 #define DIRECTION_N 1
49 #define DIRECTION_NE 2
50 #define DIRECTION_W 3
51 #define DIRECTION_NONE 4
52 #define DIRECTION_E 5
53 #define DIRECTION_SW 6
54 #define DIRECTION_S 7
55 #define DIRECTION_SE 8
57 namespace svx
59 class ExtrusionDirectionWindow : public svtools::ToolbarMenu
61 public:
62 ExtrusionDirectionWindow( svt::ToolboxController& rController, vcl::Window* pParentWindow );
63 virtual ~ExtrusionDirectionWindow() override;
64 virtual void dispose() override;
66 virtual void statusChanged( const css::frame::FeatureStateEvent& Event ) override;
67 virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
69 private:
70 svt::ToolboxController& mrController;
71 VclPtr<ValueSet> mpDirectionSet;
73 Image maImgDirection[9];
74 Image maImgPerspective;
75 Image maImgParallel;
77 DECL_LINK( SelectToolbarMenuHdl, ToolbarMenu*, void );
78 DECL_LINK( SelectValueSetHdl, ValueSet*, void );
79 void SelectHdl(void const *);
81 void implSetDirection( sal_Int32 nSkew, bool bEnabled );
82 void implSetProjection( sal_Int32 nProjection, bool bEnabled );
87 class ExtrusionDirectionControl : public svt::PopupWindowController
89 public:
90 explicit ExtrusionDirectionControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
92 virtual VclPtr<vcl::Window> createPopupWindow( vcl::Window* pParent ) override;
94 // XInitialization
95 virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
97 // XServiceInfo
98 virtual OUString SAL_CALL getImplementationName() override;
99 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
101 using svt::PopupWindowController::createPopupWindow;
104 class ExtrusionDepthWindow : public svtools::ToolbarMenu
106 private:
107 svt::ToolboxController& mrController;
109 Image maImgDepth0;
110 Image maImgDepth1;
111 Image maImgDepth2;
112 Image maImgDepth3;
113 Image maImgDepth4;
114 Image maImgDepthInfinity;
116 FieldUnit meUnit;
117 double mfDepth;
119 const OUString msExtrusionDepth;
120 const OUString msMetricUnit;
122 DECL_LINK( SelectHdl, ToolbarMenu*, void );
124 void implFillStrings( FieldUnit eUnit );
125 void implSetDepth( double fDepth );
127 public:
128 ExtrusionDepthWindow( svt::ToolboxController& rController, vcl::Window* pParentWindow );
130 virtual void statusChanged( const css::frame::FeatureStateEvent& Event ) override;
133 class ExtrusionDepthController : public svt::PopupWindowController
135 public:
136 explicit ExtrusionDepthController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
138 virtual VclPtr<vcl::Window> createPopupWindow( vcl::Window* pParent ) override;
140 // XInitialization
141 virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
143 // XServiceInfo
144 virtual OUString SAL_CALL getImplementationName() override;
145 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
147 using svt::PopupWindowController::createPopupWindow;
151 class ExtrusionLightingWindow : public svtools::ToolbarMenu
153 private:
154 svt::ToolboxController& mrController;
155 VclPtr<ValueSet> mpLightingSet;
157 Image maImgLightingOff[9];
158 Image maImgLightingOn[9];
159 Image maImgLightingPreview[9];
161 Image maImgBright;
162 Image maImgNormal;
163 Image maImgDim;
165 int mnDirection;
166 bool mbDirectionEnabled;
168 void implSetIntensity( int nLevel, bool bEnabled );
169 void implSetDirection( int nDirection, bool bEnabled );
171 DECL_LINK( SelectToolbarMenuHdl, ToolbarMenu*, void );
172 DECL_LINK( SelectValueSetHdl, ValueSet*, void );
173 void SelectHdl(void const *);
174 public:
175 ExtrusionLightingWindow( svt::ToolboxController& rController, vcl::Window* pParentWindow );
176 virtual ~ExtrusionLightingWindow() override;
177 virtual void dispose() override;
179 virtual void statusChanged( const css::frame::FeatureStateEvent& Event ) override;
180 virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
184 class ExtrusionLightingControl : public svt::PopupWindowController
186 public:
187 explicit ExtrusionLightingControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
189 virtual VclPtr<vcl::Window> createPopupWindow( vcl::Window* pParent ) override;
191 // XInitialization
192 virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
194 // XServiceInfo
195 virtual OUString SAL_CALL getImplementationName() override;
196 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
198 using svt::PopupWindowController::createPopupWindow;
202 class ExtrusionSurfaceWindow : public svtools::ToolbarMenu
204 private:
205 svt::ToolboxController& mrController;
207 Image maImgSurface1;
208 Image maImgSurface2;
209 Image maImgSurface3;
210 Image maImgSurface4;
212 DECL_LINK( SelectHdl, ToolbarMenu*, void );
214 void implSetSurface( int nSurface, bool bEnabled );
216 public:
217 ExtrusionSurfaceWindow( svt::ToolboxController& rController, vcl::Window* pParentWindow );
219 virtual void statusChanged( const css::frame::FeatureStateEvent& Event ) override;
223 class ExtrusionSurfaceControl : public svt::PopupWindowController
225 public:
226 explicit ExtrusionSurfaceControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
228 virtual VclPtr<vcl::Window> createPopupWindow( vcl::Window* pParent ) override;
230 // XInitialization
231 virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
233 // XServiceInfo
234 virtual OUString SAL_CALL getImplementationName() override;
235 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
237 using svt::PopupWindowController::createPopupWindow;
242 #endif
244 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */