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 .
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>
39 VIEWTYPE_REPRESENTATION
,
51 class SvxConvertTo3DItem
;
53 //------------------------------------------------------------------------
56 class SVX_DLLPUBLIC Svx3DWin
: public SfxDockingWindow
58 friend class Svx3DChildWindow
;
59 friend class Svx3DCtrlItem
;
64 ImageButton aBtnRepresentation
;
65 ImageButton aBtnLight
;
66 ImageButton aBtnTexture
;
67 ImageButton aBtnMaterial
;
68 ImageButton aBtnUpdate
;
69 ImageButton aBtnAssign
;
72 FixedLine aFLGeometrie
;
73 FixedText aFtPercentDiagonal
;
74 MetricField aMtrPercentDiagonal
;
75 FixedText aFtBackscale
;
76 MetricField aMtrBackscale
;
77 FixedText aFtEndAngle
;
78 MetricField aMtrEndAngle
;
80 MetricField aMtrDepth
;
81 FixedLine aFLSegments
;
83 FixedText aFtHorizontal
;
84 NumericField aNumHorizontal
;
85 FixedText aFtVertical
;
86 NumericField aNumVertical
;
89 ImageButton aBtnNormalsObj
;
90 ImageButton aBtnNormalsFlat
;
91 ImageButton aBtnNormalsSphere
;
92 ImageButton aBtnNormalsInvert
;
93 ImageButton aBtnTwoSidedLighting
;
95 ImageButton aBtnDoubleSided
;
96 FixedLine aFLRepresentation
;
98 FixedText aFtShademode
;
101 ImageButton aBtnShadow3d
;
103 MetricField aMtrSlant
;
104 FixedText aFtDistance
;
105 MetricField aMtrDistance
;
106 FixedText aFtFocalLeng
;
107 MetricField aMtrFocalLength
;
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
;
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
;
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
;
161 FixedLine aFLMaterial
;
162 FixedText aFtMatFavorites
;
163 ListBox aLbMatFavorites
;
164 FixedText aFtMatColor
;
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
;
181 ImageButton aBtnConvertTo3D
;
182 ImageButton aBtnLatheObject
;
183 ImageButton aBtnPerspective
;
189 ViewType3D eViewType
;
192 // Model, Page, View etc. for favourites
194 VirtualDevice
* pVDev
;
197 SfxBindings
* pBindings
;
198 Svx3DCtrlItem
* pControllerItem
;
200 SvxConvertTo3DItem
* pConvertTo3DItem
;
201 SvxConvertTo3DItem
* pConvertTo3DLatheItem
;
203 Svx3DWinImpl
* mpImpl
;
204 SfxMapUnit ePoolUnit
;
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
);
237 virtual void Resize();
240 Svx3DWin( SfxBindings
* pBindings
, SfxChildWindow
*pCW
,
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
263 virtual void StateChanged( sal_uInt16 nSId
, SfxItemState eState
,
264 const SfxPoolItem
* pState
);
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
282 virtual void StateChanged(sal_uInt16 nSId
, SfxItemState eState
, const SfxPoolItem
* pState
);
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: */