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 
43 Svx3DNormalsKindItem::Svx3DNormalsKindItem(sal_uInt16 nVal)
45 {}
46 
47 Svx3DTextureProjectionXItem::Svx3DTextureProjectionXItem(sal_uInt16 nVal)
49 {}
50 
51 Svx3DTextureProjectionYItem::Svx3DTextureProjectionYItem(sal_uInt16 nVal)
53 {}
54 
55 Svx3DTextureKindItem::Svx3DTextureKindItem(sal_uInt16 nVal)
57 {}
58 
59 Svx3DTextureModeItem::Svx3DTextureModeItem(sal_uInt16 nVal)
61 {}
62 
63 Svx3DPerspectiveItem::Svx3DPerspectiveItem(ProjectionType nVal)
64 : SfxUInt16Item(SDRATTR_3DSCENE_PERSPECTIVE, static_cast<sal_uInt16>(nVal))
65 {}
66 
67 Svx3DShadeModeItem::Svx3DShadeModeItem(sal_uInt16 nVal)
69 {}
70 
71 
74 {}
75 
77 {
78  return new Svx3DSmoothNormalsItem(*this);
79 }
80 
83 {}
84 
86 {
87  return new Svx3DSmoothLidsItem(*this);
88 }
89 
92 {}
93 
95 {
96  return new Svx3DCharacterModeItem(*this);
97 }
98 
99 Svx3DCloseFrontItem::Svx3DCloseFrontItem(bool bVal)
101 {}
102 
103 Svx3DCloseFrontItem* Svx3DCloseFrontItem::Clone(SfxItemPool *) const
104 {
105  return new Svx3DCloseFrontItem(*this);
106 }
107 
108 Svx3DCloseBackItem::Svx3DCloseBackItem(bool bVal)
110 {}
111 
112 Svx3DCloseBackItem* Svx3DCloseBackItem::Clone(SfxItemPool *) const
113 {
114  return new Svx3DCloseBackItem(*this);
115 }
116 
117 // Svx3DNormalsKindItem: use drawing::NormalsKind
118 bool Svx3DNormalsKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
119 {
120  rVal <<= static_cast<drawing::NormalsKind>(GetValue());
121  return true;
122 }
123 
124 bool Svx3DNormalsKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
125 {
126  drawing::NormalsKind eVar;
127  if(!(rVal >>= eVar))
128  return false;
129  SetValue(static_cast<sal_Int16>(eVar));
130  return true;
131 }
132 
133 Svx3DNormalsKindItem* Svx3DNormalsKindItem::Clone(SfxItemPool* /*pPool*/) const
134 {
135  return new Svx3DNormalsKindItem(*this);
136 }
137 
138 // Svx3DTextureProjectionXItem: use drawing::TextureProjectionMode
139 bool Svx3DTextureProjectionXItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
140 {
141  rVal <<= static_cast<drawing::TextureProjectionMode>(GetValue());
142  return true;
143 }
144 
145 bool Svx3DTextureProjectionXItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
146 {
147  drawing::TextureProjectionMode eVar;
148  if(!(rVal >>= eVar))
149  return false;
150  SetValue(static_cast<sal_Int16>(eVar));
151  return true;
152 }
153 
154 Svx3DTextureProjectionXItem* Svx3DTextureProjectionXItem::Clone(SfxItemPool* /*pPool*/) const
155 {
156  return new Svx3DTextureProjectionXItem(*this);
157 }
158 
159 // Svx3DTextureProjectionYItem: use drawing::TextureProjectionMode
160 bool Svx3DTextureProjectionYItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
161 {
162  rVal <<= static_cast<drawing::TextureProjectionMode>(GetValue());
163  return true;
164 }
165 
166 bool Svx3DTextureProjectionYItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
167 {
168  drawing::TextureProjectionMode eVar;
169  if(!(rVal >>= eVar))
170  return false;
171  SetValue(static_cast<sal_Int16>(eVar));
172  return true;
173 }
174 
175 Svx3DTextureProjectionYItem* Svx3DTextureProjectionYItem::Clone(SfxItemPool* /*pPool*/) const
176 {
177  return new Svx3DTextureProjectionYItem(*this);
178 }
179 
180 // Svx3DTextureKindItem: use drawing::TextureKind
181 bool Svx3DTextureKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
182 {
183  rVal <<= static_cast<drawing::TextureKind>(GetValue());
184  return true;
185 }
186 
187 bool Svx3DTextureKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
188 {
189  drawing::TextureKind eVar;
190  if(!(rVal >>= eVar))
191  return false;
192  SetValue(static_cast<sal_Int16>(eVar));
193  return true;
194 }
195 
196 Svx3DTextureKindItem* Svx3DTextureKindItem::Clone(SfxItemPool* /*pPool*/) const
197 {
198  return new Svx3DTextureKindItem(*this);
199 }
200 
201 // Svx3DTextureModeItem: use drawing:TextureMode
202 bool Svx3DTextureModeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
203 {
204  rVal <<= static_cast<drawing::TextureMode>(GetValue());
205  return true;
206 }
207 
208 bool Svx3DTextureModeItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
209 {
210  drawing::TextureMode eVar;
211  if(!(rVal >>= eVar))
212  return false;
213  SetValue(static_cast<sal_Int16>(eVar));
214  return true;
215 }
216 
217 Svx3DTextureModeItem* Svx3DTextureModeItem::Clone(SfxItemPool* /*pPool*/) const
218 {
219  return new Svx3DTextureModeItem(*this);
220 }
221 
222 // Svx3DPerspectiveItem: use drawing::ProjectionMode
223 bool Svx3DPerspectiveItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
224 {
225  rVal <<= static_cast<drawing::ProjectionMode>(GetValue());
226  return true;
227 }
228 
229 bool Svx3DPerspectiveItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
230 {
231  drawing::ProjectionMode eVar;
232  if(!(rVal >>= eVar))
233  return false;
234  SetValue(static_cast<sal_Int16>(eVar));
235  return true;
236 }
237 
238 Svx3DPerspectiveItem* Svx3DPerspectiveItem::Clone(SfxItemPool* /*pPool*/) const
239 {
240  return new Svx3DPerspectiveItem(*this);
241 }
242 
243 // Svx3DShadeModeItem: use drawing::ShadeMode
244 bool Svx3DShadeModeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
245 {
246  rVal <<= static_cast<drawing::ShadeMode>(GetValue());
247  return true;
248 }
249 
250 bool Svx3DShadeModeItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
251 {
252  drawing::ShadeMode eVar;
253  if(!(rVal >>= eVar))
254  return false;
255  SetValue(static_cast<sal_Int16>(eVar));
256  return true;
257 }
258 
259 Svx3DShadeModeItem* Svx3DShadeModeItem::Clone(SfxItemPool* /*pPool*/) const
260 {
261  return new Svx3DShadeModeItem(*this);
262 }
263 
264 // EOF
265 
266 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Svx3DReducedLineGeometryItem(bool bVal=false)
Definition: svx3ditems.cxx:34
constexpr TypedWhichId< Svx3DTextureKindItem > SDRATTR_3DOBJ_TEXTURE_KIND(SDRATTR_3DOBJ_FIRST+16)
constexpr TypedWhichId< Svx3DTextureProjectionXItem > SDRATTR_3DOBJ_TEXTURE_PROJ_X(SDRATTR_3DOBJ_FIRST+9)
std::string GetValue
Svx3DCharacterModeItem(bool bVal=false)
Definition: svx3ditems.cxx:90
ProjectionType
Definition: viewpt3d.hxx:38
constexpr TypedWhichId< Svx3DSmoothNormalsItem > SDRATTR_3DOBJ_SMOOTH_NORMALS(SDRATTR_3DOBJ_FIRST+19)
Svx3DSmoothNormalsItem * Clone(SfxItemPool *=nullptr) const override
Definition: svx3ditems.cxx:76
Svx3DReducedLineGeometryItem * Clone(SfxItemPool *=nullptr) const override
Definition: svx3ditems.cxx:38
Svx3DCharacterModeItem * Clone(SfxItemPool *=nullptr) const override
Definition: svx3ditems.cxx:94
constexpr TypedWhichId< Svx3DTextureModeItem > SDRATTR_3DOBJ_TEXTURE_MODE(SDRATTR_3DOBJ_FIRST+17)
constexpr TypedWhichId< Svx3DCharacterModeItem > SDRATTR_3DOBJ_CHARACTER_MODE(SDRATTR_3DOBJ_FIRST+21)
constexpr TypedWhichId< Svx3DReducedLineGeometryItem > SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY(SDRATTR_3DOBJ_FIRST+24)
Svx3DSmoothLidsItem * Clone(SfxItemPool *=nullptr) const override
Definition: svx3ditems.cxx:85
constexpr TypedWhichId< Svx3DPerspectiveItem > SDRATTR_3DSCENE_PERSPECTIVE(SDRATTR_3DSCENE_FIRST+0)
constexpr TypedWhichId< Svx3DSmoothLidsItem > SDRATTR_3DOBJ_SMOOTH_LIDS(SDRATTR_3DOBJ_FIRST+20)
Svx3DSmoothNormalsItem(bool bVal=true)
Definition: svx3ditems.cxx:72
constexpr TypedWhichId< Svx3DCloseBackItem > SDRATTR_3DOBJ_CLOSE_BACK(SDRATTR_3DOBJ_FIRST+23)
unsigned char sal_uInt8
constexpr TypedWhichId< Svx3DShadeModeItem > SDRATTR_3DSCENE_SHADE_MODE(SDRATTR_3DSCENE_FIRST+30)
constexpr TypedWhichId< Svx3DNormalsKindItem > SDRATTR_3DOBJ_NORMALS_KIND(SDRATTR_3DOBJ_FIRST+7)
Svx3DSmoothLidsItem(bool bVal=false)
Definition: svx3ditems.cxx:81
constexpr TypedWhichId< Svx3DCloseFrontItem > SDRATTR_3DOBJ_CLOSE_FRONT(SDRATTR_3DOBJ_FIRST+22)
constexpr TypedWhichId< Svx3DTextureProjectionYItem > SDRATTR_3DOBJ_TEXTURE_PROJ_Y(SDRATTR_3DOBJ_FIRST+10)