LibreOffice Module svx (master)  1
extrusioncontrols.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_SVX_SOURCE_TBXCTRLS_EXTRUSIONCONTROLS_HXX
20 #define INCLUDED_SVX_SOURCE_TBXCTRLS_EXTRUSIONCONTROLS_HXX
21 
22 #include <svtools/toolbarmenu.hxx>
24 #include <svtools/valueset.hxx>
25 #include <vcl/customweld.hxx>
26 
27 class ValueSet;
28 
29 // enum to index light images
30 #define FROM_TOP_LEFT 0
31 #define FROM_TOP 1
32 #define FROM_TOP_RIGHT 2
33 #define FROM_LEFT 3
34 #define FROM_FRONT 4
35 #define FROM_RIGHT 5
36 #define FROM_BOTTOM_LEFT 6
37 #define FROM_BOTTOM 7
38 #define FROM_BOTTOM_RIGHT 8
39 
40 #define DIRECTION_NW 0
41 #define DIRECTION_N 1
42 #define DIRECTION_NE 2
43 #define DIRECTION_W 3
44 #define DIRECTION_NONE 4
45 #define DIRECTION_E 5
46 #define DIRECTION_SW 6
47 #define DIRECTION_S 7
48 #define DIRECTION_SE 8
49 
50 namespace svx
51 {
53 {
54 public:
56  virtual void GrabFocus() override;
57  virtual ~ExtrusionDirectionWindow() override;
58 
59  virtual void statusChanged( const css::frame::FeatureStateEvent& Event ) override;
60 
61 private:
63  std::unique_ptr<SvtValueSet> mxDirectionSet;
64  std::unique_ptr<weld::CustomWeld> mxDirectionSetWin;
65  std::unique_ptr<weld::RadioButton> mxPerspective;
66  std::unique_ptr<weld::RadioButton> mxParallel;
67 
69 
70  DECL_LINK( SelectToolbarMenuHdl, weld::Button&, void );
71  DECL_LINK( SelectValueSetHdl, SvtValueSet*, void );
72 
73  void implSetDirection( sal_Int32 nSkew, bool bEnabled );
74  void implSetProjection( sal_Int32 nProjection, bool bEnabled );
75 
76 };
77 
79 {
80 public:
81  explicit ExtrusionDirectionControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
82 
83  virtual std::unique_ptr<WeldToolbarPopup> weldPopupWindow() override;
84  virtual VclPtr<vcl::Window> createVclPopupWindow( vcl::Window* pParent ) override;
85 
86  // XInitialization
87  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
88 
89  // XServiceInfo
90  virtual OUString SAL_CALL getImplementationName() override;
91  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
92 };
93 
95 {
96 private:
98  std::unique_ptr<weld::RadioButton> mxDepth0;
99  std::unique_ptr<weld::RadioButton> mxDepth1;
100  std::unique_ptr<weld::RadioButton> mxDepth2;
101  std::unique_ptr<weld::RadioButton> mxDepth3;
102  std::unique_ptr<weld::RadioButton> mxDepth4;
103  std::unique_ptr<weld::RadioButton> mxInfinity;
104  std::unique_ptr<weld::RadioButton> mxCustom;
105 
107  double mfDepth;
109 
110  DECL_LINK( SelectHdl, weld::ToggleButton&, void );
111  DECL_LINK( ClickHdl, weld::Button&, void );
112 
113  void implFillStrings( FieldUnit eUnit );
114  void implSetDepth( double fDepth );
115 
116 public:
118  virtual void GrabFocus() override;
119 
120  virtual void statusChanged( const css::frame::FeatureStateEvent& Event ) override;
121 };
122 
124 {
125 public:
126  explicit ExtrusionDepthController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
127 
128  virtual std::unique_ptr<WeldToolbarPopup> weldPopupWindow() override;
129  virtual VclPtr<vcl::Window> createVclPopupWindow( vcl::Window* pParent ) override;
130 
131  // XInitialization
132  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
133 
134  // XServiceInfo
135  virtual OUString SAL_CALL getImplementationName() override;
136  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
137 };
138 
140 {
141 private:
143  std::unique_ptr<SvtValueSet> mxLightingSet;
144  std::unique_ptr<weld::CustomWeld> mxLightingSetWin;
145  std::unique_ptr<weld::RadioButton> mxBright;
146  std::unique_ptr<weld::RadioButton> mxNormal;
147  std::unique_ptr<weld::RadioButton> mxDim;
148 
152 
153  void implSetIntensity( int nLevel, bool bEnabled );
154  void implSetDirection( int nDirection, bool bEnabled );
155 
156  DECL_LINK( SelectToolbarMenuHdl, weld::Button&, void );
157  DECL_LINK( SelectValueSetHdl, SvtValueSet*, void );
158 public:
160  virtual void GrabFocus() override;
161  virtual ~ExtrusionLightingWindow() override;
162 
163  virtual void statusChanged( const css::frame::FeatureStateEvent& Event ) override;
164 };
165 
167 {
168 public:
169  explicit ExtrusionLightingControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
170 
171  virtual std::unique_ptr<WeldToolbarPopup> weldPopupWindow() override;
172  virtual VclPtr<vcl::Window> createVclPopupWindow( vcl::Window* pParent ) override;
173 
174  // XInitialization
175  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
176 
177  // XServiceInfo
178  virtual OUString SAL_CALL getImplementationName() override;
179  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
180 };
181 
183 {
184 private:
186  std::unique_ptr<weld::RadioButton> mxWireFrame;
187  std::unique_ptr<weld::RadioButton> mxMatt;
188  std::unique_ptr<weld::RadioButton> mxPlastic;
189  std::unique_ptr<weld::RadioButton> mxMetal;
190 
191  DECL_LINK( SelectHdl, weld::Button&, void );
192 
193  void implSetSurface( int nSurface, bool bEnabled );
194 
195 public:
197  virtual void GrabFocus() override;
198 
199  virtual void statusChanged( const css::frame::FeatureStateEvent& Event ) override;
200 };
201 
202 
204 {
205 public:
206  explicit ExtrusionSurfaceControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
207 
208  virtual std::unique_ptr<WeldToolbarPopup> weldPopupWindow() override;
209  virtual VclPtr<vcl::Window> createVclPopupWindow( vcl::Window* pParent ) override;
210 
211  // XInitialization
212  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
213 
214  // XServiceInfo
215  virtual OUString SAL_CALL getImplementationName() override;
216  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
217 };
218 
219 }
220 #endif
221 
222 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::RadioButton > mxCustom
virtual OUString SAL_CALL getImplementationName() override
virtual void statusChanged(const css::frame::FeatureStateEvent &Event) override
FieldUnit
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
DECL_LINK(SelectHdl, weld::Button &, void)
virtual void statusChanged(const css::frame::FeatureStateEvent &Event) override
std::unique_ptr< SvtValueSet > mxDirectionSet
virtual ~ExtrusionLightingWindow() override
void implSetIntensity(int nLevel, bool bEnabled)
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
DECL_LINK(SelectToolbarMenuHdl, weld::Button &, void)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
ExtrusionLightingControl(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
rtl::Reference< svt::PopupWindowController > mxControl
std::unique_ptr< weld::RadioButton > mxPlastic
std::unique_ptr< weld::RadioButton > mxWireFrame
virtual std::unique_ptr< WeldToolbarPopup > weldPopupWindow() override
virtual void statusChanged(const css::frame::FeatureStateEvent &Event) override
std::unique_ptr< SvtValueSet > mxLightingSet
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
rtl::Reference< svt::PopupWindowController > mxControl
virtual VclPtr< vcl::Window > createVclPopupWindow(vcl::Window *pParent) override
std::unique_ptr< weld::RadioButton > mxMatt
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
Sequence< PropertyValue > aArguments
virtual void GrabFocus() override
virtual void GrabFocus() override
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual std::unique_ptr< WeldToolbarPopup > weldPopupWindow() override
std::unique_ptr< weld::RadioButton > mxDepth1
std::unique_ptr< weld::RadioButton > mxDepth2
ExtrusionSurfaceControl(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual void GrabFocus() override
virtual OUString SAL_CALL getImplementationName() override
virtual void statusChanged(const css::frame::FeatureStateEvent &Event) override
std::unique_ptr< weld::RadioButton > mxDepth3
std::unique_ptr< weld::RadioButton > mxPerspective
std::unique_ptr< weld::RadioButton > mxParallel
ExtrusionLightingWindow(svt::PopupWindowController *pControl, weld::Widget *pParentWindow)
virtual ~ExtrusionDirectionWindow() override
virtual VclPtr< vcl::Window > createVclPopupWindow(vcl::Window *pParent) override
std::unique_ptr< weld::RadioButton > mxDepth0
std::unique_ptr< weld::RadioButton > mxDim
ExtrusionDirectionWindow(svt::PopupWindowController *pControl, weld::Widget *pParentWindow)
std::unique_ptr< weld::RadioButton > mxBright
virtual std::unique_ptr< WeldToolbarPopup > weldPopupWindow() override
virtual void GrabFocus() override
DECL_LINK(SelectToolbarMenuHdl, weld::Button &, void)
ExtrusionDepthWindow(svt::PopupWindowController *pControl, weld::Widget *pParentWindow)
rtl::Reference< svt::PopupWindowController > mxControl
std::unique_ptr< weld::RadioButton > mxNormal
virtual VclPtr< vcl::Window > createVclPopupWindow(vcl::Window *pParent) override
ExtrusionDepthController(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
ExtrusionSurfaceWindow(svt::PopupWindowController *pControl, weld::Widget *pParentWindow)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
rtl::Reference< svt::PopupWindowController > mxControl
std::unique_ptr< weld::RadioButton > mxInfinity
void implSetProjection(sal_Int32 nProjection, bool bEnabled)
std::unique_ptr< weld::RadioButton > mxDepth4
std::unique_ptr< weld::CustomWeld > mxDirectionSetWin
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
virtual OUString SAL_CALL getImplementationName() override
std::unique_ptr< weld::RadioButton > mxMetal
ExtrusionDirectionControl(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
std::unique_ptr< weld::CustomWeld > mxLightingSetWin
void implSetDirection(int nDirection, bool bEnabled)
void implSetSurface(int nSurface, bool bEnabled)
void implFillStrings(FieldUnit eUnit)
virtual VclPtr< vcl::Window > createVclPopupWindow(vcl::Window *pParent) override
DECL_LINK(SelectHdl, weld::ToggleButton &, void)
void implSetDepth(double fDepth)
void implSetDirection(sal_Int32 nSkew, bool bEnabled)
virtual std::unique_ptr< WeldToolbarPopup > weldPopupWindow() override