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