Line data Source code
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 : #ifndef INCLUDED_SVX_SVX3DITEMS_HXX
20 : #define INCLUDED_SVX_SVX3DITEMS_HXX
21 :
22 : #include <svl/intitem.hxx>
23 : #include <svl/eitem.hxx>
24 :
25 :
26 : #include <editeng/colritem.hxx>
27 : #include <svx/e3ditem.hxx>
28 : #include <svx/viewpt3d.hxx>
29 : #include <svx/svddef.hxx>
30 : #include <svx/svxdllapi.h>
31 :
32 : // Svx3D _3DOBJ_ Items
33 321 : inline SfxUInt16Item makeSvx3DPercentDiagonalItem(sal_uInt16 nVal) {
34 321 : return SfxUInt16Item(SDRATTR_3DOBJ_PERCENT_DIAGONAL, nVal);
35 : }
36 :
37 0 : inline SfxUInt16Item makeSvx3DBackscaleItem(sal_uInt16 nVal) {
38 0 : return SfxUInt16Item(SDRATTR_3DOBJ_BACKSCALE, nVal);
39 : }
40 :
41 0 : inline SfxUInt32Item makeSvx3DDepthItem(sal_uInt32 nVal) {
42 0 : return SfxUInt32Item(SDRATTR_3DOBJ_DEPTH, nVal);
43 : }
44 :
45 0 : inline SfxUInt32Item makeSvx3DHorizontalSegmentsItem(sal_uInt32 nVal) {
46 0 : return SfxUInt32Item(SDRATTR_3DOBJ_HORZ_SEGS, nVal);
47 : }
48 :
49 756 : inline SfxUInt32Item makeSvx3DVerticalSegmentsItem(sal_uInt32 nVal) {
50 756 : return SfxUInt32Item(SDRATTR_3DOBJ_VERT_SEGS, nVal);
51 : }
52 :
53 0 : inline SfxUInt32Item makeSvx3DEndAngleItem(sal_uInt32 nVal) {
54 0 : return SfxUInt32Item(SDRATTR_3DOBJ_END_ANGLE, nVal);
55 : }
56 :
57 0 : inline SfxBoolItem makeSvx3DDoubleSidedItem(bool bVal) {
58 0 : return SfxBoolItem(SDRATTR_3DOBJ_DOUBLE_SIDED, bVal);
59 : }
60 :
61 : // #i28528#
62 : // Added extra Item (Bool) for chart2 to be able to show reduced line geometry
63 11493 : class Svx3DReducedLineGeometryItem : public SfxBoolItem {
64 : public:
65 : Svx3DReducedLineGeometryItem(bool bVal = false);
66 : virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const SAL_OVERRIDE;
67 : virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const SAL_OVERRIDE;
68 : SfxPoolItem * Clone(SfxItemPool *) const SAL_OVERRIDE;
69 : };
70 :
71 12045 : class SVX_DLLPUBLIC Svx3DNormalsKindItem : public SfxUInt16Item {
72 : public:
73 : Svx3DNormalsKindItem(sal_uInt16 nVal = 0);
74 :
75 : // use drawing::NormalsKind
76 : SVX_DLLPRIVATE virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
77 : SVX_DLLPRIVATE virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
78 : SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const SAL_OVERRIDE;
79 : };
80 :
81 0 : inline SfxBoolItem makeSvx3DNormalsInvertItem(bool bVal) {
82 0 : return SfxBoolItem(SDRATTR_3DOBJ_NORMALS_INVERT, bVal);
83 : }
84 :
85 36952 : class SVX_DLLPUBLIC Svx3DTextureProjectionXItem : public SfxUInt16Item {
86 : public:
87 : Svx3DTextureProjectionXItem(sal_uInt16 nVal = 0);
88 :
89 : // use drawing::TextureProjectionMode
90 : SVX_DLLPRIVATE virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
91 : SVX_DLLPRIVATE virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
92 : SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const SAL_OVERRIDE;
93 : };
94 :
95 38392 : class SVX_DLLPUBLIC Svx3DTextureProjectionYItem : public SfxUInt16Item {
96 : public:
97 : Svx3DTextureProjectionYItem(sal_uInt16 nVal = 0);
98 :
99 : // use drawing::TextureProjectionMode
100 : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
101 : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
102 : virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const SAL_OVERRIDE;
103 : };
104 :
105 0 : inline SfxBoolItem makeSvx3DShadow3DItem(bool bVal) {
106 0 : return SfxBoolItem(SDRATTR_3DOBJ_SHADOW_3D, bVal);
107 : }
108 :
109 0 : inline SvxColorItem makeSvx3DMaterialEmissionItem(const Color& rCol) {
110 0 : return SvxColorItem(rCol, SDRATTR_3DOBJ_MAT_EMISSION);
111 : }
112 :
113 0 : inline SvxColorItem makeSvx3DMaterialSpecularItem(const Color& rCol) {
114 0 : return SvxColorItem(rCol, SDRATTR_3DOBJ_MAT_SPECULAR);
115 : }
116 :
117 0 : inline SfxUInt16Item makeSvx3DMaterialSpecularIntensityItem(sal_uInt16 nVal) {
118 0 : return SfxUInt16Item(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY, nVal);
119 : }
120 :
121 9378 : class SVX_DLLPUBLIC Svx3DTextureKindItem : public SfxUInt16Item {
122 : public:
123 : Svx3DTextureKindItem(sal_uInt16 nVal = 3);
124 :
125 : // use drawing::TextureKind
126 : SVX_DLLPRIVATE virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
127 : SVX_DLLPRIVATE virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
128 : SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const SAL_OVERRIDE;
129 : };
130 :
131 9378 : class SVX_DLLPUBLIC Svx3DTextureModeItem : public SfxUInt16Item {
132 : public:
133 : Svx3DTextureModeItem(sal_uInt16 nVal = 2);
134 :
135 : // use drawing:TextureMode
136 : SVX_DLLPRIVATE virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
137 : SVX_DLLPRIVATE virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
138 : SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const SAL_OVERRIDE;
139 : };
140 :
141 0 : inline SfxBoolItem makeSvx3DTextureFilterItem(bool bVal) {
142 0 : return SfxBoolItem(SDRATTR_3DOBJ_TEXTURE_FILTER, bVal);
143 : }
144 :
145 : // Svx3D _3DSCENE_ Items
146 11188 : class SVX_DLLPUBLIC Svx3DPerspectiveItem : public SfxUInt16Item {
147 : public:
148 : Svx3DPerspectiveItem(sal_uInt16 nVal = (sal_uInt16)PR_PERSPECTIVE);
149 :
150 : // use drawing::ProjectionMode
151 : SVX_DLLPRIVATE virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
152 : SVX_DLLPRIVATE virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
153 : SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const SAL_OVERRIDE;
154 : };
155 :
156 1366 : inline SfxUInt32Item makeSvx3DDistanceItem(sal_uInt32 nVal) {
157 1366 : return SfxUInt32Item(SDRATTR_3DSCENE_DISTANCE, nVal);
158 : }
159 :
160 1366 : inline SfxUInt32Item makeSvx3DFocalLengthItem(sal_uInt32 nVal) {
161 1366 : return SfxUInt32Item(SDRATTR_3DSCENE_FOCAL_LENGTH, nVal);
162 : }
163 :
164 0 : inline SfxBoolItem makeSvx3DTwoSidedLightingItem(bool bVal) {
165 0 : return SfxBoolItem(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING, bVal);
166 : }
167 :
168 0 : inline SvxColorItem makeSvx3DLightcolor1Item(const Color& rCol) {
169 0 : return SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_1);
170 : }
171 :
172 0 : inline SvxColorItem makeSvx3DLightcolor2Item(const Color& rCol) {
173 0 : return SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_2);
174 : }
175 :
176 0 : inline SvxColorItem makeSvx3DLightcolor3Item(const Color& rCol) {
177 0 : return SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_3);
178 : }
179 :
180 0 : inline SvxColorItem makeSvx3DLightcolor4Item(const Color& rCol) {
181 0 : return SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_4);
182 : }
183 :
184 0 : inline SvxColorItem makeSvx3DLightcolor5Item(const Color& rCol) {
185 0 : return SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_5);
186 : }
187 :
188 0 : inline SvxColorItem makeSvx3DLightcolor6Item(const Color& rCol) {
189 0 : return SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_6);
190 : }
191 :
192 0 : inline SvxColorItem makeSvx3DLightcolor7Item(const Color& rCol) {
193 0 : return SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_7);
194 : }
195 :
196 0 : inline SvxColorItem makeSvx3DLightcolor8Item(const Color& rCol) {
197 0 : return SvxColorItem(rCol, SDRATTR_3DSCENE_LIGHTCOLOR_8);
198 : }
199 :
200 0 : inline SvxColorItem makeSvx3DAmbientcolorItem(const Color& rCol) {
201 0 : return SvxColorItem(rCol, SDRATTR_3DSCENE_AMBIENTCOLOR);
202 : }
203 :
204 0 : inline SfxBoolItem makeSvx3DLightOnOff1Item(bool bVal) {
205 0 : return SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_1, bVal);
206 : }
207 :
208 0 : inline SfxBoolItem makeSvx3DLightOnOff2Item(bool bVal) {
209 0 : return SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_2, bVal);
210 : }
211 :
212 0 : inline SfxBoolItem makeSvx3DLightOnOff3Item(bool bVal) {
213 0 : return SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_3, bVal);
214 : }
215 :
216 0 : inline SfxBoolItem makeSvx3DLightOnOff4Item(bool bVal) {
217 0 : return SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_4, bVal);
218 : }
219 :
220 0 : inline SfxBoolItem makeSvx3DLightOnOff5Item(bool bVal) {
221 0 : return SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_5, bVal);
222 : }
223 :
224 0 : inline SfxBoolItem makeSvx3DLightOnOff6Item(bool bVal) {
225 0 : return SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_6, bVal);
226 : }
227 :
228 0 : inline SfxBoolItem makeSvx3DLightOnOff7Item(bool bVal) {
229 0 : return SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_7, bVal);
230 : }
231 :
232 0 : inline SfxBoolItem makeSvx3DLightOnOff8Item(bool bVal) {
233 0 : return SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_8, bVal);
234 : }
235 :
236 0 : inline SvxB3DVectorItem makeSvx3DLightDirection1Item(const basegfx::B3DVector& rVec) {
237 0 : return SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_1, rVec);
238 : }
239 :
240 0 : inline SvxB3DVectorItem makeSvx3DLightDirection2Item(const basegfx::B3DVector& rVec) {
241 0 : return SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_2, rVec);
242 : }
243 :
244 0 : inline SvxB3DVectorItem makeSvx3DLightDirection3Item(const basegfx::B3DVector& rVec) {
245 0 : return SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_3, rVec);
246 : }
247 :
248 0 : inline SvxB3DVectorItem makeSvx3DLightDirection4Item(const basegfx::B3DVector& rVec) {
249 0 : return SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_4, rVec);
250 : }
251 :
252 0 : inline SvxB3DVectorItem makeSvx3DLightDirection5Item(const basegfx::B3DVector& rVec) {
253 0 : return SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_5, rVec);
254 : }
255 :
256 0 : inline SvxB3DVectorItem makeSvx3DLightDirection6Item(const basegfx::B3DVector& rVec) {
257 0 : return SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_6, rVec);
258 : }
259 :
260 0 : inline SvxB3DVectorItem makeSvx3DLightDirection7Item(const basegfx::B3DVector& rVec) {
261 0 : return SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_7, rVec);
262 : }
263 :
264 0 : inline SvxB3DVectorItem makeSvx3DLightDirection8Item(const basegfx::B3DVector& rVec) {
265 0 : return SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_8, rVec);
266 : }
267 :
268 0 : inline SfxUInt16Item makeSvx3DShadowSlantItem(sal_uInt16 nVal) {
269 0 : return SfxUInt16Item(SDRATTR_3DSCENE_SHADOW_SLANT, nVal);
270 : }
271 :
272 9834 : class SVX_DLLPUBLIC Svx3DShadeModeItem : public SfxUInt16Item {
273 : public:
274 : Svx3DShadeModeItem(sal_uInt16 nVal = 2);
275 :
276 : // use drawing::ShadeMode
277 : SVX_DLLPRIVATE virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
278 : SVX_DLLPRIVATE virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
279 : SVX_DLLPRIVATE virtual SfxPoolItem* Clone(SfxItemPool* pPool = NULL) const SAL_OVERRIDE;
280 : };
281 :
282 :
283 : // #107245# Item to replace bExtrudeSmoothed and bLatheSmoothed
284 37591 : class Svx3DSmoothNormalsItem : public SfxBoolItem {
285 : public:
286 : Svx3DSmoothNormalsItem(bool bVal = true);
287 : virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const SAL_OVERRIDE;
288 : virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const SAL_OVERRIDE;
289 : SfxPoolItem * Clone(SfxItemPool *) const SAL_OVERRIDE;
290 : };
291 :
292 : // #107245# Item to replace bExtrudeSmoothFrontBack and bLatheSmoothFrontBack
293 37591 : class Svx3DSmoothLidsItem : public SfxBoolItem {
294 : public:
295 : Svx3DSmoothLidsItem(bool bVal = false);
296 : virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const SAL_OVERRIDE;
297 : virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const SAL_OVERRIDE;
298 : SfxPoolItem * Clone(SfxItemPool *) const SAL_OVERRIDE;
299 : };
300 :
301 : // #107245# Item to replace bExtrudeCharacterMode and bLatheCharacterMode
302 55271 : class Svx3DCharacterModeItem : public SfxBoolItem {
303 : public:
304 : Svx3DCharacterModeItem(bool bVal = false);
305 : virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const SAL_OVERRIDE;
306 : virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const SAL_OVERRIDE;
307 : SfxPoolItem * Clone(SfxItemPool *) const SAL_OVERRIDE;
308 : };
309 :
310 : // #107245# Item to replace bExtrudeCloseFront and bLatheCloseFront
311 37591 : class SVX_DLLPUBLIC Svx3DCloseFrontItem : public SfxBoolItem {
312 : public:
313 : Svx3DCloseFrontItem(bool bVal = true);
314 : SVX_DLLPRIVATE virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const SAL_OVERRIDE;
315 : SVX_DLLPRIVATE virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const SAL_OVERRIDE;
316 : SfxPoolItem * Clone(SfxItemPool *) const SAL_OVERRIDE;
317 : };
318 :
319 : // #107245# Item to replace bExtrudeCloseBack and bLatheCloseBack
320 37591 : class SVX_DLLPUBLIC Svx3DCloseBackItem : public SfxBoolItem {
321 : public:
322 : Svx3DCloseBackItem(bool bVal = true);
323 : SVX_DLLPRIVATE virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nItemVersion) const SAL_OVERRIDE;
324 : SVX_DLLPRIVATE virtual sal_uInt16 GetVersion(sal_uInt16 nFileFormatVersion) const SAL_OVERRIDE;
325 : SfxPoolItem * Clone(SfxItemPool *) const SAL_OVERRIDE;
326 : };
327 :
328 : #endif // INCLUDED_SVX_SVX3DITEMS_HXX
329 :
330 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|