xref: /trunk/main/xmloff/source/draw/sdpropls.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _SDPROPLS_HXX
29 #define _SDPROPLS_HXX
30 
31 #include <com/sun/star/frame/XModel.hpp>
32 #include <xmloff/xmlnume.hxx>
33 #include <xmloff/maptype.hxx>
34 #include <xmloff/xmltypes.hxx>
35 #include <xmloff/xmlement.hxx>
36 #include <xmloff/prhdlfac.hxx>
37 #include <xmloff/xmlprmap.hxx>
38 #include "xmloff/XMLTextListAutoStylePool.hxx"
39 #include <xmloff/xmlexppr.hxx>
40 
41 //////////////////////////////////////////////////////////////////////////////
42 // entry list for graphic properties
43 
44 extern const XMLPropertyMapEntry aXMLSDProperties[];
45 
46 //////////////////////////////////////////////////////////////////////////////
47 // entry list for presentation page properties
48 
49 extern const XMLPropertyMapEntry aXMLSDPresPageProps[];
50 extern const XMLPropertyMapEntry aXMLSDPresPageProps_onlyHeadersFooter[];
51 
52 //////////////////////////////////////////////////////////////////////////////
53 // types of own properties
54 
55 #define	XML_SD_TYPE_STROKE							(XML_SD_TYPES_START +  0)
56 #define	XML_SD_TYPE_PRESPAGE_TYPE					(XML_SD_TYPES_START +  1)
57 #define	XML_SD_TYPE_PRESPAGE_STYLE					(XML_SD_TYPES_START +  2)
58 #define	XML_SD_TYPE_PRESPAGE_SPEED					(XML_SD_TYPES_START +  3)
59 #define	XML_SD_TYPE_PRESPAGE_DURATION				(XML_SD_TYPES_START +  4)
60 #define	XML_SD_TYPE_PRESPAGE_VISIBILITY				(XML_SD_TYPES_START +  5)
61 #define XML_SD_TYPE_MARKER							(XML_SD_TYPES_START +  6 )
62 #define XML_SD_TYPE_OPACITY							(XML_SD_TYPES_START +  7 )
63 #define XML_SD_TYPE_LINEJOIN						(XML_SD_TYPES_START +  8 )
64 #define XML_SD_TYPE_FILLSTYLE						(XML_SD_TYPES_START +  9 )
65 #define XML_SD_TYPE_GRADIENT						(XML_SD_TYPES_START + 10 )
66 #define XML_SD_TYPE_GRADIENT_STEPCOUNT				(XML_SD_TYPES_START + 11 )
67 #define XML_SD_TYPE_SHADOW							(XML_SD_TYPES_START + 12 )
68 #define XML_SD_TYPE_TEXT_CROSSEDOUT					(XML_SD_TYPES_START + 13 )
69 #define XML_SD_TYPE_NUMBULLET						(XML_SD_TYPES_START + 14 )
70 #define XML_SD_TYPE_WRITINGMODE						(XML_SD_TYPES_START + 15 )
71 #define XML_SD_TYPE_BITMAP_MODE						(XML_SD_TYPES_START + 16 )
72 #define XML_SD_TYPE_BITMAPREPOFFSETX				(XML_SD_TYPES_START + 17 )
73 #define XML_SD_TYPE_BITMAPREPOFFSETY				(XML_SD_TYPES_START + 18 )
74 #define XML_SD_TYPE_FILLBITMAPSIZE					(XML_SD_TYPES_START + 19 )
75 #define XML_SD_TYPE_LOGICAL_SIZE					(XML_SD_TYPES_START + 20 )
76 #define XML_SD_TYPE_BITMAP_REFPOINT					(XML_SD_TYPES_START + 21 )
77 #define XML_SD_TYPE_PRESPAGE_BACKSIZE				(XML_SD_TYPES_START + 22 )
78 #define XML_TYPE_TEXT_ANIMATION_BLINKING			(XML_SD_TYPES_START + 23 )
79 #define XML_TYPE_TEXT_ANIMATION_STEPS				(XML_SD_TYPES_START + 24 )
80 #define XML_SD_TYPE_TEXT_ALIGN						(XML_SD_TYPES_START + 25 )
81 #define XML_SD_TYPE_VERTICAL_ALIGN					(XML_SD_TYPES_START + 26 )
82 #define XML_SD_TYPE_FITTOSIZE						(XML_SD_TYPES_START + 27 )
83 #define XML_SD_TYPE_MEASURE_HALIGN					(XML_SD_TYPES_START + 28 )
84 #define XML_SD_TYPE_MEASURE_VALIGN					(XML_SD_TYPES_START + 29 )
85 #define XML_SD_TYPE_MEASURE_UNIT					(XML_SD_TYPES_START + 30 )
86 #define XML_SD_TYPE_MEASURE_PLACING					(XML_SD_TYPES_START + 31 )
87 #define XML_SD_TYPE_CONTROL_BORDER					(XML_SD_TYPES_START + 32 )
88 #define XML_SD_TYPE_CONTROL_BORDER_COLOR            (XML_SD_TYPES_START + 33 )
89 #define XML_SD_TYPE_IMAGE_SCALE_MODE                (XML_SD_TYPES_START + 34 )
90 
91 // 3D property types
92 #define XML_SD_TYPE_BACKFACE_CULLING				(XML_SD_TYPES_START + 40 )
93 #define XML_SD_TYPE_NORMALS_KIND					(XML_SD_TYPES_START + 41 )
94 #define XML_SD_TYPE_NORMALS_DIRECTION				(XML_SD_TYPES_START + 42 )
95 #define XML_SD_TYPE_TEX_GENERATION_MODE_X			(XML_SD_TYPES_START + 43 )
96 #define XML_SD_TYPE_TEX_GENERATION_MODE_Y			(XML_SD_TYPES_START + 44 )
97 #define XML_SD_TYPE_TEX_KIND						(XML_SD_TYPES_START + 45 )
98 #define XML_SD_TYPE_TEX_MODE						(XML_SD_TYPES_START + 46 )
99 
100 //////////////////////////////////////////////////////////////////////////////
101 // #FontWork# types
102 #define	XML_SD_TYPE_FONTWORK_STYLE					(XML_SD_TYPES_START + 47 )
103 #define	XML_SD_TYPE_FONTWORK_ADJUST					(XML_SD_TYPES_START + 48 )
104 #define	XML_SD_TYPE_FONTWORK_SHADOW					(XML_SD_TYPES_START + 49 )
105 #define	XML_SD_TYPE_FONTWORK_FORM					(XML_SD_TYPES_START + 50 )
106 
107 //////////////////////////////////////////////////////////////////////////////
108 // Caption types
109 #define XML_SD_TYPE_CAPTION_ANGLE_TYPE				(XML_SD_TYPES_START + 60 )
110 #define XML_SD_TYPE_CAPTION_IS_ESC_REL				(XML_SD_TYPES_START + 61 )
111 #define XML_SD_TYPE_CAPTION_ESC_REL					(XML_SD_TYPES_START + 62 )
112 #define XML_SD_TYPE_CAPTION_ESC_ABS					(XML_SD_TYPES_START + 63 )
113 #define XML_SD_TYPE_CAPTION_ESC_DIR					(XML_SD_TYPES_START + 64 )
114 #define XML_SD_TYPE_CAPTION_TYPE					(XML_SD_TYPES_START + 65 )
115 
116 //////////////////////////////////////////////////////////////////////////////
117 // header & footer types
118 #define XML_SD_TYPE_DATETIMEUPDATE					(XML_SD_TYPES_START + 70 )
119 #define XML_SD_TYPE_DATETIME_FORMAT					(XML_SD_TYPES_START + 71 )
120 
121 //////////////////////////////////////////////////////////////////////////////
122 
123 // new types for merged style:protect attribute
124 #define XML_SD_TYPE_MOVE_PROTECT					(XML_SD_TYPES_START + 72 )
125 #define XML_SD_TYPE_SIZE_PROTECT					(XML_SD_TYPES_START + 73 )
126 
127 // new type for style:mirror attribute
128 #define	XML_TYPE_SD_MIRROR							(XML_SD_TYPES_START + 74 )
129 
130 //////////////////////////////////////////////////////////////////////////////
131 
132 // new smil transition types for pages
133 #define XML_SD_TYPE_TRANSITION_TYPE					(XML_SD_TYPES_START + 75 )
134 #define XML_SD_TYPE_TRANSTIION_SUBTYPE				(XML_SD_TYPES_START + 76 )
135 #define XML_SD_TYPE_TRANSTIION_DIRECTION			(XML_SD_TYPES_START + 77 )
136 
137 #define XML_SD_TYPE_HEADER_FOOTER_VISIBILITY_TYPE	(XML_SD_TYPES_START + 78 )
138 
139 //////////////////////////////////////////////////////////////////////////////
140 
141 #define CTF_NUMBERINGRULES			1000
142 #define CTF_CONTROLWRITINGMODE      1001
143 #define CTF_WRITINGMODE				1002
144 #define CTF_REPEAT_OFFSET_X			1003
145 #define CTF_REPEAT_OFFSET_Y			1004
146 #define CTF_PAGE_SOUND_URL			1005
147 #define CTF_PAGE_VISIBLE			1006
148 #define CTF_PAGE_TRANS_TYPE			1007
149 #define CTF_PAGE_TRANS_STYLE		1008
150 #define CTF_PAGE_TRANS_SPEED		1009
151 #define CTF_PAGE_TRANS_DURATION		1010
152 #define CTF_PAGE_BACKSIZE			1011
153 #define CTF_DASHNAME				1012
154 #define CTF_LINESTARTNAME			1013
155 #define CTF_LINEENDNAME				1014
156 #define CTF_FILLGRADIENTNAME		1015
157 #define CTF_FILLHATCHNAME			1016
158 #define CTF_FILLBITMAPNAME			1017
159 #define CTF_FILLTRANSNAME			1018
160 #define CTF_TEXTANIMATION_BLINKING	1019
161 #define CTF_TEXTANIMATION_KIND		1020
162 
163 #define CTF_PAGE_TRANSITION_TYPE		1021
164 #define CTF_PAGE_TRANSITION_SUBTYPE		1022
165 #define CTF_PAGE_TRANSITION_DIRECTION	1023
166 #define CTF_PAGE_TRANSITION_FADECOLOR	1024
167 
168 //////////////////////////////////////////////////////////////////////////////
169 // #FontWork#
170 #define	CTF_FONTWORK_STYLE				1021
171 #define	CTF_FONTWORK_ADJUST				1022
172 #define	CTF_FONTWORK_DISTANCE			1023
173 #define	CTF_FONTWORK_START				1024
174 #define	CTF_FONTWORK_MIRROR				1025
175 #define	CTF_FONTWORK_OUTLINE			1026
176 #define	CTF_FONTWORK_SHADOW				1027
177 #define	CTF_FONTWORK_SHADOWCOLOR		1028
178 #define	CTF_FONTWORK_SHADOWOFFSETX		1029
179 #define	CTF_FONTWORK_SHADOWOFFSETY		1030
180 #define	CTF_FONTWORK_FORM				1031
181 #define	CTF_FONTWORK_HIDEFORM			1032
182 #define	CTF_FONTWORK_SHADOWTRANSPARENCE	1033
183 
184 //////////////////////////////////////////////////////////////////////////////
185 // OLE part 1
186 #define CTF_SD_OLE_VIS_AREA_IMPORT_LEFT		1040
187 #define CTF_SD_OLE_VIS_AREA_IMPORT_TOP		1041
188 #define CTF_SD_OLE_VIS_AREA_IMPORT_WIDTH	1042
189 #define CTF_SD_OLE_VIS_AREA_IMPORT_HEIGHT	1043
190 #define CTF_SD_OLE_ISINTERNAL				1044
191 
192 #define CTF_SD_MOVE_PROTECT				1045
193 #define CTF_SD_SIZE_PROTECT				1046
194 
195 //////////////////////////////////////////////////////////////////////////////
196 // caption
197 #define CTF_CAPTION_ISESCREL			1047
198 #define CTF_CAPTION_ESCREL				1048
199 #define CTF_CAPTION_ESCABS				1049
200 
201 //////////////////////////////////////////////////////////////////////////////
202 // header&footer
203 #define CTF_HEADER_VISIBLE				1050
204 #define	CTF_FOOTER_VISIBLE				1051
205 #define CTF_PAGE_NUMBER_VISIBLE			1052
206 #define CTF_DATE_TIME_VISIBLE			1053
207 #define CTF_HEADER_TEXT					1054
208 #define CTF_FOOTER_TEXT					1055
209 #define CTF_DATE_TIME_TEXT				1056
210 #define CTF_DATE_TIME_FORMAT			1057
211 #define CTF_DATE_TIME_UPDATE			1058
212 
213 //////////////////////////////////////////////////////////////////////////////
214 // OLE part 2
215 #define CTF_SD_OLE_ASPECT					1059
216 #define CTF_SD_OLE_VIS_AREA_EXPORT_LEFT		1060
217 #define CTF_SD_OLE_VIS_AREA_EXPORT_TOP		1061
218 #define CTF_SD_OLE_VIS_AREA_EXPORT_WIDTH	1062
219 #define CTF_SD_OLE_VIS_AREA_EXPORT_HEIGHT	1063
220 
221 //////////////////////////////////////////////////////////////////////////////
222 // enum maps for attributes
223 
224 extern SvXMLEnumMapEntry aXML_ConnectionKind_EnumMap[];
225 extern SvXMLEnumMapEntry aXML_CircleKind_EnumMap[];
226 
227 //////////////////////////////////////////////////////////////////////////////
228 
229 /** contains the attribute to property mapping for a drawing layer table */
230 extern const XMLPropertyMapEntry aXMLTableShapeAttributes[];
231 
232 //////////////////////////////////////////////////////////////////////////////
233 // factory for own graphic properties
234 
235 class SvXMLExport;
236 class SvXMLImport;
237 
238 class XMLSdPropHdlFactory : public XMLPropertyHandlerFactory
239 {
240 private:
241 	::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel;
242 	SvXMLExport* mpExport;
243 	SvXMLImport* mpImport;
244 
245 public:
246 	XMLSdPropHdlFactory( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >, SvXMLExport& rExport );
247 	XMLSdPropHdlFactory( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >, SvXMLImport& rImport );
248 	virtual ~XMLSdPropHdlFactory();
249 	virtual const XMLPropertyHandler* GetPropertyHandler( sal_Int32 nType ) const;
250 };
251 
252 class XMLShapePropertySetMapper : public XMLPropertySetMapper
253 {
254 public:
255 	XMLShapePropertySetMapper(const UniReference< XMLPropertyHandlerFactory >& rFactoryRef);
256 	XMLShapePropertySetMapper(const UniReference< XMLPropertyHandlerFactory >& rFactoryRef, sal_uInt16 nOffset);
257 	~XMLShapePropertySetMapper();
258 };
259 
260 class XMLShapeExportPropertyMapper : public SvXMLExportPropertyMapper
261 {
262 private:
263 	XMLTextListAutoStylePool *mpListAutoPool;
264 	SvXMLExport& mrExport;
265 	SvxXMLNumRuleExport maNumRuleExp;
266 	sal_Bool mbIsInAutoStyles;
267 
268 	const rtl::OUString msCDATA;
269 	const rtl::OUString msTrue;
270 	const rtl::OUString msFalse;
271 
272 protected:
273 	virtual void ContextFilter(
274 		::std::vector< XMLPropertyState >& rProperties,
275 		::com::sun::star::uno::Reference<
276 			::com::sun::star::beans::XPropertySet > rPropSet ) const;
277 public:
278 	XMLShapeExportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper, XMLTextListAutoStylePool *pListAutoPool, SvXMLExport& rExport );
279 	virtual ~XMLShapeExportPropertyMapper();
280 
281 	virtual void		handleElementItem(
282                             SvXMLExport& rExport,
283 							const XMLPropertyState& rProperty,
284 							sal_uInt16 nFlags,
285 							const ::std::vector< XMLPropertyState >* pProperties = 0,
286 							sal_uInt32 nIdx = 0
287 							) const;
288 
289 	void SetAutoStyles( sal_Bool bIsInAutoStyles ) { mbIsInAutoStyles = bIsInAutoStyles; }
290 
291 	virtual void handleSpecialItem(
292 			SvXMLAttributeList& rAttrList,
293 			const XMLPropertyState& rProperty,
294 			const SvXMLUnitConverter& rUnitConverter,
295 			const SvXMLNamespaceMap& rNamespaceMap,
296 			const ::std::vector< XMLPropertyState > *pProperties = 0,
297 			sal_uInt32 nIdx = 0 ) const;
298 };
299 
300 class XMLPagePropertySetMapper : public XMLPropertySetMapper
301 {
302 public:
303 	XMLPagePropertySetMapper(const UniReference< XMLPropertyHandlerFactory >& rFactoryRef);
304 	~XMLPagePropertySetMapper();
305 };
306 
307 class XMLPageExportPropertyMapper : public SvXMLExportPropertyMapper
308 {
309 private:
310 	SvXMLExport& mrExport;
311 
312 	const rtl::OUString msCDATA;
313 	const rtl::OUString msTrue;
314 	const rtl::OUString msFalse;
315 
316 protected:
317 	virtual void ContextFilter(
318 		::std::vector< XMLPropertyState >& rProperties,
319 		::com::sun::star::uno::Reference<
320 			::com::sun::star::beans::XPropertySet > rPropSet ) const;
321 public:
322 	XMLPageExportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper, SvXMLExport& rExport );
323 	virtual ~XMLPageExportPropertyMapper();
324 
325 	virtual void		handleElementItem(
326                             SvXMLExport& rExport,
327                             const XMLPropertyState& rProperty,
328 							sal_uInt16 nFlags,
329 							const ::std::vector< XMLPropertyState >* pProperties = 0,
330 							sal_uInt32 nIdx = 0
331 							) const;
332 };
333 
334 #endif	//  _SDPROPLS_HXX
335