bump product version to 4.1.6.2
[LibreOffice.git] / include / svx / float3d.hxx
blob1809e715c3ade977dca19b1c972ee35ae21a6b29
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 _SVX_FLOAT3D_HXX
21 #define _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 <svtools/stdctrl.hxx>
29 #include "svx/svxdllapi.h"
31 #include <svx/f3dchild.hxx>
32 #include <svx/dlgctl3d.hxx>
33 #include <svx/dlgctrl.hxx>
34 #include <svx/svdmodel.hxx>
36 enum ViewType3D
38 VIEWTYPE_GEO = 1,
39 VIEWTYPE_REPRESENTATION,
40 VIEWTYPE_LIGHT,
41 VIEWTYPE_TEXTURE,
42 VIEWTYPE_MATERIAL
45 class SdrModel;
46 class FmFormModel;
47 class VirtualDevice;
48 class E3dView;
49 class SdrPageView;
50 class Svx3DCtrlItem;
51 class SvxConvertTo3DItem;
53 //------------------------------------------------------------------------
54 struct Svx3DWinImpl;
56 class SVX_DLLPUBLIC Svx3DWin : public SfxDockingWindow
58 friend class Svx3DChildWindow;
59 friend class Svx3DCtrlItem;
60 using Window::Update;
62 private:
63 ImageButton aBtnGeo;
64 ImageButton aBtnRepresentation;
65 ImageButton aBtnLight;
66 ImageButton aBtnTexture;
67 ImageButton aBtnMaterial;
68 ImageButton aBtnUpdate;
69 ImageButton aBtnAssign;
71 // geometry
72 FixedLine aFLGeometrie;
73 FixedText aFtPercentDiagonal;
74 MetricField aMtrPercentDiagonal;
75 FixedText aFtBackscale;
76 MetricField aMtrBackscale;
77 FixedText aFtEndAngle;
78 MetricField aMtrEndAngle;
79 FixedText aFtDepth;
80 MetricField aMtrDepth;
81 FixedLine aFLSegments;
83 FixedText aFtHorizontal;
84 NumericField aNumHorizontal;
85 FixedText aFtVertical;
86 NumericField aNumVertical;
87 FixedLine aFLNormals;
89 ImageButton aBtnNormalsObj;
90 ImageButton aBtnNormalsFlat;
91 ImageButton aBtnNormalsSphere;
92 ImageButton aBtnNormalsInvert;
93 ImageButton aBtnTwoSidedLighting;
95 ImageButton aBtnDoubleSided;
96 FixedLine aFLRepresentation;
97 // presentation
98 FixedText aFtShademode;
99 ListBox aLbShademode;
100 FixedLine aFLShadow;
101 ImageButton aBtnShadow3d;
102 FixedText aFtSlant;
103 MetricField aMtrSlant;
104 FixedText aFtDistance;
105 MetricField aMtrDistance;
106 FixedText aFtFocalLeng;
107 MetricField aMtrFocalLength;
108 FixedLine aFLCamera;
109 FixedLine aFLLight;
111 // lighting
112 ImageButton aBtnLight1;
113 ImageButton aBtnLight2;
114 ImageButton aBtnLight3;
115 ImageButton aBtnLight4;
116 ImageButton aBtnLight5;
117 ImageButton aBtnLight6;
118 ImageButton aBtnLight7;
119 ImageButton aBtnLight8;
120 FixedText aFTLightsource;
121 ColorLB aLbLight1;
122 ColorLB aLbLight2;
123 ColorLB aLbLight3;
124 ColorLB aLbLight4;
125 ColorLB aLbLight5;
126 ColorLB aLbLight6;
127 ColorLB aLbLight7;
128 ColorLB aLbLight8;
130 ImageButton aBtnLightColor;
132 // #99694# Keyboard shortcuts activate the next control, so the
133 // order needed to be changed here
134 FixedText aFTAmbientlight; // Text label
135 ColorLB aLbAmbientlight; // ListBox
136 ImageButton aBtnAmbientColor; // color button
138 FixedLine aFLTexture;
140 // Textures
141 FixedText aFtTexKind;
142 ImageButton aBtnTexLuminance;
143 ImageButton aBtnTexColor;
144 FixedText aFtTexMode;
145 ImageButton aBtnTexReplace;
146 ImageButton aBtnTexModulate;
147 ImageButton aBtnTexBlend;
148 FixedText aFtTexProjectionX;
149 ImageButton aBtnTexObjectX;
150 ImageButton aBtnTexParallelX;
151 ImageButton aBtnTexCircleX;
152 FixedText aFtTexProjectionY;
153 ImageButton aBtnTexObjectY;
154 ImageButton aBtnTexParallelY;
155 ImageButton aBtnTexCircleY;
156 FixedText aFtTexFilter;
157 ImageButton aBtnTexFilter;
159 // material
160 // material editor
161 FixedLine aFLMaterial;
162 FixedText aFtMatFavorites;
163 ListBox aLbMatFavorites;
164 FixedText aFtMatColor;
165 ColorLB aLbMatColor;
166 ImageButton aBtnMatColor;
167 FixedText aFtMatEmission;
168 ColorLB aLbMatEmission;
169 ImageButton aBtnEmissionColor;
170 FixedLine aFLMatSpecular;
171 FixedText aFtMatSpecular;
172 ColorLB aLbMatSpecular;
173 ImageButton aBtnSpecularColor;
174 FixedText aFtMatSpecularIntensity;
175 MetricField aMtrMatSpecularIntensity;
177 Svx3DPreviewControl aCtlPreview;
178 SvxLightCtl3D aCtlLightPreview;
180 // bottom part
181 ImageButton aBtnConvertTo3D;
182 ImageButton aBtnLatheObject;
183 ImageButton aBtnPerspective;
185 // the rest ...
186 Image aImgLightOn;
187 Image aImgLightOff;
188 sal_Bool bUpdate;
189 ViewType3D eViewType;
190 Size aSize;
192 // Model, Page, View etc. for favourites
193 FmFormModel* pModel;
194 VirtualDevice* pVDev;
195 E3dView* p3DView;
197 SfxBindings* pBindings;
198 Svx3DCtrlItem* pControllerItem;
200 SvxConvertTo3DItem* pConvertTo3DItem;
201 SvxConvertTo3DItem* pConvertTo3DLatheItem;
203 Svx3DWinImpl* mpImpl;
204 SfxMapUnit ePoolUnit;
205 FieldUnit eFUnit;
207 // ItemSet used to remember set 2d attributes
208 SfxItemSet* mpRemember2DAttributes;
210 sal_Bool bOnly3DChanged;
212 //------------------------------------
214 DECL_LINK( ClickViewTypeHdl, void * );
215 DECL_LINK( ClickUpdateHdl, void * );
216 DECL_LINK( ClickAssignHdl, void * );
217 DECL_LINK( ClickHdl, PushButton * );
218 DECL_LINK( ClickColorHdl, PushButton * );
219 DECL_LINK( SelectHdl, void * );
220 DECL_LINK( ModifyHdl, void * );
221 void ClickLight(PushButton &rBtn);
223 DECL_LINK( ChangeLightCallbackHdl, void * );
224 DECL_LINK( ChangeSelectionCallbackHdl, void * );
226 SVX_DLLPRIVATE void Construct();
227 SVX_DLLPRIVATE void Reset();
229 SVX_DLLPRIVATE sal_Bool LBSelectColor( ColorLB* pLb, const Color& rColor );
230 SVX_DLLPRIVATE sal_uInt16 GetLightSource( const PushButton* pBtn = NULL );
231 SVX_DLLPRIVATE ColorLB* GetLbByButton( const PushButton* pBtn = NULL );
233 SVX_DLLPRIVATE bool GetUILightState( const ImageButton& rBtn ) const;
234 SVX_DLLPRIVATE void SetUILightState( ImageButton& aBtn, bool bState );
236 protected:
237 virtual void Resize();
239 public:
240 Svx3DWin( SfxBindings* pBindings, SfxChildWindow *pCW,
241 Window* pParent );
242 ~Svx3DWin();
244 void InitColorLB( const SdrModel* pDoc );
245 sal_Bool IsUpdateMode() const { return bUpdate; }
247 void Update( SfxItemSet& rSet );
248 void GetAttr( SfxItemSet& rSet );
250 void UpdatePreview(); // nach oben (private)
251 void DocumentReload(); // #83951#
254 /*************************************************************************
256 |* Controller item for 3D Window (Floating/Docking)
258 \************************************************************************/
260 class Svx3DCtrlItem : public SfxControllerItem
262 protected:
263 virtual void StateChanged( sal_uInt16 nSId, SfxItemState eState,
264 const SfxPoolItem* pState );
266 public:
267 Svx3DCtrlItem( sal_uInt16, SfxBindings* );
270 /*************************************************************************
272 |* ControllerItem for State of a Slot
273 |* (SID_CONVERT_TO_3D, SID_CONVERT_TO_3D_LATHE_FAST)
275 \************************************************************************/
277 class SvxConvertTo3DItem : public SfxControllerItem
279 sal_Bool bState;
281 protected:
282 virtual void StateChanged(sal_uInt16 nSId, SfxItemState eState, const SfxPoolItem* pState);
284 public:
285 SvxConvertTo3DItem(sal_uInt16 nId, SfxBindings* pBindings);
286 sal_Bool GetState() const { return bState; }
289 #endif // _SVX_FLOAT3D_HXX
291 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */