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 <svtools/toolbarmenu.hxx>
23 #include <svtools/popupwindowcontroller.hxx>
24 #include <svtools/valueset.hxx>
25 #include <vcl/customweld.hxx>
27 // enum to index light images
28 #define FROM_TOP_LEFT 0
30 #define FROM_TOP_RIGHT 2
34 #define FROM_BOTTOM_LEFT 6
36 #define FROM_BOTTOM_RIGHT 8
38 #define DIRECTION_NW 0
40 #define DIRECTION_NE 2
42 #define DIRECTION_NONE 4
44 #define DIRECTION_SW 6
46 #define DIRECTION_SE 8
50 class ExtrusionDirectionWindow final
: public WeldToolbarPopup
53 ExtrusionDirectionWindow(svt::PopupWindowController
* pControl
, weld::Widget
* pParentWindow
);
54 virtual void GrabFocus() override
;
55 virtual ~ExtrusionDirectionWindow() override
;
57 virtual void statusChanged( const css::frame::FeatureStateEvent
& Event
) override
;
60 rtl::Reference
<svt::PopupWindowController
> mxControl
;
61 std::unique_ptr
<ValueSet
> mxDirectionSet
;
62 std::unique_ptr
<weld::CustomWeld
> mxDirectionSetWin
;
63 std::unique_ptr
<weld::RadioButton
> mxPerspective
;
64 std::unique_ptr
<weld::RadioButton
> mxParallel
;
66 Image maImgDirection
[9];
68 DECL_LINK( SelectToolbarMenuHdl
, weld::Toggleable
&, void );
69 DECL_LINK( SelectValueSetHdl
, ValueSet
*, void );
71 void implSetDirection( sal_Int32 nSkew
, bool bEnabled
);
72 void implSetProjection( sal_Int32 nProjection
, bool bEnabled
);
76 class ExtrusionDirectionControl
: public svt::PopupWindowController
79 explicit ExtrusionDirectionControl( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
81 virtual std::unique_ptr
<WeldToolbarPopup
> weldPopupWindow() override
;
82 virtual VclPtr
<vcl::Window
> createVclPopupWindow( vcl::Window
* pParent
) override
;
85 virtual void SAL_CALL
initialize( const css::uno::Sequence
< css::uno::Any
>& aArguments
) override
;
88 virtual OUString SAL_CALL
getImplementationName() override
;
89 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
92 class ExtrusionDepthWindow final
: public WeldToolbarPopup
95 rtl::Reference
<svt::PopupWindowController
> mxControl
;
96 std::unique_ptr
<weld::RadioButton
> mxDepth0
;
97 std::unique_ptr
<weld::RadioButton
> mxDepth1
;
98 std::unique_ptr
<weld::RadioButton
> mxDepth2
;
99 std::unique_ptr
<weld::RadioButton
> mxDepth3
;
100 std::unique_ptr
<weld::RadioButton
> mxDepth4
;
101 std::unique_ptr
<weld::RadioButton
> mxInfinity
;
102 std::unique_ptr
<weld::RadioButton
> mxCustom
;
107 bool mbCommandDispatched
;
109 DECL_LINK( SelectHdl
, weld::Toggleable
&, void );
110 DECL_LINK( MouseReleaseHdl
, const MouseEvent
&, bool );
112 void implFillStrings( FieldUnit eUnit
);
113 void implSetDepth( double fDepth
);
115 void DispatchDepthDialog();
118 ExtrusionDepthWindow(svt::PopupWindowController
* pControl
, weld::Widget
* pParentWindow
);
119 virtual void GrabFocus() override
;
121 virtual void statusChanged( const css::frame::FeatureStateEvent
& Event
) override
;
124 class ExtrusionDepthController
: public svt::PopupWindowController
127 explicit ExtrusionDepthController( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
129 virtual std::unique_ptr
<WeldToolbarPopup
> weldPopupWindow() override
;
130 virtual VclPtr
<vcl::Window
> createVclPopupWindow( vcl::Window
* pParent
) override
;
133 virtual void SAL_CALL
initialize( const css::uno::Sequence
< css::uno::Any
>& aArguments
) override
;
136 virtual OUString SAL_CALL
getImplementationName() override
;
137 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
140 class ExtrusionLightingWindow final
: public WeldToolbarPopup
143 rtl::Reference
<svt::PopupWindowController
> mxControl
;
144 std::unique_ptr
<ValueSet
> mxLightingSet
;
145 std::unique_ptr
<weld::CustomWeld
> mxLightingSetWin
;
146 std::unique_ptr
<weld::RadioButton
> mxBright
;
147 std::unique_ptr
<weld::RadioButton
> mxNormal
;
148 std::unique_ptr
<weld::RadioButton
> mxDim
;
150 Image maImgLightingOff
[9];
151 Image maImgLightingOn
[9];
152 Image maImgLightingPreview
[9];
154 void implSetIntensity( int nLevel
, bool bEnabled
);
155 void implSetDirection( int nDirection
, bool bEnabled
);
157 DECL_LINK( SelectToolbarMenuHdl
, weld::Toggleable
&, void );
158 DECL_LINK( SelectValueSetHdl
, ValueSet
*, void );
160 ExtrusionLightingWindow(svt::PopupWindowController
* pControl
, weld::Widget
* pParentWindow
);
161 virtual void GrabFocus() override
;
162 virtual ~ExtrusionLightingWindow() override
;
164 virtual void statusChanged( const css::frame::FeatureStateEvent
& Event
) override
;
167 class ExtrusionLightingControl
: public svt::PopupWindowController
170 explicit ExtrusionLightingControl( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
172 virtual std::unique_ptr
<WeldToolbarPopup
> weldPopupWindow() override
;
173 virtual VclPtr
<vcl::Window
> createVclPopupWindow( vcl::Window
* pParent
) override
;
176 virtual void SAL_CALL
initialize( const css::uno::Sequence
< css::uno::Any
>& aArguments
) override
;
179 virtual OUString SAL_CALL
getImplementationName() override
;
180 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
183 class ExtrusionSurfaceWindow final
: public WeldToolbarPopup
186 rtl::Reference
<svt::PopupWindowController
> mxControl
;
187 std::unique_ptr
<weld::RadioButton
> mxWireFrame
;
188 std::unique_ptr
<weld::RadioButton
> mxMatt
;
189 std::unique_ptr
<weld::RadioButton
> mxPlastic
;
190 std::unique_ptr
<weld::RadioButton
> mxMetal
;
191 std::unique_ptr
<weld::RadioButton
> mxMetalMSO
;
193 DECL_LINK( SelectHdl
, weld::Toggleable
&, void );
195 void implSetSurface( int nSurface
, bool bEnabled
);
198 ExtrusionSurfaceWindow(svt::PopupWindowController
* pControl
, weld::Widget
* pParentWindow
);
199 virtual void GrabFocus() override
;
201 virtual void statusChanged( const css::frame::FeatureStateEvent
& Event
) override
;
205 class ExtrusionSurfaceControl
: public svt::PopupWindowController
208 explicit ExtrusionSurfaceControl( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
210 virtual std::unique_ptr
<WeldToolbarPopup
> weldPopupWindow() override
;
211 virtual VclPtr
<vcl::Window
> createVclPopupWindow( vcl::Window
* pParent
) override
;
214 virtual void SAL_CALL
initialize( const css::uno::Sequence
< css::uno::Any
>& aArguments
) override
;
217 virtual OUString SAL_CALL
getImplementationName() override
;
218 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
224 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */