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