fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / filter / xml / xmlstyle.hxx
blob1b458b5343e89895477c33ad208fda746729d1f8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SC_SOURCE_FILTER_XML_XMLSTYLE_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_XML_XMLSTYLE_HXX
23 #include <xmloff/maptype.hxx>
24 #include <xmloff/xmlaustp.hxx>
25 #include <xmloff/xmltypes.hxx>
26 #include <xmloff/xmlprmap.hxx>
27 #include <xmloff/prhdlfac.hxx>
28 #include <xmloff/styleexp.hxx>
29 #include <xmloff/xmlexppr.hxx>
30 #include <xmloff/contextid.hxx>
31 #include <xmloff/xmlprhdl.hxx>
33 extern const XMLPropertyMapEntry aXMLScCellStylesProperties[];
34 extern const XMLPropertyMapEntry aXMLScColumnStylesProperties[];
35 extern const XMLPropertyMapEntry aXMLScRowStylesProperties[];
36 extern const XMLPropertyMapEntry aXMLScFromXLSRowStylesProperties[];
37 extern const XMLPropertyMapEntry aXMLScRowStylesImportProperties[];
38 extern const XMLPropertyMapEntry aXMLScTableStylesProperties[];
39 extern const XMLPropertyMapEntry aXMLScTableStylesImportProperties[];
41 //CellStyles
42 #define XML_SC_TYPE_CELLPROTECTION (XML_SC_TYPES_START + 1)
43 #define XML_SC_TYPE_PRINTCONTENT (XML_SC_TYPES_START + 2)
44 #define XML_SC_TYPE_HORIJUSTIFY (XML_SC_TYPES_START + 3)
45 #define XML_SC_TYPE_HORIJUSTIFY_METHOD (XML_SC_TYPES_START + 4)
46 #define XML_SC_TYPE_HORIJUSTIFYSOURCE (XML_SC_TYPES_START + 5)
47 #define XML_SC_TYPE_HORIJUSTIFYREPEAT (XML_SC_TYPES_START + 6)
48 #define XML_SC_TYPE_ORIENTATION (XML_SC_TYPES_START + 7)
49 #define XML_SC_TYPE_ROTATEANGLE (XML_SC_TYPES_START + 8)
50 #define XML_SC_TYPE_ROTATEREFERENCE (XML_SC_TYPES_START + 9)
51 #define XML_SC_TYPE_BORDERLEFT (XML_SC_TYPES_START + 10)
52 #define XML_SC_TYPE_BORDERRIGHT (XML_SC_TYPES_START + 11)
53 #define XML_SC_TYPE_BORDERTOP (XML_SC_TYPES_START + 12)
54 #define XML_SC_TYPE_BORDERBOTTOM (XML_SC_TYPES_START + 13)
55 #define XML_SC_TYPE_VERTJUSTIFY (XML_SC_TYPES_START + 14)
56 #define XML_SC_TYPE_VERTJUSTIFY_METHOD (XML_SC_TYPES_START + 15)
57 #define XML_SC_ISTEXTWRAPPED (XML_SC_TYPES_START + 16)
58 #define XML_SC_TYPE_EQUAL (XML_SC_TYPES_START + 17)
59 #define XML_SC_TYPE_VERTICAL (XML_SC_TYPES_START + 18)
61 // CTF_SC_HORIJUSTIFY (XML_SC_CTF_START + 1)
62 // CTF_SC_HORIJUSTIFY_SOURCE (XML_SC_CTF_START + 2)
63 #define CTF_SC_ALLPADDING (XML_SC_CTF_START + 3)
64 #define CTF_SC_BOTTOMPADDING (XML_SC_CTF_START + 4)
65 #define CTF_SC_LEFTPADDING (XML_SC_CTF_START + 5)
66 #define CTF_SC_RIGHTPADDING (XML_SC_CTF_START + 6)
67 #define CTF_SC_TOPPADDING (XML_SC_CTF_START + 7)
68 #define CTF_SC_ALLBORDER (XML_SC_CTF_START + 8)
69 #define CTF_SC_LEFTBORDER (XML_SC_CTF_START + 9)
70 #define CTF_SC_RIGHTBORDER (XML_SC_CTF_START + 10)
71 #define CTF_SC_TOPBORDER (XML_SC_CTF_START + 11)
72 #define CTF_SC_BOTTOMBORDER (XML_SC_CTF_START + 12)
73 #define CTF_SC_ALLBORDERWIDTH (XML_SC_CTF_START + 13)
74 #define CTF_SC_LEFTBORDERWIDTH (XML_SC_CTF_START + 14)
75 #define CTF_SC_RIGHTBORDERWIDTH (XML_SC_CTF_START + 15)
76 #define CTF_SC_TOPBORDERWIDTH (XML_SC_CTF_START + 16)
77 #define CTF_SC_BOTTOMBORDERWIDTH (XML_SC_CTF_START + 17)
78 #define CTF_SC_NUMBERFORMAT (XML_SC_CTF_START + 18)
79 #define CTF_SC_MAP (XML_SC_CTF_START + 19)
80 // CTF_SC_PARAINDENT (XML_SC_CTF_START + 20)
81 // CTF_SC_OLDTEXTBACKGROUND (XML_SC_CTF_START + 21)
82 #define CTF_SC_IMPORT_MAP (XML_SC_CTF_START + 22)
83 #define CTF_SC_CELLSTYLE (XML_SC_CTF_START + 23)
84 #define CTF_SC_VALIDATION (XML_SC_CTF_START + 24)
85 #define CTF_SC_DIAGONALTLBR (XML_SC_CTF_START + 25)
86 #define CTF_SC_DIAGONALTLBRWIDTH (XML_SC_CTF_START + 26)
87 #define CTF_SC_DIAGONALBLTR (XML_SC_CTF_START + 27)
88 #define CTF_SC_DIAGONALBLTRWIDTH (XML_SC_CTF_START + 28)
89 #define CTF_SC_DIAGONALTLBRWIDTHS (XML_SC_CTF_START + 29)
90 #define CTF_SC_DIAGONALBLTRWIDTHS (XML_SC_CTF_START + 30)
92 #define CTF_SC_ROWHEIGHT (XML_SC_CTF_START + 50)
93 #define CTF_SC_ROWOPTIMALHEIGHT (XML_SC_CTF_START + 51)
94 #define CTF_SC_ROWBREAKBEFORE (XML_SC_CTF_START + 52)
95 #define CTF_SC_ISVISIBLE (XML_SC_CTF_START + 53)
97 #define CTF_SC_MASTERPAGENAME (XML_SC_CTF_START + 53)
98 #define CTF_SC_HYPERLINK (XML_SC_CTF_START + 54)
100 //ColumnStyles
101 #define XML_SC_TYPE_BREAKBEFORE (XML_SC_TYPES_START + 50)
103 class ScXMLExport;
105 class ScXMLCellExportPropertyMapper : public SvXMLExportPropertyMapper
107 protected:
108 /** Application-specific filter. By default do nothing. */
109 virtual void ContextFilter(
110 bool bEnableFoFontFamily,
111 ::std::vector< XMLPropertyState >& rProperties,
112 ::com::sun::star::uno::Reference<
113 ::com::sun::star::beans::XPropertySet > rPropSet ) const SAL_OVERRIDE;
114 public:
115 ScXMLCellExportPropertyMapper(
116 const rtl::Reference< XMLPropertySetMapper >& rMapper );
117 virtual ~ScXMLCellExportPropertyMapper();
118 virtual void handleElementItem(
119 SvXMLExport& rExport,
120 const XMLPropertyState& rProperty,
121 SvXmlExportFlags nFlags,
122 const ::std::vector< XMLPropertyState > *pProperties = 0,
123 sal_uInt32 nIdx = 0 ) const SAL_OVERRIDE;
125 /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
126 virtual void handleSpecialItem(
127 SvXMLAttributeList& rAttrList,
128 const XMLPropertyState& rProperty,
129 const SvXMLUnitConverter& rUnitConverter,
130 const SvXMLNamespaceMap& rNamespaceMap,
131 const ::std::vector< XMLPropertyState > *pProperties = 0,
132 sal_uInt32 nIdx = 0 ) const SAL_OVERRIDE;
135 class ScXMLRowExportPropertyMapper : public SvXMLExportPropertyMapper
137 protected:
138 /** Application-specific filter. By default do nothing. */
139 virtual void ContextFilter(
140 bool bEnableFoFontFamily,
141 ::std::vector< XMLPropertyState >& rProperties,
142 ::com::sun::star::uno::Reference<
143 ::com::sun::star::beans::XPropertySet > rPropSet ) const SAL_OVERRIDE;
144 public:
145 ScXMLRowExportPropertyMapper(
146 const rtl::Reference< XMLPropertySetMapper >& rMapper );
147 virtual ~ScXMLRowExportPropertyMapper();
150 class ScXMLColumnExportPropertyMapper : public SvXMLExportPropertyMapper
152 public:
153 ScXMLColumnExportPropertyMapper(
154 const rtl::Reference< XMLPropertySetMapper >& rMapper );
155 virtual ~ScXMLColumnExportPropertyMapper();
157 /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
158 virtual void handleSpecialItem(
159 SvXMLAttributeList& rAttrList,
160 const XMLPropertyState& rProperty,
161 const SvXMLUnitConverter& rUnitConverter,
162 const SvXMLNamespaceMap& rNamespaceMap,
163 const ::std::vector< XMLPropertyState > *pProperties = 0,
164 sal_uInt32 nIdx = 0 ) const SAL_OVERRIDE;
167 class ScXMLTableExportPropertyMapper : public SvXMLExportPropertyMapper
169 protected:
170 public:
171 ScXMLTableExportPropertyMapper(
172 const rtl::Reference< XMLPropertySetMapper >& rMapper );
173 virtual ~ScXMLTableExportPropertyMapper();
175 /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
176 virtual void handleSpecialItem(
177 SvXMLAttributeList& rAttrList,
178 const XMLPropertyState& rProperty,
179 const SvXMLUnitConverter& rUnitConverter,
180 const SvXMLNamespaceMap& rNamespaceMap,
181 const ::std::vector< XMLPropertyState > *pProperties = 0,
182 sal_uInt32 nIdx = 0 ) const SAL_OVERRIDE;
185 class ScXMLAutoStylePoolP : public SvXMLAutoStylePoolP
187 ScXMLExport& rScXMLExport;
189 virtual void exportStyleAttributes(
190 SvXMLAttributeList& rAttrList,
191 sal_Int32 nFamily,
192 const ::std::vector< XMLPropertyState >& rProperties,
193 const SvXMLExportPropertyMapper& rPropExp,
194 const SvXMLUnitConverter& rUnitConverter,
195 const SvXMLNamespaceMap& rNamespaceMap
196 ) const SAL_OVERRIDE;
198 virtual void exportStyleContent(
199 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
200 sal_Int32 nFamily,
201 const ::std::vector< XMLPropertyState >& rProperties,
202 const SvXMLExportPropertyMapper& rPropExp
203 , const SvXMLUnitConverter& rUnitConverter,
204 const SvXMLNamespaceMap& rNamespaceMap
205 ) const SAL_OVERRIDE;
207 public:
208 ScXMLAutoStylePoolP(ScXMLExport& rScXMLExport);
209 virtual ~ScXMLAutoStylePoolP();
212 class ScXMLStyleExport : public XMLStyleExport
214 virtual void exportStyleAttributes(
215 const ::com::sun::star::uno::Reference<
216 ::com::sun::star::style::XStyle > & rStyle ) SAL_OVERRIDE;
217 virtual void exportStyleContent(
218 const ::com::sun::star::uno::Reference<
219 ::com::sun::star::style::XStyle > & rStyle ) SAL_OVERRIDE;
220 public:
221 ScXMLStyleExport(
222 SvXMLExport& rExp,
223 const OUString& rPoolStyleName,
224 SvXMLAutoStylePoolP *pAutoStyleP=0 );
225 virtual ~ScXMLStyleExport();
228 class XMLScPropHdlFactory : public XMLPropertyHandlerFactory
230 public:
231 XMLScPropHdlFactory();
232 virtual ~XMLScPropHdlFactory();
233 virtual const XMLPropertyHandler* GetPropertyHandler( sal_Int32 nType ) const SAL_OVERRIDE;
236 class XmlScPropHdl_CellProtection : public XMLPropertyHandler
238 public:
239 virtual ~XmlScPropHdl_CellProtection();
240 virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const SAL_OVERRIDE;
241 virtual bool importXML( const OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
242 virtual bool exportXML( OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
245 class XmlScPropHdl_PrintContent : public XMLPropertyHandler
247 public:
248 virtual ~XmlScPropHdl_PrintContent();
249 virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const SAL_OVERRIDE;
250 virtual bool importXML( const OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
251 virtual bool exportXML( OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
254 class XmlScPropHdl_JustifyMethod : public XMLPropertyHandler
256 public:
257 virtual ~XmlScPropHdl_JustifyMethod();
258 virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const SAL_OVERRIDE;
259 virtual bool importXML( const OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
260 virtual bool exportXML( OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
263 class XmlScPropHdl_HoriJustify : public XMLPropertyHandler
265 public:
266 virtual ~XmlScPropHdl_HoriJustify();
267 virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const SAL_OVERRIDE;
268 virtual bool importXML( const OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
269 virtual bool exportXML( OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
272 class XmlScPropHdl_HoriJustifySource : public XMLPropertyHandler
274 public:
275 virtual ~XmlScPropHdl_HoriJustifySource();
276 virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const SAL_OVERRIDE;
277 virtual bool importXML( const OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
278 virtual bool exportXML( OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
281 class XmlScPropHdl_HoriJustifyRepeat : public XMLPropertyHandler
283 public:
284 virtual ~XmlScPropHdl_HoriJustifyRepeat();
285 virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const SAL_OVERRIDE;
286 virtual bool importXML( const OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
287 virtual bool exportXML( OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
290 class XmlScPropHdl_Orientation : public XMLPropertyHandler
292 public:
293 virtual ~XmlScPropHdl_Orientation();
294 virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const SAL_OVERRIDE;
295 virtual bool importXML( const OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
296 virtual bool exportXML( OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
299 class XmlScPropHdl_RotateAngle : public XMLPropertyHandler
301 public:
302 virtual ~XmlScPropHdl_RotateAngle();
303 virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const SAL_OVERRIDE;
304 virtual bool importXML( const OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
305 virtual bool exportXML( OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
308 class XmlScPropHdl_RotateReference : public XMLPropertyHandler
310 public:
311 virtual ~XmlScPropHdl_RotateReference();
312 virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const SAL_OVERRIDE;
313 virtual bool importXML( const OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
314 virtual bool exportXML( OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
317 class XmlScPropHdl_VertJustify : public XMLPropertyHandler
319 public:
320 virtual ~XmlScPropHdl_VertJustify();
321 virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const SAL_OVERRIDE;
322 virtual bool importXML( const OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
323 virtual bool exportXML( OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
326 class XmlScPropHdl_BreakBefore : public XMLPropertyHandler
328 public:
329 virtual ~XmlScPropHdl_BreakBefore();
330 virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const SAL_OVERRIDE;
331 virtual bool importXML( const OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
332 virtual bool exportXML( OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
335 class XmlScPropHdl_IsTextWrapped : public XMLPropertyHandler
337 public:
338 virtual ~XmlScPropHdl_IsTextWrapped();
339 virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const SAL_OVERRIDE;
340 virtual bool importXML( const OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
341 virtual bool exportXML( OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
344 class XmlScPropHdl_IsEqual : public XMLPropertyHandler
346 public:
347 virtual ~XmlScPropHdl_IsEqual() {}
348 virtual bool equals( const ::com::sun::star::uno::Any& /* r1 */, const ::com::sun::star::uno::Any& /* r2 */ ) const SAL_OVERRIDE { return true; }
349 virtual bool importXML( const OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
350 virtual bool exportXML( OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
353 class XmlScPropHdl_Vertical : public XMLPropertyHandler
355 public:
356 virtual ~XmlScPropHdl_Vertical();
357 virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const SAL_OVERRIDE;
358 virtual bool importXML( const OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
359 virtual bool exportXML( OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const SAL_OVERRIDE;
362 #endif
364 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */