/src/libreoffice/svx/source/engine3d/svx3ditems.cxx
Line | Count | Source |
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/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> |
27 | | |
28 | | using namespace ::com::sun::star; |
29 | | |
30 | | // #i28528# |
31 | | // Added extra Item (Bool) for chart2 to be able to show reduced line geometry |
32 | | |
33 | | Svx3DReducedLineGeometryItem::Svx3DReducedLineGeometryItem(bool bVal) |
34 | 19 | : SfxBoolItem(SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY, bVal) |
35 | 19 | { |
36 | 19 | } |
37 | | |
38 | | Svx3DReducedLineGeometryItem* Svx3DReducedLineGeometryItem::Clone(SfxItemPool*) const |
39 | 0 | { |
40 | 0 | return new Svx3DReducedLineGeometryItem(*this); |
41 | 0 | } |
42 | | |
43 | | Svx3DNormalsKindItem::Svx3DNormalsKindItem(sal_uInt16 nVal) |
44 | 3.44k | : SfxUInt16Item(SDRATTR_3DOBJ_NORMALS_KIND, nVal) |
45 | 3.44k | { |
46 | 3.44k | } |
47 | | |
48 | | Svx3DTextureProjectionXItem::Svx3DTextureProjectionXItem(sal_uInt16 nVal) |
49 | 12.9k | : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_PROJ_X, nVal) |
50 | 12.9k | { |
51 | 12.9k | } |
52 | | |
53 | | Svx3DTextureProjectionYItem::Svx3DTextureProjectionYItem(sal_uInt16 nVal) |
54 | 12.9k | : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_PROJ_Y, nVal) |
55 | 12.9k | { |
56 | 12.9k | } |
57 | | |
58 | | Svx3DTextureKindItem::Svx3DTextureKindItem(sal_uInt16 nVal) |
59 | 19 | : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_KIND, nVal) |
60 | 19 | { |
61 | 19 | } |
62 | | |
63 | | Svx3DTextureModeItem::Svx3DTextureModeItem(sal_uInt16 nVal) |
64 | 3.44k | : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_MODE, nVal) |
65 | 3.44k | { |
66 | 3.44k | } |
67 | | |
68 | | Svx3DPerspectiveItem::Svx3DPerspectiveItem(ProjectionType nVal) |
69 | 6.86k | : SfxUInt16Item(SDRATTR_3DSCENE_PERSPECTIVE, static_cast<sal_uInt16>(nVal)) |
70 | 6.86k | { |
71 | 6.86k | } |
72 | | |
73 | | Svx3DShadeModeItem::Svx3DShadeModeItem(sal_uInt16 nVal) |
74 | 3.44k | : SfxUInt16Item(SDRATTR_3DSCENE_SHADE_MODE, nVal) |
75 | 3.44k | { |
76 | 3.44k | } |
77 | | |
78 | | Svx3DSmoothNormalsItem::Svx3DSmoothNormalsItem(bool bVal) |
79 | 12.9k | : SfxBoolItem(SDRATTR_3DOBJ_SMOOTH_NORMALS, bVal) |
80 | 12.9k | { |
81 | 12.9k | } |
82 | | |
83 | | Svx3DSmoothNormalsItem* Svx3DSmoothNormalsItem::Clone(SfxItemPool*) const |
84 | 9.20k | { |
85 | 9.20k | return new Svx3DSmoothNormalsItem(*this); |
86 | 9.20k | } |
87 | | |
88 | | Svx3DSmoothLidsItem::Svx3DSmoothLidsItem(bool bVal) |
89 | 12.9k | : SfxBoolItem(SDRATTR_3DOBJ_SMOOTH_LIDS, bVal) |
90 | 12.9k | { |
91 | 12.9k | } |
92 | | |
93 | | Svx3DSmoothLidsItem* Svx3DSmoothLidsItem::Clone(SfxItemPool*) const |
94 | 9.20k | { |
95 | 9.20k | return new Svx3DSmoothLidsItem(*this); |
96 | 9.20k | } |
97 | | |
98 | | Svx3DCharacterModeItem::Svx3DCharacterModeItem(bool bVal) |
99 | 12.9k | : SfxBoolItem(SDRATTR_3DOBJ_CHARACTER_MODE, bVal) |
100 | 12.9k | { |
101 | 12.9k | } |
102 | | |
103 | | Svx3DCharacterModeItem* Svx3DCharacterModeItem::Clone(SfxItemPool*) const |
104 | 9.20k | { |
105 | 9.20k | return new Svx3DCharacterModeItem(*this); |
106 | 9.20k | } |
107 | | |
108 | | Svx3DCloseFrontItem::Svx3DCloseFrontItem(bool bVal) |
109 | 16.1k | : SfxBoolItem(SDRATTR_3DOBJ_CLOSE_FRONT, bVal) |
110 | 16.1k | { |
111 | 16.1k | } |
112 | | |
113 | | Svx3DCloseFrontItem* Svx3DCloseFrontItem::Clone(SfxItemPool*) const |
114 | 12.1k | { |
115 | 12.1k | return new Svx3DCloseFrontItem(*this); |
116 | 12.1k | } |
117 | | |
118 | | Svx3DCloseBackItem::Svx3DCloseBackItem(bool bVal) |
119 | 16.1k | : SfxBoolItem(SDRATTR_3DOBJ_CLOSE_BACK, bVal) |
120 | 16.1k | { |
121 | 16.1k | } |
122 | | |
123 | | Svx3DCloseBackItem* Svx3DCloseBackItem::Clone(SfxItemPool*) const |
124 | 12.1k | { |
125 | 12.1k | return new Svx3DCloseBackItem(*this); |
126 | 12.1k | } |
127 | | |
128 | | // Svx3DNormalsKindItem: use drawing::NormalsKind |
129 | | bool Svx3DNormalsKindItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const |
130 | 0 | { |
131 | 0 | rVal <<= static_cast<drawing::NormalsKind>(GetValue()); |
132 | 0 | return true; |
133 | 0 | } |
134 | | |
135 | | bool Svx3DNormalsKindItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/) |
136 | 0 | { |
137 | 0 | drawing::NormalsKind eVar; |
138 | 0 | if (!(rVal >>= eVar)) |
139 | 0 | return false; |
140 | 0 | SetValue(static_cast<sal_Int16>(eVar)); |
141 | 0 | return true; |
142 | 0 | } |
143 | | |
144 | | Svx3DNormalsKindItem* Svx3DNormalsKindItem::Clone(SfxItemPool* /*pPool*/) const |
145 | 3.42k | { |
146 | 3.42k | return new Svx3DNormalsKindItem(*this); |
147 | 3.42k | } |
148 | | |
149 | | // Svx3DTextureProjectionXItem: use drawing::TextureProjectionMode |
150 | | bool Svx3DTextureProjectionXItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const |
151 | 0 | { |
152 | 0 | rVal <<= static_cast<drawing::TextureProjectionMode>(GetValue()); |
153 | 0 | return true; |
154 | 0 | } |
155 | | |
156 | | bool Svx3DTextureProjectionXItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/) |
157 | 0 | { |
158 | 0 | drawing::TextureProjectionMode eVar; |
159 | 0 | if (!(rVal >>= eVar)) |
160 | 0 | return false; |
161 | 0 | SetValue(static_cast<sal_Int16>(eVar)); |
162 | 0 | return true; |
163 | 0 | } |
164 | | |
165 | | Svx3DTextureProjectionXItem* Svx3DTextureProjectionXItem::Clone(SfxItemPool* /*pPool*/) const |
166 | 9.20k | { |
167 | 9.20k | return new Svx3DTextureProjectionXItem(*this); |
168 | 9.20k | } |
169 | | |
170 | | // Svx3DTextureProjectionYItem: use drawing::TextureProjectionMode |
171 | | bool Svx3DTextureProjectionYItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const |
172 | 0 | { |
173 | 0 | rVal <<= static_cast<drawing::TextureProjectionMode>(GetValue()); |
174 | 0 | return true; |
175 | 0 | } |
176 | | |
177 | | bool Svx3DTextureProjectionYItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/) |
178 | 0 | { |
179 | 0 | drawing::TextureProjectionMode eVar; |
180 | 0 | if (!(rVal >>= eVar)) |
181 | 0 | return false; |
182 | 0 | SetValue(static_cast<sal_Int16>(eVar)); |
183 | 0 | return true; |
184 | 0 | } |
185 | | |
186 | | Svx3DTextureProjectionYItem* Svx3DTextureProjectionYItem::Clone(SfxItemPool* /*pPool*/) const |
187 | 9.20k | { |
188 | 9.20k | return new Svx3DTextureProjectionYItem(*this); |
189 | 9.20k | } |
190 | | |
191 | | // Svx3DTextureKindItem: use drawing::TextureKind |
192 | | bool Svx3DTextureKindItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const |
193 | 0 | { |
194 | 0 | rVal <<= static_cast<drawing::TextureKind2>(GetValue()); |
195 | 0 | return true; |
196 | 0 | } |
197 | | |
198 | | bool Svx3DTextureKindItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/) |
199 | 0 | { |
200 | 0 | drawing::TextureKind2 eVar; |
201 | 0 | if (!(rVal >>= eVar)) |
202 | 0 | return false; |
203 | 0 | SetValue(static_cast<sal_Int16>(eVar)); |
204 | 0 | return true; |
205 | 0 | } |
206 | | |
207 | | Svx3DTextureKindItem* Svx3DTextureKindItem::Clone(SfxItemPool* /*pPool*/) const |
208 | 0 | { |
209 | 0 | return new Svx3DTextureKindItem(*this); |
210 | 0 | } |
211 | | |
212 | | // Svx3DTextureModeItem: use drawing:TextureMode |
213 | | bool Svx3DTextureModeItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const |
214 | 0 | { |
215 | 0 | rVal <<= static_cast<drawing::TextureMode>(GetValue()); |
216 | 0 | return true; |
217 | 0 | } |
218 | | |
219 | | bool Svx3DTextureModeItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/) |
220 | 0 | { |
221 | 0 | drawing::TextureMode eVar; |
222 | 0 | if (!(rVal >>= eVar)) |
223 | 0 | return false; |
224 | 0 | SetValue(static_cast<sal_Int16>(eVar)); |
225 | 0 | return true; |
226 | 0 | } |
227 | | |
228 | | Svx3DTextureModeItem* Svx3DTextureModeItem::Clone(SfxItemPool* /*pPool*/) const |
229 | 3.42k | { |
230 | 3.42k | return new Svx3DTextureModeItem(*this); |
231 | 3.42k | } |
232 | | |
233 | | // Svx3DPerspectiveItem: use drawing::ProjectionMode |
234 | | bool Svx3DPerspectiveItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const |
235 | 0 | { |
236 | 0 | rVal <<= static_cast<drawing::ProjectionMode>(GetValue()); |
237 | 0 | return true; |
238 | 0 | } |
239 | | |
240 | | bool Svx3DPerspectiveItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/) |
241 | 0 | { |
242 | 0 | drawing::ProjectionMode eVar; |
243 | 0 | if (!(rVal >>= eVar)) |
244 | 0 | return false; |
245 | 0 | SetValue(static_cast<sal_Int16>(eVar)); |
246 | 0 | return true; |
247 | 0 | } |
248 | | |
249 | | Svx3DPerspectiveItem* Svx3DPerspectiveItem::Clone(SfxItemPool* /*pPool*/) const |
250 | 3.42k | { |
251 | 3.42k | return new Svx3DPerspectiveItem(*this); |
252 | 3.42k | } |
253 | | |
254 | | // Svx3DShadeModeItem: use drawing::ShadeMode |
255 | | bool Svx3DShadeModeItem::QueryValue(uno::Any& rVal, sal_uInt8 /*nMemberId*/) const |
256 | 0 | { |
257 | 0 | rVal <<= static_cast<drawing::ShadeMode>(GetValue()); |
258 | 0 | return true; |
259 | 0 | } |
260 | | |
261 | | bool Svx3DShadeModeItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/) |
262 | 0 | { |
263 | 0 | drawing::ShadeMode eVar; |
264 | 0 | if (!(rVal >>= eVar)) |
265 | 0 | return false; |
266 | 0 | SetValue(static_cast<sal_Int16>(eVar)); |
267 | 0 | return true; |
268 | 0 | } |
269 | | |
270 | | Svx3DShadeModeItem* Svx3DShadeModeItem::Clone(SfxItemPool* /*pPool*/) const |
271 | 3.42k | { |
272 | 3.42k | return new Svx3DShadeModeItem(*this); |
273 | 3.42k | } |
274 | | |
275 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |