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 #include <svx/svx3ditems.hxx>
21 #include <com/sun/star/drawing/NormalsKind.hpp>
22 #include <com/sun/star/drawing/TextureProjectionMode.hpp>
23 #include <com/sun/star/drawing/TextureKind.hpp>
24 #include <com/sun/star/drawing/TextureMode.hpp>
25 #include <com/sun/star/drawing/ProjectionMode.hpp>
26 #include <com/sun/star/drawing/ShadeMode.hpp>
29 //////////////////////////////////////////////////////////////////////////////
31 using namespace ::rtl
;
32 using namespace ::com::sun::star
;
34 //////////////////////////////////////////////////////////////////////////////
35 Svx3DPercentDiagonalItem::Svx3DPercentDiagonalItem(sal_uInt16 nVal
)
36 : SfxUInt16Item(SDRATTR_3DOBJ_PERCENT_DIAGONAL
, nVal
)
39 Svx3DBackscaleItem::Svx3DBackscaleItem(sal_uInt16 nVal
)
40 : SfxUInt16Item(SDRATTR_3DOBJ_BACKSCALE
, nVal
)
43 Svx3DDepthItem::Svx3DDepthItem(sal_uInt32 nVal
)
44 : SfxUInt32Item(SDRATTR_3DOBJ_DEPTH
, nVal
)
47 Svx3DHorizontalSegmentsItem::Svx3DHorizontalSegmentsItem(sal_uInt32 nVal
)
48 : SfxUInt32Item(SDRATTR_3DOBJ_HORZ_SEGS
, nVal
)
51 Svx3DVerticalSegmentsItem::Svx3DVerticalSegmentsItem(sal_uInt32 nVal
)
52 : SfxUInt32Item(SDRATTR_3DOBJ_VERT_SEGS
, nVal
)
55 Svx3DEndAngleItem::Svx3DEndAngleItem(sal_uInt32 nVal
)
56 : SfxUInt32Item(SDRATTR_3DOBJ_END_ANGLE
, nVal
)
59 Svx3DDoubleSidedItem::Svx3DDoubleSidedItem(sal_Bool bVal
)
60 : SfxBoolItem(SDRATTR_3DOBJ_DOUBLE_SIDED
, bVal
)
63 //////////////////////////////////////////////////////////////////////////////
65 // Added extra Item (Bool) for chart2 to be able to show reduced line geometry
67 Svx3DReducedLineGeometryItem::Svx3DReducedLineGeometryItem(sal_Bool bVal
)
68 : SfxBoolItem(SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY
, bVal
)
71 sal_uInt16
Svx3DReducedLineGeometryItem::GetVersion(sal_uInt16
/*nFileFormatVersion*/) const
76 SfxPoolItem
* Svx3DReducedLineGeometryItem::Create(SvStream
& rIn
, sal_uInt16 nItemVersion
) const
78 SfxBoolItem
* pRetval
= new Svx3DReducedLineGeometryItem();
82 SfxBoolItem
aBoolItem(Which(), rIn
);
83 pRetval
->SetValue(aBoolItem
.GetValue());
89 //////////////////////////////////////////////////////////////////////////////
91 Svx3DNormalsKindItem::Svx3DNormalsKindItem(sal_uInt16 nVal
)
92 : SfxUInt16Item(SDRATTR_3DOBJ_NORMALS_KIND
, nVal
)
95 Svx3DNormalsInvertItem::Svx3DNormalsInvertItem(sal_Bool bVal
)
96 : SfxBoolItem(SDRATTR_3DOBJ_NORMALS_INVERT
, bVal
)
99 Svx3DTextureProjectionXItem::Svx3DTextureProjectionXItem(sal_uInt16 nVal
)
100 : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_PROJ_X
, nVal
)
103 Svx3DTextureProjectionYItem::Svx3DTextureProjectionYItem(sal_uInt16 nVal
)
104 : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_PROJ_Y
, nVal
)
107 Svx3DShadow3DItem::Svx3DShadow3DItem(sal_Bool bVal
)
108 : SfxBoolItem(SDRATTR_3DOBJ_SHADOW_3D
, bVal
)
111 Svx3DMaterialColorItem::Svx3DMaterialColorItem(const Color
& rCol
)
112 : SvxColorItem(rCol
, SDRATTR_3DOBJ_MAT_COLOR
)
115 Svx3DMaterialEmissionItem::Svx3DMaterialEmissionItem(const Color
& rCol
)
116 : SvxColorItem(rCol
, SDRATTR_3DOBJ_MAT_EMISSION
)
119 Svx3DMaterialSpecularItem::Svx3DMaterialSpecularItem(const Color
& rCol
)
120 : SvxColorItem(rCol
, SDRATTR_3DOBJ_MAT_SPECULAR
)
123 Svx3DMaterialSpecularIntensityItem::Svx3DMaterialSpecularIntensityItem(sal_uInt16 nVal
)
124 : SfxUInt16Item(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY
, nVal
)
127 Svx3DTextureKindItem::Svx3DTextureKindItem(sal_uInt16 nVal
)
128 : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_KIND
, nVal
)
131 Svx3DTextureModeItem::Svx3DTextureModeItem(sal_uInt16 nVal
)
132 : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_MODE
, nVal
)
135 Svx3DTextureFilterItem::Svx3DTextureFilterItem(sal_Bool bVal
)
136 : SfxBoolItem(SDRATTR_3DOBJ_TEXTURE_FILTER
, bVal
)
139 Svx3DPerspectiveItem::Svx3DPerspectiveItem(sal_uInt16 nVal
)
140 : SfxUInt16Item(SDRATTR_3DSCENE_PERSPECTIVE
, nVal
)
143 Svx3DDistanceItem::Svx3DDistanceItem(sal_uInt32 nVal
)
144 : SfxUInt32Item(SDRATTR_3DSCENE_DISTANCE
, nVal
)
147 Svx3DFocalLengthItem::Svx3DFocalLengthItem(sal_uInt32 nVal
)
148 : SfxUInt32Item(SDRATTR_3DSCENE_FOCAL_LENGTH
, nVal
)
151 Svx3DTwoSidedLightingItem::Svx3DTwoSidedLightingItem(sal_Bool bVal
)
152 : SfxBoolItem(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING
, bVal
)
155 Svx3DLightcolor1Item::Svx3DLightcolor1Item(const Color
& rCol
)
156 : SvxColorItem(rCol
, SDRATTR_3DSCENE_LIGHTCOLOR_1
)
159 Svx3DLightcolor2Item::Svx3DLightcolor2Item(const Color
& rCol
)
160 : SvxColorItem(rCol
, SDRATTR_3DSCENE_LIGHTCOLOR_2
)
163 Svx3DLightcolor3Item::Svx3DLightcolor3Item(const Color
& rCol
)
164 : SvxColorItem(rCol
, SDRATTR_3DSCENE_LIGHTCOLOR_3
)
167 Svx3DLightcolor4Item::Svx3DLightcolor4Item(const Color
& rCol
)
168 : SvxColorItem(rCol
, SDRATTR_3DSCENE_LIGHTCOLOR_4
)
171 Svx3DLightcolor5Item::Svx3DLightcolor5Item(const Color
& rCol
)
172 : SvxColorItem(rCol
, SDRATTR_3DSCENE_LIGHTCOLOR_5
)
175 Svx3DLightcolor6Item::Svx3DLightcolor6Item(const Color
& rCol
)
176 : SvxColorItem(rCol
, SDRATTR_3DSCENE_LIGHTCOLOR_6
)
179 Svx3DLightcolor7Item::Svx3DLightcolor7Item(const Color
& rCol
)
180 : SvxColorItem(rCol
, SDRATTR_3DSCENE_LIGHTCOLOR_7
)
183 Svx3DLightcolor8Item::Svx3DLightcolor8Item(const Color
& rCol
)
184 : SvxColorItem(rCol
, SDRATTR_3DSCENE_LIGHTCOLOR_8
)
187 Svx3DAmbientcolorItem::Svx3DAmbientcolorItem(const Color
& rCol
)
188 : SvxColorItem(rCol
, SDRATTR_3DSCENE_AMBIENTCOLOR
)
191 Svx3DLightOnOff1Item::Svx3DLightOnOff1Item(sal_Bool bVal
)
192 : SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_1
, bVal
)
195 Svx3DLightOnOff2Item::Svx3DLightOnOff2Item(sal_Bool bVal
)
196 : SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_2
, bVal
)
199 Svx3DLightOnOff3Item::Svx3DLightOnOff3Item(sal_Bool bVal
)
200 : SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_3
, bVal
)
203 Svx3DLightOnOff4Item::Svx3DLightOnOff4Item(sal_Bool bVal
)
204 : SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_4
, bVal
)
207 Svx3DLightOnOff5Item::Svx3DLightOnOff5Item(sal_Bool bVal
)
208 : SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_5
, bVal
)
211 Svx3DLightOnOff6Item::Svx3DLightOnOff6Item(sal_Bool bVal
)
212 : SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_6
, bVal
)
215 Svx3DLightOnOff7Item::Svx3DLightOnOff7Item(sal_Bool bVal
)
216 : SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_7
, bVal
)
219 Svx3DLightOnOff8Item::Svx3DLightOnOff8Item(sal_Bool bVal
)
220 : SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_8
, bVal
)
223 Svx3DLightDirection1Item::Svx3DLightDirection1Item(const basegfx::B3DVector
& rVec
)
224 : SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_1
, rVec
)
227 Svx3DLightDirection2Item::Svx3DLightDirection2Item(const basegfx::B3DVector
& rVec
)
228 : SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_2
, rVec
)
231 Svx3DLightDirection3Item::Svx3DLightDirection3Item(const basegfx::B3DVector
& rVec
)
232 : SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_3
, rVec
)
235 Svx3DLightDirection4Item::Svx3DLightDirection4Item(const basegfx::B3DVector
& rVec
)
236 : SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_4
, rVec
)
239 Svx3DLightDirection5Item::Svx3DLightDirection5Item(const basegfx::B3DVector
& rVec
)
240 : SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_5
, rVec
)
243 Svx3DLightDirection6Item::Svx3DLightDirection6Item(const basegfx::B3DVector
& rVec
)
244 : SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_6
, rVec
)
247 Svx3DLightDirection7Item::Svx3DLightDirection7Item(const basegfx::B3DVector
& rVec
)
248 : SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_7
, rVec
)
251 Svx3DLightDirection8Item::Svx3DLightDirection8Item(const basegfx::B3DVector
& rVec
)
252 : SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_8
, rVec
)
255 Svx3DShadowSlantItem::Svx3DShadowSlantItem(sal_uInt16 nVal
)
256 : SfxUInt16Item(SDRATTR_3DSCENE_SHADOW_SLANT
, nVal
)
259 Svx3DShadeModeItem::Svx3DShadeModeItem(sal_uInt16 nVal
)
260 : SfxUInt16Item(SDRATTR_3DSCENE_SHADE_MODE
, nVal
)
263 //////////////////////////////////////////////////////////////////////////////
266 Svx3DSmoothNormalsItem::Svx3DSmoothNormalsItem(sal_Bool bVal
)
267 : SfxBoolItem(SDRATTR_3DOBJ_SMOOTH_NORMALS
, bVal
)
270 sal_uInt16
Svx3DSmoothNormalsItem::GetVersion(sal_uInt16
/*nFileFormatVersion*/) const
275 SfxPoolItem
* Svx3DSmoothNormalsItem::Create(SvStream
& rIn
, sal_uInt16 nItemVersion
) const
277 SfxBoolItem
* pRetval
= new Svx3DSmoothNormalsItem();
281 SfxBoolItem
aBoolItem(Which(), rIn
);
282 pRetval
->SetValue(aBoolItem
.GetValue());
288 //////////////////////////////////////////////////////////////////////////////
291 Svx3DSmoothLidsItem::Svx3DSmoothLidsItem(sal_Bool bVal
)
292 : SfxBoolItem(SDRATTR_3DOBJ_SMOOTH_LIDS
, bVal
)
295 sal_uInt16
Svx3DSmoothLidsItem::GetVersion(sal_uInt16
/*nFileFormatVersion*/) const
300 SfxPoolItem
* Svx3DSmoothLidsItem::Create(SvStream
& rIn
, sal_uInt16 nItemVersion
) const
302 SfxBoolItem
* pRetval
= new Svx3DSmoothLidsItem();
306 SfxBoolItem
aBoolItem(Which(), rIn
);
307 pRetval
->SetValue(aBoolItem
.GetValue());
313 //////////////////////////////////////////////////////////////////////////////
316 Svx3DCharacterModeItem::Svx3DCharacterModeItem(sal_Bool bVal
)
317 : SfxBoolItem(SDRATTR_3DOBJ_CHARACTER_MODE
, bVal
)
320 sal_uInt16
Svx3DCharacterModeItem::GetVersion(sal_uInt16
/*nFileFormatVersion*/) const
325 SfxPoolItem
* Svx3DCharacterModeItem::Create(SvStream
& rIn
, sal_uInt16 nItemVersion
) const
327 SfxBoolItem
* pRetval
= new Svx3DCharacterModeItem();
331 SfxBoolItem
aBoolItem(Which(), rIn
);
332 pRetval
->SetValue(aBoolItem
.GetValue());
338 //////////////////////////////////////////////////////////////////////////////
341 Svx3DCloseFrontItem::Svx3DCloseFrontItem(sal_Bool bVal
)
342 : SfxBoolItem(SDRATTR_3DOBJ_CLOSE_FRONT
, bVal
)
345 sal_uInt16
Svx3DCloseFrontItem::GetVersion(sal_uInt16
/*nFileFormatVersion*/) const
350 SfxPoolItem
* Svx3DCloseFrontItem::Create(SvStream
& rIn
, sal_uInt16 nItemVersion
) const
352 SfxBoolItem
* pRetval
= new Svx3DCloseFrontItem();
356 SfxBoolItem
aBoolItem(Which(), rIn
);
357 pRetval
->SetValue(aBoolItem
.GetValue());
363 //////////////////////////////////////////////////////////////////////////////
366 Svx3DCloseBackItem::Svx3DCloseBackItem(sal_Bool bVal
)
367 : SfxBoolItem(SDRATTR_3DOBJ_CLOSE_BACK
, bVal
)
370 sal_uInt16
Svx3DCloseBackItem::GetVersion(sal_uInt16
/*nFileFormatVersion*/) const
375 SfxPoolItem
* Svx3DCloseBackItem::Create(SvStream
& rIn
, sal_uInt16 nItemVersion
) const
377 SfxBoolItem
* pRetval
= new Svx3DCloseBackItem();
381 SfxBoolItem
aBoolItem(Which(), rIn
);
382 pRetval
->SetValue(aBoolItem
.GetValue());
388 //////////////////////////////////////////////////////////////////////////////
390 // Svx3DNormalsKindItem: use drawing::NormalsKind
391 bool Svx3DNormalsKindItem::QueryValue( uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
393 rVal
<<= (drawing::NormalsKind
)GetValue();
397 bool Svx3DNormalsKindItem::PutValue( const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
399 drawing::NormalsKind eVar
;
402 SetValue((sal_Int16
)eVar
);
406 SfxPoolItem
* Svx3DNormalsKindItem::Clone(SfxItemPool
* /*pPool*/) const
408 return new Svx3DNormalsKindItem(*this);
411 // Svx3DTextureProjectionXItem: use drawing::TextureProjectionMode
412 bool Svx3DTextureProjectionXItem::QueryValue( uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
414 rVal
<<= (drawing::TextureProjectionMode
)GetValue();
418 bool Svx3DTextureProjectionXItem::PutValue( const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
420 drawing::TextureProjectionMode eVar
;
423 SetValue((sal_Int16
)eVar
);
427 SfxPoolItem
* Svx3DTextureProjectionXItem::Clone(SfxItemPool
* /*pPool*/) const
429 return new Svx3DTextureProjectionXItem(*this);
432 // Svx3DTextureProjectionYItem: use drawing::TextureProjectionMode
433 bool Svx3DTextureProjectionYItem::QueryValue( uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
435 rVal
<<= (drawing::TextureProjectionMode
)GetValue();
439 bool Svx3DTextureProjectionYItem::PutValue( const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
441 drawing::TextureProjectionMode eVar
;
444 SetValue((sal_Int16
)eVar
);
448 SfxPoolItem
* Svx3DTextureProjectionYItem::Clone(SfxItemPool
* /*pPool*/) const
450 return new Svx3DTextureProjectionYItem(*this);
453 // Svx3DTextureKindItem: use drawing::TextureKind
454 bool Svx3DTextureKindItem::QueryValue( uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
456 rVal
<<= (drawing::TextureKind
)GetValue();
460 bool Svx3DTextureKindItem::PutValue( const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
462 drawing::TextureKind eVar
;
465 SetValue((sal_Int16
)eVar
);
469 SfxPoolItem
* Svx3DTextureKindItem::Clone(SfxItemPool
* /*pPool*/) const
471 return new Svx3DTextureKindItem(*this);
474 // Svx3DTextureModeItem: use drawing:TextureMode
475 bool Svx3DTextureModeItem::QueryValue( uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
477 rVal
<<= (drawing::TextureMode
)GetValue();
481 bool Svx3DTextureModeItem::PutValue( const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
483 drawing::TextureMode eVar
;
486 SetValue((sal_Int16
)eVar
);
490 SfxPoolItem
* Svx3DTextureModeItem::Clone(SfxItemPool
* /*pPool*/) const
492 return new Svx3DTextureModeItem(*this);
495 // Svx3DPerspectiveItem: use drawing::ProjectionMode
496 bool Svx3DPerspectiveItem::QueryValue( uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
498 rVal
<<= (drawing::ProjectionMode
)GetValue();
502 bool Svx3DPerspectiveItem::PutValue( const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
504 drawing::ProjectionMode eVar
;
507 SetValue((sal_Int16
)eVar
);
511 SfxPoolItem
* Svx3DPerspectiveItem::Clone(SfxItemPool
* /*pPool*/) const
513 return new Svx3DPerspectiveItem(*this);
516 // Svx3DShadeModeItem: use drawing::ShadeMode
517 bool Svx3DShadeModeItem::QueryValue( uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
519 rVal
<<= (drawing::ShadeMode
)GetValue();
523 bool Svx3DShadeModeItem::PutValue( const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
525 drawing::ShadeMode eVar
;
528 SetValue((sal_Int16
)eVar
);
532 SfxPoolItem
* Svx3DShadeModeItem::Clone(SfxItemPool
* /*pPool*/) const
534 return new Svx3DShadeModeItem(*this);
539 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */