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>
28 using namespace ::com::sun::star
;
31 // Added extra Item (Bool) for chart2 to be able to show reduced line geometry
33 Svx3DReducedLineGeometryItem::Svx3DReducedLineGeometryItem(bool bVal
)
34 : SfxBoolItem(SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY
, bVal
)
38 Svx3DReducedLineGeometryItem
* Svx3DReducedLineGeometryItem::Clone(SfxItemPool
*) const
40 return new Svx3DReducedLineGeometryItem(*this);
43 Svx3DNormalsKindItem::Svx3DNormalsKindItem(sal_uInt16 nVal
)
44 : SfxUInt16Item(SDRATTR_3DOBJ_NORMALS_KIND
, nVal
)
48 Svx3DTextureProjectionXItem::Svx3DTextureProjectionXItem(sal_uInt16 nVal
)
49 : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_PROJ_X
, nVal
)
53 Svx3DTextureProjectionYItem::Svx3DTextureProjectionYItem(sal_uInt16 nVal
)
54 : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_PROJ_Y
, nVal
)
58 Svx3DTextureKindItem::Svx3DTextureKindItem(sal_uInt16 nVal
)
59 : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_KIND
, nVal
)
63 Svx3DTextureModeItem::Svx3DTextureModeItem(sal_uInt16 nVal
)
64 : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_MODE
, nVal
)
68 Svx3DPerspectiveItem::Svx3DPerspectiveItem(ProjectionType nVal
)
69 : SfxUInt16Item(SDRATTR_3DSCENE_PERSPECTIVE
, static_cast<sal_uInt16
>(nVal
))
73 Svx3DShadeModeItem::Svx3DShadeModeItem(sal_uInt16 nVal
)
74 : SfxUInt16Item(SDRATTR_3DSCENE_SHADE_MODE
, nVal
)
78 Svx3DSmoothNormalsItem::Svx3DSmoothNormalsItem(bool bVal
)
79 : SfxBoolItem(SDRATTR_3DOBJ_SMOOTH_NORMALS
, bVal
)
83 Svx3DSmoothNormalsItem
* Svx3DSmoothNormalsItem::Clone(SfxItemPool
*) const
85 return new Svx3DSmoothNormalsItem(*this);
88 Svx3DSmoothLidsItem::Svx3DSmoothLidsItem(bool bVal
)
89 : SfxBoolItem(SDRATTR_3DOBJ_SMOOTH_LIDS
, bVal
)
93 Svx3DSmoothLidsItem
* Svx3DSmoothLidsItem::Clone(SfxItemPool
*) const
95 return new Svx3DSmoothLidsItem(*this);
98 Svx3DCharacterModeItem::Svx3DCharacterModeItem(bool bVal
)
99 : SfxBoolItem(SDRATTR_3DOBJ_CHARACTER_MODE
, bVal
)
103 Svx3DCharacterModeItem
* Svx3DCharacterModeItem::Clone(SfxItemPool
*) const
105 return new Svx3DCharacterModeItem(*this);
108 Svx3DCloseFrontItem::Svx3DCloseFrontItem(bool bVal
)
109 : SfxBoolItem(SDRATTR_3DOBJ_CLOSE_FRONT
, bVal
)
113 Svx3DCloseFrontItem
* Svx3DCloseFrontItem::Clone(SfxItemPool
*) const
115 return new Svx3DCloseFrontItem(*this);
118 Svx3DCloseBackItem::Svx3DCloseBackItem(bool bVal
)
119 : SfxBoolItem(SDRATTR_3DOBJ_CLOSE_BACK
, bVal
)
123 Svx3DCloseBackItem
* Svx3DCloseBackItem::Clone(SfxItemPool
*) const
125 return new Svx3DCloseBackItem(*this);
128 // Svx3DNormalsKindItem: use drawing::NormalsKind
129 bool Svx3DNormalsKindItem::QueryValue(uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
131 rVal
<<= static_cast<drawing::NormalsKind
>(GetValue());
135 bool Svx3DNormalsKindItem::PutValue(const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
137 drawing::NormalsKind eVar
;
138 if (!(rVal
>>= eVar
))
140 SetValue(static_cast<sal_Int16
>(eVar
));
144 Svx3DNormalsKindItem
* Svx3DNormalsKindItem::Clone(SfxItemPool
* /*pPool*/) const
146 return new Svx3DNormalsKindItem(*this);
149 // Svx3DTextureProjectionXItem: use drawing::TextureProjectionMode
150 bool Svx3DTextureProjectionXItem::QueryValue(uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
152 rVal
<<= static_cast<drawing::TextureProjectionMode
>(GetValue());
156 bool Svx3DTextureProjectionXItem::PutValue(const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
158 drawing::TextureProjectionMode eVar
;
159 if (!(rVal
>>= eVar
))
161 SetValue(static_cast<sal_Int16
>(eVar
));
165 Svx3DTextureProjectionXItem
* Svx3DTextureProjectionXItem::Clone(SfxItemPool
* /*pPool*/) const
167 return new Svx3DTextureProjectionXItem(*this);
170 // Svx3DTextureProjectionYItem: use drawing::TextureProjectionMode
171 bool Svx3DTextureProjectionYItem::QueryValue(uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
173 rVal
<<= static_cast<drawing::TextureProjectionMode
>(GetValue());
177 bool Svx3DTextureProjectionYItem::PutValue(const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
179 drawing::TextureProjectionMode eVar
;
180 if (!(rVal
>>= eVar
))
182 SetValue(static_cast<sal_Int16
>(eVar
));
186 Svx3DTextureProjectionYItem
* Svx3DTextureProjectionYItem::Clone(SfxItemPool
* /*pPool*/) const
188 return new Svx3DTextureProjectionYItem(*this);
191 // Svx3DTextureKindItem: use drawing::TextureKind
192 bool Svx3DTextureKindItem::QueryValue(uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
194 rVal
<<= static_cast<drawing::TextureKind
>(GetValue());
198 bool Svx3DTextureKindItem::PutValue(const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
200 drawing::TextureKind eVar
;
201 if (!(rVal
>>= eVar
))
203 SetValue(static_cast<sal_Int16
>(eVar
));
207 Svx3DTextureKindItem
* Svx3DTextureKindItem::Clone(SfxItemPool
* /*pPool*/) const
209 return new Svx3DTextureKindItem(*this);
212 // Svx3DTextureModeItem: use drawing:TextureMode
213 bool Svx3DTextureModeItem::QueryValue(uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
215 rVal
<<= static_cast<drawing::TextureMode
>(GetValue());
219 bool Svx3DTextureModeItem::PutValue(const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
221 drawing::TextureMode eVar
;
222 if (!(rVal
>>= eVar
))
224 SetValue(static_cast<sal_Int16
>(eVar
));
228 Svx3DTextureModeItem
* Svx3DTextureModeItem::Clone(SfxItemPool
* /*pPool*/) const
230 return new Svx3DTextureModeItem(*this);
233 // Svx3DPerspectiveItem: use drawing::ProjectionMode
234 bool Svx3DPerspectiveItem::QueryValue(uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
236 rVal
<<= static_cast<drawing::ProjectionMode
>(GetValue());
240 bool Svx3DPerspectiveItem::PutValue(const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
242 drawing::ProjectionMode eVar
;
243 if (!(rVal
>>= eVar
))
245 SetValue(static_cast<sal_Int16
>(eVar
));
249 Svx3DPerspectiveItem
* Svx3DPerspectiveItem::Clone(SfxItemPool
* /*pPool*/) const
251 return new Svx3DPerspectiveItem(*this);
254 // Svx3DShadeModeItem: use drawing::ShadeMode
255 bool Svx3DShadeModeItem::QueryValue(uno::Any
& rVal
, sal_uInt8
/*nMemberId*/) const
257 rVal
<<= static_cast<drawing::ShadeMode
>(GetValue());
261 bool Svx3DShadeModeItem::PutValue(const uno::Any
& rVal
, sal_uInt8
/*nMemberId*/)
263 drawing::ShadeMode eVar
;
264 if (!(rVal
>>= eVar
))
266 SetValue(static_cast<sal_Int16
>(eVar
));
270 Svx3DShadeModeItem
* Svx3DShadeModeItem::Clone(SfxItemPool
* /*pPool*/) const
272 return new Svx3DShadeModeItem(*this);
277 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */