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 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>
36 // enum to index light images
37 #define FROM_TOP_LEFT 0
39 #define FROM_TOP_RIGHT 2
43 #define FROM_BOTTOM_LEFT 6
45 #define FROM_BOTTOM_RIGHT 8
47 #define DIRECTION_NW 0
49 #define DIRECTION_NE 2
51 #define DIRECTION_NONE 4
53 #define DIRECTION_SW 6
55 #define DIRECTION_SE 8
59 class ExtrusionDirectionWindow
: public svtools::ToolbarMenu
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
;
70 svt::ToolboxController
& mrController
;
71 VclPtr
<ValueSet
> mpDirectionSet
;
73 Image maImgDirection
[9];
74 Image maImgPerspective
;
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
90 explicit ExtrusionDirectionControl( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
92 virtual VclPtr
<vcl::Window
> createPopupWindow( vcl::Window
* pParent
) override
;
95 virtual void SAL_CALL
initialize( const css::uno::Sequence
< css::uno::Any
>& aArguments
) override
;
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
107 svt::ToolboxController
& mrController
;
114 Image maImgDepthInfinity
;
119 const OUString msExtrusionDepth
;
120 const OUString msMetricUnit
;
122 DECL_LINK( SelectHdl
, ToolbarMenu
*, void );
124 void implFillStrings( FieldUnit eUnit
);
125 void implSetDepth( double fDepth
);
128 ExtrusionDepthWindow( svt::ToolboxController
& rController
, vcl::Window
* pParentWindow
);
130 virtual void statusChanged( const css::frame::FeatureStateEvent
& Event
) override
;
133 class ExtrusionDepthController
: public svt::PopupWindowController
136 explicit ExtrusionDepthController( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
138 virtual VclPtr
<vcl::Window
> createPopupWindow( vcl::Window
* pParent
) override
;
141 virtual void SAL_CALL
initialize( const css::uno::Sequence
< css::uno::Any
>& aArguments
) override
;
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
154 svt::ToolboxController
& mrController
;
155 VclPtr
<ValueSet
> mpLightingSet
;
157 Image maImgLightingOff
[9];
158 Image maImgLightingOn
[9];
159 Image maImgLightingPreview
[9];
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 *);
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
187 explicit ExtrusionLightingControl( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
189 virtual VclPtr
<vcl::Window
> createPopupWindow( vcl::Window
* pParent
) override
;
192 virtual void SAL_CALL
initialize( const css::uno::Sequence
< css::uno::Any
>& aArguments
) override
;
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
205 svt::ToolboxController
& mrController
;
212 DECL_LINK( SelectHdl
, ToolbarMenu
*, void );
214 void implSetSurface( int nSurface
, bool bEnabled
);
217 ExtrusionSurfaceWindow( svt::ToolboxController
& rController
, vcl::Window
* pParentWindow
);
219 virtual void statusChanged( const css::frame::FeatureStateEvent
& Event
) override
;
223 class ExtrusionSurfaceControl
: public svt::PopupWindowController
226 explicit ExtrusionSurfaceControl( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
228 virtual VclPtr
<vcl::Window
> createPopupWindow( vcl::Window
* pParent
) override
;
231 virtual void SAL_CALL
initialize( const css::uno::Sequence
< css::uno::Any
>& aArguments
) override
;
234 virtual OUString SAL_CALL
getImplementationName() override
;
235 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
237 using svt::PopupWindowController::createPopupWindow
;
244 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */