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>
31 using namespace ::com::sun::star
;
34 // Added extra Item (Bool) for chart2 to be able to show reduced line geometry
36 Svx3DReducedLineGeometryItem::Svx3DReducedLineGeometryItem(bool bVal
)
37 : SfxBoolItem(SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY
, bVal
)
40 sal_uInt16
Svx3DReducedLineGeometryItem::GetVersion(sal_uInt16
/*nFileFormatVersion*/) const
45 SfxPoolItem
* Svx3DReducedLineGeometryItem::Create(SvStream
& rIn
, sal_uInt16 nItemVersion
) const
47 SfxBoolItem
* pRetval
= new Svx3DReducedLineGeometryItem();
51 SfxBoolItem
aBoolItem(Which(), rIn
);
52 pRetval
->SetValue(aBoolItem
.GetValue());
58 SfxPoolItem
* Svx3DReducedLineGeometryItem::Clone(SfxItemPool
*) const
60 return new Svx3DReducedLineGeometryItem(*this);
63 Svx3DNormalsKindItem::Svx3DNormalsKindItem(sal_uInt16 nVal
)
64 : SfxUInt16Item(SDRATTR_3DOBJ_NORMALS_KIND
, nVal
)
67 Svx3DTextureProjectionXItem::Svx3DTextureProjectionXItem(sal_uInt16 nVal
)
68 : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_PROJ_X
, nVal
)
71 Svx3DTextureProjectionYItem::Svx3DTextureProjectionYItem(sal_uInt16 nVal
)
72 : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_PROJ_Y
, nVal
)
75 Svx3DTextureKindItem::Svx3DTextureKindItem(sal_uInt16 nVal
)
76 : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_KIND
, nVal
)
79 Svx3DTextureModeItem::Svx3DTextureModeItem(sal_uInt16 nVal
)
80 : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_MODE
, nVal
)
83 Svx3DPerspectiveItem::Svx3DPerspectiveItem(sal_uInt16 nVal
)
84 : SfxUInt16Item(SDRATTR_3DSCENE_PERSPECTIVE
, nVal
)
87 Svx3DShadeModeItem::Svx3DShadeModeItem(sal_uInt16 nVal
)
88 : SfxUInt16Item(SDRATTR_3DSCENE_SHADE_MODE
, nVal
)
94 Svx3DSmoothNormalsItem::Svx3DSmoothNormalsItem(bool bVal
)
95 : SfxBoolItem(SDRATTR_3DOBJ_SMOOTH_NORMALS
, bVal
)
98 sal_uInt16
Svx3DSmoothNormalsItem::GetVersion(sal_uInt16
/*nFileFormatVersion*/) const
103 SfxPoolItem
* Svx3DSmoothNormalsItem::Create(SvStream
& rIn
, sal_uInt16 nItemVersion
) const
105 SfxBoolItem
* pRetval
= new Svx3DSmoothNormalsItem();
109 SfxBoolItem
aBoolItem(Which(), rIn
);
110 pRetval
->SetValue(aBoolItem
.GetValue());
116 SfxPoolItem
* Svx3DSmoothNormalsItem::Clone(SfxItemPool
*) const
118 return new Svx3DSmoothNormalsItem(*this);
123 Svx3DSmoothLidsItem::Svx3DSmoothLidsItem(bool bVal
)
124 : SfxBoolItem(SDRATTR_3DOBJ_SMOOTH_LIDS
, bVal
)
127 sal_uInt16
Svx3DSmoothLidsItem::GetVersion(sal_uInt16
/*nFileFormatVersion*/) const
132 SfxPoolItem
* Svx3DSmoothLidsItem::Create(SvStream
& rIn
, sal_uInt16 nItemVersion
) const
134 SfxBoolItem
* pRetval
= new Svx3DSmoothLidsItem();
138 SfxBoolItem
aBoolItem(Which(), rIn
);
139 pRetval
->SetValue(aBoolItem
.GetValue());
145 SfxPoolItem
* Svx3DSmoothLidsItem::Clone(SfxItemPool
*) const
147 return new Svx3DSmoothLidsItem(*this);
152 Svx3DCharacterModeItem::Svx3DCharacterModeItem(bool bVal
)
153 : SfxBoolItem(SDRATTR_3DOBJ_CHARACTER_MODE
, bVal
)
156 sal_uInt16
Svx3DCharacterModeItem::GetVersion(sal_uInt16
/*nFileFormatVersion*/) const
161 SfxPoolItem
* Svx3DCharacterModeItem::Create(SvStream
& rIn
, sal_uInt16 nItemVersion
) const
163 SfxBoolItem
* pRetval
= new Svx3DCharacterModeItem();
167 SfxBoolItem
aBoolItem(Which(), rIn
);
168 pRetval
->SetValue(aBoolItem
.GetValue());
174 SfxPoolItem
* Svx3DCharacterModeItem::Clone(SfxItemPool
*) const
176 return new Svx3DCharacterModeItem(*this);
181 Svx3DCloseFrontItem::Svx3DCloseFrontItem(bool bVal
)
182 : SfxBoolItem(SDRATTR_3DOBJ_CLOSE_FRONT
, bVal
)
185 sal_uInt16
Svx3DCloseFrontItem::GetVersion(sal_uInt16
/*nFileFormatVersion*/) const
190 SfxPoolItem
* Svx3DCloseFrontItem::Create(SvStream
& rIn
, sal_uInt16 nItemVersion
) const
192 SfxBoolItem
* pRetval
= new Svx3DCloseFrontItem();
196 SfxBoolItem
aBoolItem(Which(), rIn
);
197 pRetval
->SetValue(aBoolItem
.GetValue());
203 SfxPoolItem
* Svx3DCloseFrontItem::Clone(SfxItemPool
*) const
205 return new Svx3DCloseFrontItem(*this);
210 Svx3DCloseBackItem::Svx3DCloseBackItem(bool bVal
)
211 : SfxBoolItem(SDRATTR_3DOBJ_CLOSE_BACK
, bVal
)
214 sal_uInt16
Svx3DCloseBackItem::GetVersion(sal_uInt16
/*nFileFormatVersion*/) const
219 SfxPoolItem
* Svx3DCloseBackItem::Create(SvStream
& rIn
, sal_uInt16 nItemVersion
) const
221 SfxBoolItem
* pRetval
= new Svx3DCloseBackItem();
225 SfxBoolItem
aBoolItem(Which(), rIn
);
226 pRetval
->SetValue(aBoolItem
.GetValue());
232 SfxPoolItem
* Svx3DCloseBackItem::Clone(SfxItemPool
*) const
234 return new Svx3DCloseBackItem(*this);
237 // Svx3DNormalsKindItem: use drawing::NormalsKind
238 bool Svx3DNormalsKindItem::QueryValue( uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
240 rVal
<<= (drawing::NormalsKind
)GetValue();
244 bool Svx3DNormalsKindItem::PutValue( const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
246 drawing::NormalsKind eVar
;
249 SetValue((sal_Int16
)eVar
);
253 SfxPoolItem
* Svx3DNormalsKindItem::Clone(SfxItemPool
* /*pPool*/) const
255 return new Svx3DNormalsKindItem(*this);
258 // Svx3DTextureProjectionXItem: use drawing::TextureProjectionMode
259 bool Svx3DTextureProjectionXItem::QueryValue( uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
261 rVal
<<= (drawing::TextureProjectionMode
)GetValue();
265 bool Svx3DTextureProjectionXItem::PutValue( const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
267 drawing::TextureProjectionMode eVar
;
270 SetValue((sal_Int16
)eVar
);
274 SfxPoolItem
* Svx3DTextureProjectionXItem::Clone(SfxItemPool
* /*pPool*/) const
276 return new Svx3DTextureProjectionXItem(*this);
279 // Svx3DTextureProjectionYItem: use drawing::TextureProjectionMode
280 bool Svx3DTextureProjectionYItem::QueryValue( uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
282 rVal
<<= (drawing::TextureProjectionMode
)GetValue();
286 bool Svx3DTextureProjectionYItem::PutValue( const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
288 drawing::TextureProjectionMode eVar
;
291 SetValue((sal_Int16
)eVar
);
295 SfxPoolItem
* Svx3DTextureProjectionYItem::Clone(SfxItemPool
* /*pPool*/) const
297 return new Svx3DTextureProjectionYItem(*this);
300 // Svx3DTextureKindItem: use drawing::TextureKind
301 bool Svx3DTextureKindItem::QueryValue( uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
303 rVal
<<= (drawing::TextureKind
)GetValue();
307 bool Svx3DTextureKindItem::PutValue( const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
309 drawing::TextureKind eVar
;
312 SetValue((sal_Int16
)eVar
);
316 SfxPoolItem
* Svx3DTextureKindItem::Clone(SfxItemPool
* /*pPool*/) const
318 return new Svx3DTextureKindItem(*this);
321 // Svx3DTextureModeItem: use drawing:TextureMode
322 bool Svx3DTextureModeItem::QueryValue( uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
324 rVal
<<= (drawing::TextureMode
)GetValue();
328 bool Svx3DTextureModeItem::PutValue( const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
330 drawing::TextureMode eVar
;
333 SetValue((sal_Int16
)eVar
);
337 SfxPoolItem
* Svx3DTextureModeItem::Clone(SfxItemPool
* /*pPool*/) const
339 return new Svx3DTextureModeItem(*this);
342 // Svx3DPerspectiveItem: use drawing::ProjectionMode
343 bool Svx3DPerspectiveItem::QueryValue( uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
345 rVal
<<= (drawing::ProjectionMode
)GetValue();
349 bool Svx3DPerspectiveItem::PutValue( const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
351 drawing::ProjectionMode eVar
;
354 SetValue((sal_Int16
)eVar
);
358 SfxPoolItem
* Svx3DPerspectiveItem::Clone(SfxItemPool
* /*pPool*/) const
360 return new Svx3DPerspectiveItem(*this);
363 // Svx3DShadeModeItem: use drawing::ShadeMode
364 bool Svx3DShadeModeItem::QueryValue( uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
366 rVal
<<= (drawing::ShadeMode
)GetValue();
370 bool Svx3DShadeModeItem::PutValue( const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
372 drawing::ShadeMode eVar
;
375 SetValue((sal_Int16
)eVar
);
379 SfxPoolItem
* Svx3DShadeModeItem::Clone(SfxItemPool
* /*pPool*/) const
381 return new Svx3DShadeModeItem(*this);
386 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */