build fix
[LibreOffice.git] / include / svx / float3d.hxx
blob396d104a9f5309a9341b7e6626b7c10c9c4486ac
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 .
20 #ifndef INCLUDED_SVX_FLOAT3D_HXX
21 #define INCLUDED_SVX_FLOAT3D_HXX
23 #include <sfx2/ctrlitem.hxx>
24 #include <vcl/fixed.hxx>
25 #include <vcl/field.hxx>
26 #include <sfx2/dockwin.hxx>
27 #include <vcl/button.hxx>
28 #include <svx/svxdllapi.h>
30 #include <svx/f3dchild.hxx>
31 #include <svx/dlgctl3d.hxx>
32 #include <svx/dlgctrl.hxx>
33 #include <svx/svdmodel.hxx>
35 enum class ViewType3D
37 Geo = 1,
38 Representation,
39 Light,
40 Texture,
41 Material
44 class FmFormModel;
45 class VirtualDevice;
46 class E3dView;
47 class SdrPageView;
48 class Svx3DCtrlItem;
49 class SvxConvertTo3DItem;
50 class SvxColorListBox;
52 struct Svx3DWinImpl;
54 class SAL_WARN_UNUSED SVX_DLLPUBLIC Svx3DWin : public SfxDockingWindow
56 friend class Svx3DChildWindow;
57 friend class Svx3DCtrlItem;
58 using Window::Update;
60 private:
61 VclPtr<PushButton> m_pBtnGeo;
62 VclPtr<PushButton> m_pBtnRepresentation;
63 VclPtr<PushButton> m_pBtnLight;
64 VclPtr<PushButton> m_pBtnTexture;
65 VclPtr<PushButton> m_pBtnMaterial;
66 VclPtr<PushButton> m_pBtnUpdate;
67 VclPtr<PushButton> m_pBtnAssign;
69 // geometry
70 VclPtr<VclContainer> m_pFLGeometrie;
71 VclPtr<FixedText> m_pFtPercentDiagonal;
72 VclPtr<MetricField> m_pMtrPercentDiagonal;
73 VclPtr<FixedText> m_pFtBackscale;
74 VclPtr<MetricField> m_pMtrBackscale;
75 VclPtr<FixedText> m_pFtEndAngle;
76 VclPtr<MetricField> m_pMtrEndAngle;
77 VclPtr<FixedText> m_pFtDepth;
78 VclPtr<MetricField> m_pMtrDepth;
80 VclPtr<VclContainer> m_pFLSegments;
81 VclPtr<NumericField> m_pNumHorizontal;
82 VclPtr<NumericField> m_pNumVertical;
84 VclPtr<VclContainer> m_pFLNormals;
85 VclPtr<PushButton> m_pBtnNormalsObj;
86 VclPtr<PushButton> m_pBtnNormalsFlat;
87 VclPtr<PushButton> m_pBtnNormalsSphere;
88 VclPtr<PushButton> m_pBtnNormalsInvert;
89 VclPtr<PushButton> m_pBtnTwoSidedLighting;
90 VclPtr<PushButton> m_pBtnDoubleSided;
92 // presentation
93 VclPtr<VclContainer> m_pFLRepresentation;
94 VclPtr<ListBox> m_pLbShademode;
96 VclPtr<VclContainer> m_pFLShadow;
97 VclPtr<PushButton> m_pBtnShadow3d;
98 VclPtr<FixedText> m_pFtSlant;
99 VclPtr<MetricField> m_pMtrSlant;
101 VclPtr<VclContainer> m_pFLCamera;
102 VclPtr<MetricField> m_pMtrDistance;
103 VclPtr<MetricField> m_pMtrFocalLength;
105 // lighting
106 VclPtr<VclContainer> m_pFLLight;
107 VclPtr<PushButton> m_pBtnLight1;
108 VclPtr<PushButton> m_pBtnLight2;
109 VclPtr<PushButton> m_pBtnLight3;
110 VclPtr<PushButton> m_pBtnLight4;
111 VclPtr<PushButton> m_pBtnLight5;
112 VclPtr<PushButton> m_pBtnLight6;
113 VclPtr<PushButton> m_pBtnLight7;
114 VclPtr<PushButton> m_pBtnLight8;
115 VclPtr<SvxColorListBox> m_pLbLight1;
116 VclPtr<SvxColorListBox> m_pLbLight2;
117 VclPtr<SvxColorListBox> m_pLbLight3;
118 VclPtr<SvxColorListBox> m_pLbLight4;
119 VclPtr<SvxColorListBox> m_pLbLight5;
120 VclPtr<SvxColorListBox> m_pLbLight6;
121 VclPtr<SvxColorListBox> m_pLbLight7;
122 VclPtr<SvxColorListBox> m_pLbLight8;
123 VclPtr<PushButton> m_pBtnLightColor;
124 VclPtr<SvxColorListBox> m_pLbAmbientlight; // ListBox
125 VclPtr<PushButton> m_pBtnAmbientColor; // color button
127 // Textures
128 VclPtr<VclContainer> m_pFLTexture;
129 VclPtr<PushButton> m_pBtnTexLuminance;
130 VclPtr<PushButton> m_pBtnTexColor;
131 VclPtr<PushButton> m_pBtnTexReplace;
132 VclPtr<PushButton> m_pBtnTexModulate;
133 VclPtr<PushButton> m_pBtnTexBlend;
134 VclPtr<PushButton> m_pBtnTexObjectX;
135 VclPtr<PushButton> m_pBtnTexParallelX;
136 VclPtr<PushButton> m_pBtnTexCircleX;
137 VclPtr<PushButton> m_pBtnTexObjectY;
138 VclPtr<PushButton> m_pBtnTexParallelY;
139 VclPtr<PushButton> m_pBtnTexCircleY;
140 VclPtr<PushButton> m_pBtnTexFilter;
142 // material
143 // material editor
144 VclPtr<VclContainer> m_pFLMaterial;
145 VclPtr<ListBox> m_pLbMatFavorites;
146 VclPtr<SvxColorListBox> m_pLbMatColor;
147 VclPtr<PushButton> m_pBtnMatColor;
148 VclPtr<SvxColorListBox> m_pLbMatEmission;
149 VclPtr<PushButton> m_pBtnEmissionColor;
151 VclPtr<VclContainer> m_pFLMatSpecular;
152 VclPtr<SvxColorListBox> m_pLbMatSpecular;
153 VclPtr<PushButton> m_pBtnSpecularColor;
154 VclPtr<MetricField> m_pMtrMatSpecularIntensity;
156 VclPtr<Svx3DPreviewControl> m_pCtlPreview;
157 VclPtr<SvxLightCtl3D> m_pCtlLightPreview;
159 // bottom part
160 VclPtr<PushButton> m_pBtnConvertTo3D;
161 VclPtr<PushButton> m_pBtnLatheObject;
162 VclPtr<PushButton> m_pBtnPerspective;
164 // the rest ...
165 Image aImgLightOn;
166 Image aImgLightOff;
167 bool bUpdate;
168 ViewType3D eViewType;
170 // Model, Page, View etc. for favourites
171 FmFormModel* pModel;
172 VclPtr<VirtualDevice> pVDev;
174 SfxBindings* pBindings;
175 Svx3DCtrlItem* pControllerItem;
177 SvxConvertTo3DItem* pConvertTo3DItem;
178 SvxConvertTo3DItem* pConvertTo3DLatheItem;
180 std::unique_ptr<Svx3DWinImpl> mpImpl;
181 MapUnit ePoolUnit;
182 FieldUnit eFUnit;
184 // ItemSet used to remember set 2d attributes
185 SfxItemSet* mpRemember2DAttributes;
187 DECL_LINK( ClickViewTypeHdl, Button*, void );
188 DECL_LINK( ClickUpdateHdl, Button*, void );
189 DECL_LINK( ClickAssignHdl, Button*, void );
190 DECL_LINK( ClickHdl, Button*, void );
191 DECL_LINK( ClickColorHdl, Button*, void );
192 DECL_LINK( SelectHdl, ListBox&, void );
193 DECL_LINK( SelectColorHdl, SvxColorListBox&, void );
194 DECL_LINK( ModifyHdl, Edit&, void );
195 void ClickLight(PushButton &rBtn);
197 DECL_LINK( ChangeSelectionCallbackHdl, SvxLightCtl3D*, void );
199 SVX_DLLPRIVATE void Construct();
200 SVX_DLLPRIVATE void Reset();
202 SVX_DLLPRIVATE static void LBSelectColor( SvxColorListBox* pLb, const Color& rColor );
203 SVX_DLLPRIVATE sal_uInt16 GetLightSource( const PushButton* pBtn );
204 SVX_DLLPRIVATE SvxColorListBox* GetLbByButton( const PushButton* pBtn = nullptr );
206 SVX_DLLPRIVATE bool GetUILightState( const PushButton& rBtn ) const;
207 SVX_DLLPRIVATE void SetUILightState( PushButton& aBtn, bool bState );
209 protected:
210 virtual void Resize() override;
212 public:
213 Svx3DWin( SfxBindings* pBindings, SfxChildWindow *pCW,
214 vcl::Window* pParent );
215 virtual ~Svx3DWin() override;
216 virtual void dispose() override;
218 void InitColorLB();
219 bool IsUpdateMode() const { return bUpdate; }
221 void Update( SfxItemSet& rSet );
222 void GetAttr( SfxItemSet& rSet );
224 void UpdatePreview(); // nach oben (private)
225 void DocumentReload();
228 /*************************************************************************
230 |* Controller item for 3D Window (Floating/Docking)
232 \************************************************************************/
234 class Svx3DCtrlItem : public SfxControllerItem
236 protected:
237 virtual void StateChanged( sal_uInt16 nSId, SfxItemState eState,
238 const SfxPoolItem* pState ) override;
240 public:
241 Svx3DCtrlItem( sal_uInt16, SfxBindings* );
244 /*************************************************************************
246 |* ControllerItem for State of a Slot
247 |* (SID_CONVERT_TO_3D, SID_CONVERT_TO_3D_LATHE_FAST)
249 \************************************************************************/
251 class SvxConvertTo3DItem : public SfxControllerItem
253 bool bState;
255 protected:
256 virtual void StateChanged(sal_uInt16 nSId, SfxItemState eState, const SfxPoolItem* pState) override;
258 public:
259 SvxConvertTo3DItem(sal_uInt16 nId, SfxBindings* pBindings);
260 bool GetState() const { return bState; }
263 #endif // INCLUDED_SVX_FLOAT3D_HXX
265 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */