Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _SVX_FLOAT3D_HXX
30 : : #define _SVX_FLOAT3D_HXX
31 : :
32 : : #include <sfx2/ctrlitem.hxx>
33 : : #include <vcl/fixed.hxx>
34 : : #include <vcl/field.hxx>
35 : : #include <sfx2/dockwin.hxx>
36 : : #include <vcl/button.hxx>
37 : : #include <svtools/stdctrl.hxx>
38 : : #include "svx/svxdllapi.h"
39 : :
40 : : #include <svx/f3dchild.hxx>
41 : : #include <svx/dlgctl3d.hxx>
42 : : #include <svx/dlgctrl.hxx>
43 : : #include <svx/svdmodel.hxx>
44 : :
45 : : enum ViewType3D
46 : : {
47 : : VIEWTYPE_GEO = 1,
48 : : VIEWTYPE_REPRESENTATION,
49 : : VIEWTYPE_LIGHT,
50 : : VIEWTYPE_TEXTURE,
51 : : VIEWTYPE_MATERIAL
52 : : };
53 : :
54 : : class SdrModel;
55 : : class FmFormModel;
56 : : class VirtualDevice;
57 : : class E3dView;
58 : : class SdrPageView;
59 : : class Svx3DCtrlItem;
60 : : class SvxConvertTo3DItem;
61 : :
62 : : //------------------------------------------------------------------------
63 : : struct Svx3DWinImpl;
64 : :
65 : : class SVX_DLLPUBLIC Svx3DWin : public SfxDockingWindow
66 : : {
67 : : friend class Svx3DChildWindow;
68 : : friend class Svx3DCtrlItem;
69 : : using Window::Update;
70 : :
71 : : private:
72 : : ImageButton aBtnGeo;
73 : : ImageButton aBtnRepresentation;
74 : : ImageButton aBtnLight;
75 : : ImageButton aBtnTexture;
76 : : ImageButton aBtnMaterial;
77 : : ImageButton aBtnUpdate;
78 : : ImageButton aBtnAssign;
79 : :
80 : : // geometry
81 : : FixedLine aFLGeometrie;
82 : : FixedText aFtPercentDiagonal;
83 : : MetricField aMtrPercentDiagonal;
84 : : FixedText aFtBackscale;
85 : : MetricField aMtrBackscale;
86 : : FixedText aFtEndAngle;
87 : : MetricField aMtrEndAngle;
88 : : FixedText aFtDepth;
89 : : MetricField aMtrDepth;
90 : : FixedLine aFLSegments;
91 : :
92 : : FixedText aFtHorizontal;
93 : : NumericField aNumHorizontal;
94 : : FixedText aFtVertical;
95 : : NumericField aNumVertical;
96 : : FixedLine aFLNormals;
97 : :
98 : : ImageButton aBtnNormalsObj;
99 : : ImageButton aBtnNormalsFlat;
100 : : ImageButton aBtnNormalsSphere;
101 : : ImageButton aBtnNormalsInvert;
102 : : ImageButton aBtnTwoSidedLighting;
103 : :
104 : : ImageButton aBtnDoubleSided;
105 : : FixedLine aFLRepresentation;
106 : : // presentation
107 : : FixedText aFtShademode;
108 : : ListBox aLbShademode;
109 : : FixedLine aFLShadow;
110 : : ImageButton aBtnShadow3d;
111 : : FixedText aFtSlant;
112 : : MetricField aMtrSlant;
113 : : FixedText aFtDistance;
114 : : MetricField aMtrDistance;
115 : : FixedText aFtFocalLeng;
116 : : MetricField aMtrFocalLength;
117 : : FixedLine aFLCamera;
118 : : FixedLine aFLLight;
119 : :
120 : : // lighting
121 : : ImageButton aBtnLight1;
122 : : ImageButton aBtnLight2;
123 : : ImageButton aBtnLight3;
124 : : ImageButton aBtnLight4;
125 : : ImageButton aBtnLight5;
126 : : ImageButton aBtnLight6;
127 : : ImageButton aBtnLight7;
128 : : ImageButton aBtnLight8;
129 : : FixedText aFTLightsource;
130 : : ColorLB aLbLight1;
131 : : ColorLB aLbLight2;
132 : : ColorLB aLbLight3;
133 : : ColorLB aLbLight4;
134 : : ColorLB aLbLight5;
135 : : ColorLB aLbLight6;
136 : : ColorLB aLbLight7;
137 : : ColorLB aLbLight8;
138 : :
139 : : ImageButton aBtnLightColor;
140 : :
141 : : // #99694# Keyboard shortcuts activate the next control, so the
142 : : // order needed to be changed here
143 : : FixedText aFTAmbientlight; // Text label
144 : : ColorLB aLbAmbientlight; // ListBox
145 : : ImageButton aBtnAmbientColor; // color button
146 : :
147 : : FixedLine aFLTexture;
148 : :
149 : : // Textures
150 : : FixedText aFtTexKind;
151 : : ImageButton aBtnTexLuminance;
152 : : ImageButton aBtnTexColor;
153 : : FixedText aFtTexMode;
154 : : ImageButton aBtnTexReplace;
155 : : ImageButton aBtnTexModulate;
156 : : ImageButton aBtnTexBlend;
157 : : FixedText aFtTexProjectionX;
158 : : ImageButton aBtnTexObjectX;
159 : : ImageButton aBtnTexParallelX;
160 : : ImageButton aBtnTexCircleX;
161 : : FixedText aFtTexProjectionY;
162 : : ImageButton aBtnTexObjectY;
163 : : ImageButton aBtnTexParallelY;
164 : : ImageButton aBtnTexCircleY;
165 : : FixedText aFtTexFilter;
166 : : ImageButton aBtnTexFilter;
167 : :
168 : : // material
169 : : // material editor
170 : : FixedLine aFLMaterial;
171 : : FixedText aFtMatFavorites;
172 : : ListBox aLbMatFavorites;
173 : : FixedText aFtMatColor;
174 : : ColorLB aLbMatColor;
175 : : ImageButton aBtnMatColor;
176 : : FixedText aFtMatEmission;
177 : : ColorLB aLbMatEmission;
178 : : ImageButton aBtnEmissionColor;
179 : : FixedLine aFLMatSpecular;
180 : : FixedText aFtMatSpecular;
181 : : ColorLB aLbMatSpecular;
182 : : ImageButton aBtnSpecularColor;
183 : : FixedText aFtMatSpecularIntensity;
184 : : MetricField aMtrMatSpecularIntensity;
185 : :
186 : : Svx3DPreviewControl aCtlPreview;
187 : : SvxLightCtl3D aCtlLightPreview;
188 : :
189 : : // bottom part
190 : : ImageButton aBtnConvertTo3D;
191 : : ImageButton aBtnLatheObject;
192 : : ImageButton aBtnPerspective;
193 : :
194 : : // the rest ...
195 : : Image aImgLightOn;
196 : : Image aImgLightOff;
197 : : sal_Bool bUpdate;
198 : : ViewType3D eViewType;
199 : : Size aSize;
200 : :
201 : : // Model, Page, View etc. for favourites
202 : : FmFormModel* pModel;
203 : : VirtualDevice* pVDev;
204 : : E3dView* p3DView;
205 : :
206 : : SfxBindings* pBindings;
207 : : Svx3DCtrlItem* pControllerItem;
208 : :
209 : : SvxConvertTo3DItem* pConvertTo3DItem;
210 : : SvxConvertTo3DItem* pConvertTo3DLatheItem;
211 : :
212 : : Svx3DWinImpl* mpImpl;
213 : : SfxMapUnit ePoolUnit;
214 : : FieldUnit eFUnit;
215 : :
216 : : // ItemSet used to remember set 2d attributes
217 : : SfxItemSet* mpRemember2DAttributes;
218 : :
219 : : sal_Bool bOnly3DChanged;
220 : :
221 : : //------------------------------------
222 : :
223 : : DECL_LINK( ClickViewTypeHdl, void * );
224 : : DECL_LINK( ClickUpdateHdl, void * );
225 : : DECL_LINK( ClickAssignHdl, void * );
226 : : DECL_LINK( ClickHdl, PushButton * );
227 : : DECL_LINK( ClickColorHdl, PushButton * );
228 : : DECL_LINK( SelectHdl, void * );
229 : : DECL_LINK( ModifyHdl, void * );
230 : : void ClickLight(PushButton &rBtn);
231 : :
232 : : DECL_LINK( ChangeLightCallbackHdl, void * );
233 : : DECL_LINK( ChangeSelectionCallbackHdl, void * );
234 : :
235 : : SVX_DLLPRIVATE void Construct();
236 : : SVX_DLLPRIVATE void Reset();
237 : :
238 : : SVX_DLLPRIVATE sal_Bool LBSelectColor( ColorLB* pLb, const Color& rColor );
239 : : SVX_DLLPRIVATE sal_uInt16 GetLightSource( const PushButton* pBtn = NULL );
240 : : SVX_DLLPRIVATE ColorLB* GetLbByButton( const PushButton* pBtn = NULL );
241 : :
242 : : SVX_DLLPRIVATE bool GetUILightState( const ImageButton& rBtn ) const;
243 : : SVX_DLLPRIVATE void SetUILightState( ImageButton& aBtn, bool bState );
244 : :
245 : : protected:
246 : : virtual void Resize();
247 : :
248 : : public:
249 : : Svx3DWin( SfxBindings* pBindings, SfxChildWindow *pCW,
250 : : Window* pParent );
251 : : ~Svx3DWin();
252 : :
253 : : void InitColorLB( const SdrModel* pDoc );
254 : 0 : sal_Bool IsUpdateMode() const { return bUpdate; }
255 : :
256 : : void Update( SfxItemSet& rSet );
257 : : void GetAttr( SfxItemSet& rSet );
258 : :
259 : : void UpdatePreview(); // nach oben (private)
260 : : void DocumentReload(); // #83951#
261 : : };
262 : :
263 : : /*************************************************************************
264 : : |*
265 : : |* Controller item for 3D Window (Floating/Docking)
266 : : |*
267 : : \************************************************************************/
268 : :
269 : : class Svx3DCtrlItem : public SfxControllerItem
270 : : {
271 : : protected:
272 : : virtual void StateChanged( sal_uInt16 nSId, SfxItemState eState,
273 : : const SfxPoolItem* pState );
274 : :
275 : : public:
276 : : Svx3DCtrlItem( sal_uInt16, SfxBindings* );
277 : : };
278 : :
279 : : /*************************************************************************
280 : : |*
281 : : |* ControllerItem for State of a Slot
282 : : |* (SID_CONVERT_TO_3D, SID_CONVERT_TO_3D_LATHE_FAST)
283 : : |*
284 : : \************************************************************************/
285 : :
286 : : class SvxConvertTo3DItem : public SfxControllerItem
287 : : {
288 : : sal_Bool bState;
289 : :
290 : : protected:
291 : : virtual void StateChanged(sal_uInt16 nSId, SfxItemState eState, const SfxPoolItem* pState);
292 : :
293 : : public:
294 : : SvxConvertTo3DItem(sal_uInt16 nId, SfxBindings* pBindings);
295 : : sal_Bool GetState() const { return bState; }
296 : : };
297 : :
298 : : #endif // _SVX_FLOAT3D_HXX
299 : :
300 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|