LibreOffice Module svx (master) 1
svx3ditems.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
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>
27
28using namespace ::com::sun::star;
29
30// #i28528#
31// Added extra Item (Bool) for chart2 to be able to show reduced line geometry
32
35{
36}
37
39{
40 return new Svx3DReducedLineGeometryItem(*this);
41}
42
43Svx3DNormalsKindItem::Svx3DNormalsKindItem(sal_uInt16 nVal)
45{
46}
47
48Svx3DTextureProjectionXItem::Svx3DTextureProjectionXItem(sal_uInt16 nVal)
50{
51}
52
53Svx3DTextureProjectionYItem::Svx3DTextureProjectionYItem(sal_uInt16 nVal)
55{
56}
57
58Svx3DTextureKindItem::Svx3DTextureKindItem(sal_uInt16 nVal)
60{
61}
62
63Svx3DTextureModeItem::Svx3DTextureModeItem(sal_uInt16 nVal)
65{
66}
67
68Svx3DPerspectiveItem::Svx3DPerspectiveItem(ProjectionType nVal)
69 : SfxUInt16Item(SDRATTR_3DSCENE_PERSPECTIVE, static_cast<sal_uInt16>(nVal))
70{
71}
72
73Svx3DShadeModeItem::Svx3DShadeModeItem(sal_uInt16 nVal)
75{
76}
77
80{
81}
82
84{
85 return new Svx3DSmoothNormalsItem(*this);
86}
87
90{
91}
92
94{
95 return new Svx3DSmoothLidsItem(*this);
96}
97
100{
101}
102
104{
105 return new Svx3DCharacterModeItem(*this);
106}
107
108Svx3DCloseFrontItem::Svx3DCloseFrontItem(bool bVal)
110{
111}
112
113Svx3DCloseFrontItem* Svx3DCloseFrontItem::Clone(SfxItemPool*) const
114{
115 return new Svx3DCloseFrontItem(*this);
116}
117
118Svx3DCloseBackItem::Svx3DCloseBackItem(bool bVal)
120{
121}
122
123Svx3DCloseBackItem* Svx3DCloseBackItem::Clone(SfxItemPool*) const
124{
125 return new Svx3DCloseBackItem(*this);
126}
127
128// Svx3DNormalsKindItem: use drawing::NormalsKind
129bool Svx3DNormalsKindItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
130{
131 rVal <<= static_cast<drawing::NormalsKind>(GetValue());
132 return true;
133}
134
135bool Svx3DNormalsKindItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
136{
137 drawing::NormalsKind eVar;
138 if (!(rVal >>= eVar))
139 return false;
140 SetValue(static_cast<sal_Int16>(eVar));
141 return true;
142}
143
144Svx3DNormalsKindItem* Svx3DNormalsKindItem::Clone(SfxItemPool* /*pPool*/) const
145{
146 return new Svx3DNormalsKindItem(*this);
147}
148
149// Svx3DTextureProjectionXItem: use drawing::TextureProjectionMode
150bool Svx3DTextureProjectionXItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
151{
152 rVal <<= static_cast<drawing::TextureProjectionMode>(GetValue());
153 return true;
154}
155
156bool Svx3DTextureProjectionXItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
157{
158 drawing::TextureProjectionMode eVar;
159 if (!(rVal >>= eVar))
160 return false;
161 SetValue(static_cast<sal_Int16>(eVar));
162 return true;
163}
164
165Svx3DTextureProjectionXItem* Svx3DTextureProjectionXItem::Clone(SfxItemPool* /*pPool*/) const
166{
167 return new Svx3DTextureProjectionXItem(*this);
168}
169
170// Svx3DTextureProjectionYItem: use drawing::TextureProjectionMode
171bool Svx3DTextureProjectionYItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
172{
173 rVal <<= static_cast<drawing::TextureProjectionMode>(GetValue());
174 return true;
175}
176
177bool Svx3DTextureProjectionYItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
178{
179 drawing::TextureProjectionMode eVar;
180 if (!(rVal >>= eVar))
181 return false;
182 SetValue(static_cast<sal_Int16>(eVar));
183 return true;
184}
185
186Svx3DTextureProjectionYItem* Svx3DTextureProjectionYItem::Clone(SfxItemPool* /*pPool*/) const
187{
188 return new Svx3DTextureProjectionYItem(*this);
189}
190
191// Svx3DTextureKindItem: use drawing::TextureKind
192bool Svx3DTextureKindItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
193{
194 rVal <<= static_cast<drawing::TextureKind>(GetValue());
195 return true;
196}
197
198bool Svx3DTextureKindItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
199{
200 drawing::TextureKind eVar;
201 if (!(rVal >>= eVar))
202 return false;
203 SetValue(static_cast<sal_Int16>(eVar));
204 return true;
205}
206
207Svx3DTextureKindItem* Svx3DTextureKindItem::Clone(SfxItemPool* /*pPool*/) const
208{
209 return new Svx3DTextureKindItem(*this);
210}
211
212// Svx3DTextureModeItem: use drawing:TextureMode
213bool Svx3DTextureModeItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
214{
215 rVal <<= static_cast<drawing::TextureMode>(GetValue());
216 return true;
217}
218
219bool Svx3DTextureModeItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
220{
221 drawing::TextureMode eVar;
222 if (!(rVal >>= eVar))
223 return false;
224 SetValue(static_cast<sal_Int16>(eVar));
225 return true;
226}
227
228Svx3DTextureModeItem* Svx3DTextureModeItem::Clone(SfxItemPool* /*pPool*/) const
229{
230 return new Svx3DTextureModeItem(*this);
231}
232
233// Svx3DPerspectiveItem: use drawing::ProjectionMode
234bool Svx3DPerspectiveItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
235{
236 rVal <<= static_cast<drawing::ProjectionMode>(GetValue());
237 return true;
238}
239
240bool Svx3DPerspectiveItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
241{
242 drawing::ProjectionMode eVar;
243 if (!(rVal >>= eVar))
244 return false;
245 SetValue(static_cast<sal_Int16>(eVar));
246 return true;
247}
248
249Svx3DPerspectiveItem* Svx3DPerspectiveItem::Clone(SfxItemPool* /*pPool*/) const
250{
251 return new Svx3DPerspectiveItem(*this);
252}
253
254// Svx3DShadeModeItem: use drawing::ShadeMode
255bool Svx3DShadeModeItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
256{
257 rVal <<= static_cast<drawing::ShadeMode>(GetValue());
258 return true;
259}
260
261bool Svx3DShadeModeItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
262{
263 drawing::ShadeMode eVar;
264 if (!(rVal >>= eVar))
265 return false;
266 SetValue(static_cast<sal_Int16>(eVar));
267 return true;
268}
269
270Svx3DShadeModeItem* Svx3DShadeModeItem::Clone(SfxItemPool* /*pPool*/) const
271{
272 return new Svx3DShadeModeItem(*this);
273}
274
275// EOF
276
277/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Svx3DCharacterModeItem * Clone(SfxItemPool *=nullptr) const override
Definition: svx3ditems.cxx:103
Svx3DCharacterModeItem(bool bVal=false)
Definition: svx3ditems.cxx:98
Svx3DReducedLineGeometryItem * Clone(SfxItemPool *=nullptr) const override
Definition: svx3ditems.cxx:38
Svx3DReducedLineGeometryItem(bool bVal=false)
Definition: svx3ditems.cxx:33
Svx3DSmoothLidsItem(bool bVal=false)
Definition: svx3ditems.cxx:88
Svx3DSmoothLidsItem * Clone(SfxItemPool *=nullptr) const override
Definition: svx3ditems.cxx:93
Svx3DSmoothNormalsItem(bool bVal=true)
Definition: svx3ditems.cxx:78
Svx3DSmoothNormalsItem * Clone(SfxItemPool *=nullptr) const override
Definition: svx3ditems.cxx:83
virtual void SetValue(tools::Long nNew) override
const char GetValue[]
constexpr TypedWhichId< Svx3DNormalsKindItem > SDRATTR_3DOBJ_NORMALS_KIND(SDRATTR_3DOBJ_FIRST+7)
constexpr TypedWhichId< Svx3DPerspectiveItem > SDRATTR_3DSCENE_PERSPECTIVE(SDRATTR_3DSCENE_FIRST+0)
constexpr TypedWhichId< Svx3DTextureModeItem > SDRATTR_3DOBJ_TEXTURE_MODE(SDRATTR_3DOBJ_FIRST+17)
constexpr TypedWhichId< Svx3DSmoothLidsItem > SDRATTR_3DOBJ_SMOOTH_LIDS(SDRATTR_3DOBJ_FIRST+20)
constexpr TypedWhichId< Svx3DCloseFrontItem > SDRATTR_3DOBJ_CLOSE_FRONT(SDRATTR_3DOBJ_FIRST+22)
constexpr TypedWhichId< Svx3DShadeModeItem > SDRATTR_3DSCENE_SHADE_MODE(SDRATTR_3DSCENE_FIRST+30)
constexpr TypedWhichId< Svx3DTextureKindItem > SDRATTR_3DOBJ_TEXTURE_KIND(SDRATTR_3DOBJ_FIRST+16)
constexpr TypedWhichId< Svx3DReducedLineGeometryItem > SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY(SDRATTR_3DOBJ_FIRST+24)
constexpr TypedWhichId< Svx3DCharacterModeItem > SDRATTR_3DOBJ_CHARACTER_MODE(SDRATTR_3DOBJ_FIRST+21)
constexpr TypedWhichId< Svx3DCloseBackItem > SDRATTR_3DOBJ_CLOSE_BACK(SDRATTR_3DOBJ_FIRST+23)
constexpr TypedWhichId< Svx3DTextureProjectionYItem > SDRATTR_3DOBJ_TEXTURE_PROJ_Y(SDRATTR_3DOBJ_FIRST+10)
constexpr TypedWhichId< Svx3DTextureProjectionXItem > SDRATTR_3DOBJ_TEXTURE_PROJ_X(SDRATTR_3DOBJ_FIRST+9)
constexpr TypedWhichId< Svx3DSmoothNormalsItem > SDRATTR_3DOBJ_SMOOTH_NORMALS(SDRATTR_3DOBJ_FIRST+19)
unsigned char sal_uInt8
ProjectionType
Definition: viewpt3d.hxx:38