Revert "Revert "Revert "stronger typing for SwClient::GetRegisteredIn"" and fix SwIte...
[LibreOffice.git] / svx / source / engine3d / svx3ditems.cxx
blobea58e06de59284141f9709ab12ee520010241dee
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/TextureKind2.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;
30 // #i28528#
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,
35 SfxItemType::Svx3DReducedLineGeometryItemType)
39 Svx3DReducedLineGeometryItem* Svx3DReducedLineGeometryItem::Clone(SfxItemPool*) const
41 return new Svx3DReducedLineGeometryItem(*this);
44 Svx3DNormalsKindItem::Svx3DNormalsKindItem(sal_uInt16 nVal)
45 : SfxUInt16Item(SDRATTR_3DOBJ_NORMALS_KIND, nVal, SfxItemType::Svx3DNormalsKindItemType)
49 Svx3DTextureProjectionXItem::Svx3DTextureProjectionXItem(sal_uInt16 nVal)
50 : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_PROJ_X, nVal,
51 SfxItemType::Svx3DTextureProjectionXItemType)
55 Svx3DTextureProjectionYItem::Svx3DTextureProjectionYItem(sal_uInt16 nVal)
56 : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_PROJ_Y, nVal,
57 SfxItemType::Svx3DTextureProjectionYItemType)
61 Svx3DTextureKindItem::Svx3DTextureKindItem(sal_uInt16 nVal)
62 : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_KIND, nVal, SfxItemType::Svx3DTextureKindItemType)
66 Svx3DTextureModeItem::Svx3DTextureModeItem(sal_uInt16 nVal)
67 : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_MODE, nVal, SfxItemType::Svx3DTextureModeItemType)
71 Svx3DPerspectiveItem::Svx3DPerspectiveItem(ProjectionType nVal)
72 : SfxUInt16Item(SDRATTR_3DSCENE_PERSPECTIVE, static_cast<sal_uInt16>(nVal),
73 SfxItemType::Svx3DPerspectiveItemType)
77 Svx3DShadeModeItem::Svx3DShadeModeItem(sal_uInt16 nVal)
78 : SfxUInt16Item(SDRATTR_3DSCENE_SHADE_MODE, nVal, SfxItemType::Svx3DShadeModeItemType)
82 Svx3DSmoothNormalsItem::Svx3DSmoothNormalsItem(bool bVal)
83 : SfxBoolItem(SDRATTR_3DOBJ_SMOOTH_NORMALS, bVal, SfxItemType::Svx3DSmoothNormalsItemType)
87 Svx3DSmoothNormalsItem* Svx3DSmoothNormalsItem::Clone(SfxItemPool*) const
89 return new Svx3DSmoothNormalsItem(*this);
92 Svx3DSmoothLidsItem::Svx3DSmoothLidsItem(bool bVal)
93 : SfxBoolItem(SDRATTR_3DOBJ_SMOOTH_LIDS, bVal, SfxItemType::Svx3DSmoothLidsItemType)
97 Svx3DSmoothLidsItem* Svx3DSmoothLidsItem::Clone(SfxItemPool*) const
99 return new Svx3DSmoothLidsItem(*this);
102 Svx3DCharacterModeItem::Svx3DCharacterModeItem(bool bVal)
103 : SfxBoolItem(SDRATTR_3DOBJ_CHARACTER_MODE, bVal, SfxItemType::Svx3DCharacterModeItemType)
107 Svx3DCharacterModeItem* Svx3DCharacterModeItem::Clone(SfxItemPool*) const
109 return new Svx3DCharacterModeItem(*this);
112 Svx3DCloseFrontItem::Svx3DCloseFrontItem(bool bVal)
113 : SfxBoolItem(SDRATTR_3DOBJ_CLOSE_FRONT, bVal, SfxItemType::Svx3DCloseFrontItemType)
117 Svx3DCloseFrontItem* Svx3DCloseFrontItem::Clone(SfxItemPool*) const
119 return new Svx3DCloseFrontItem(*this);
122 Svx3DCloseBackItem::Svx3DCloseBackItem(bool bVal)
123 : SfxBoolItem(SDRATTR_3DOBJ_CLOSE_BACK, bVal, SfxItemType::Svx3DCloseBackItemType)
127 Svx3DCloseBackItem* Svx3DCloseBackItem::Clone(SfxItemPool*) const
129 return new Svx3DCloseBackItem(*this);
132 // Svx3DNormalsKindItem: use drawing::NormalsKind
133 bool Svx3DNormalsKindItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
135 rVal <<= static_cast<drawing::NormalsKind>(GetValue());
136 return true;
139 bool Svx3DNormalsKindItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
141 drawing::NormalsKind eVar;
142 if (!(rVal >>= eVar))
143 return false;
144 SetValue(static_cast<sal_Int16>(eVar));
145 return true;
148 Svx3DNormalsKindItem* Svx3DNormalsKindItem::Clone(SfxItemPool* /*pPool*/) const
150 return new Svx3DNormalsKindItem(*this);
153 // Svx3DTextureProjectionXItem: use drawing::TextureProjectionMode
154 bool Svx3DTextureProjectionXItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
156 rVal <<= static_cast<drawing::TextureProjectionMode>(GetValue());
157 return true;
160 bool Svx3DTextureProjectionXItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
162 drawing::TextureProjectionMode eVar;
163 if (!(rVal >>= eVar))
164 return false;
165 SetValue(static_cast<sal_Int16>(eVar));
166 return true;
169 Svx3DTextureProjectionXItem* Svx3DTextureProjectionXItem::Clone(SfxItemPool* /*pPool*/) const
171 return new Svx3DTextureProjectionXItem(*this);
174 // Svx3DTextureProjectionYItem: use drawing::TextureProjectionMode
175 bool Svx3DTextureProjectionYItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
177 rVal <<= static_cast<drawing::TextureProjectionMode>(GetValue());
178 return true;
181 bool Svx3DTextureProjectionYItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
183 drawing::TextureProjectionMode eVar;
184 if (!(rVal >>= eVar))
185 return false;
186 SetValue(static_cast<sal_Int16>(eVar));
187 return true;
190 Svx3DTextureProjectionYItem* Svx3DTextureProjectionYItem::Clone(SfxItemPool* /*pPool*/) const
192 return new Svx3DTextureProjectionYItem(*this);
195 // Svx3DTextureKindItem: use drawing::TextureKind
196 bool Svx3DTextureKindItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
198 rVal <<= static_cast<drawing::TextureKind2>(GetValue());
199 return true;
202 bool Svx3DTextureKindItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
204 drawing::TextureKind2 eVar;
205 if (!(rVal >>= eVar))
206 return false;
207 SetValue(static_cast<sal_Int16>(eVar));
208 return true;
211 Svx3DTextureKindItem* Svx3DTextureKindItem::Clone(SfxItemPool* /*pPool*/) const
213 return new Svx3DTextureKindItem(*this);
216 // Svx3DTextureModeItem: use drawing:TextureMode
217 bool Svx3DTextureModeItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
219 rVal <<= static_cast<drawing::TextureMode>(GetValue());
220 return true;
223 bool Svx3DTextureModeItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
225 drawing::TextureMode eVar;
226 if (!(rVal >>= eVar))
227 return false;
228 SetValue(static_cast<sal_Int16>(eVar));
229 return true;
232 Svx3DTextureModeItem* Svx3DTextureModeItem::Clone(SfxItemPool* /*pPool*/) const
234 return new Svx3DTextureModeItem(*this);
237 // Svx3DPerspectiveItem: use drawing::ProjectionMode
238 bool Svx3DPerspectiveItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
240 rVal <<= static_cast<drawing::ProjectionMode>(GetValue());
241 return true;
244 bool Svx3DPerspectiveItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
246 drawing::ProjectionMode eVar;
247 if (!(rVal >>= eVar))
248 return false;
249 SetValue(static_cast<sal_Int16>(eVar));
250 return true;
253 Svx3DPerspectiveItem* Svx3DPerspectiveItem::Clone(SfxItemPool* /*pPool*/) const
255 return new Svx3DPerspectiveItem(*this);
258 // Svx3DShadeModeItem: use drawing::ShadeMode
259 bool Svx3DShadeModeItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
261 rVal <<= static_cast<drawing::ShadeMode>(GetValue());
262 return true;
265 bool Svx3DShadeModeItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
267 drawing::ShadeMode eVar;
268 if (!(rVal >>= eVar))
269 return false;
270 SetValue(static_cast<sal_Int16>(eVar));
271 return true;
274 Svx3DShadeModeItem* Svx3DShadeModeItem::Clone(SfxItemPool* /*pPool*/) const
276 return new Svx3DShadeModeItem(*this);
279 // EOF
281 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */