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