1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <xmloff/maptype.hxx>
23 #include <xmloff/xmlaustp.hxx>
24 #include <xmloff/xmltypes.hxx>
25 #include <xmloff/prhdlfac.hxx>
26 #include <xmloff/xmlexppr.hxx>
27 #include <xmloff/contextid.hxx>
28 #include <xmloff/xmlprhdl.hxx>
30 extern const XMLPropertyMapEntry aXMLScCellStylesProperties
[];
31 extern const XMLPropertyMapEntry aXMLScColumnStylesProperties
[];
32 extern const XMLPropertyMapEntry aXMLScRowStylesProperties
[];
33 extern const XMLPropertyMapEntry aXMLScFromXLSRowStylesProperties
[];
34 extern const XMLPropertyMapEntry aXMLScRowStylesImportProperties
[];
35 extern const XMLPropertyMapEntry aXMLScTableStylesProperties
[];
36 extern const XMLPropertyMapEntry aXMLScTableStylesImportProperties
[];
39 #define XML_SC_TYPE_CELLPROTECTION (XML_SC_TYPES_START + 1)
40 #define XML_SC_TYPE_PRINTCONTENT (XML_SC_TYPES_START + 2)
41 #define XML_SC_TYPE_HORIJUSTIFY (XML_SC_TYPES_START + 3)
42 #define XML_SC_TYPE_HORIJUSTIFY_METHOD (XML_SC_TYPES_START + 4)
43 #define XML_SC_TYPE_HORIJUSTIFYSOURCE (XML_SC_TYPES_START + 5)
44 #define XML_SC_TYPE_HORIJUSTIFYREPEAT (XML_SC_TYPES_START + 6)
45 #define XML_SC_TYPE_ORIENTATION (XML_SC_TYPES_START + 7)
46 #define XML_SC_TYPE_ROTATEANGLE (XML_SC_TYPES_START + 8)
47 #define XML_SC_TYPE_ROTATEREFERENCE (XML_SC_TYPES_START + 9)
48 #define XML_SC_TYPE_BORDERLEFT (XML_SC_TYPES_START + 10)
49 #define XML_SC_TYPE_BORDERRIGHT (XML_SC_TYPES_START + 11)
50 #define XML_SC_TYPE_BORDERTOP (XML_SC_TYPES_START + 12)
51 #define XML_SC_TYPE_BORDERBOTTOM (XML_SC_TYPES_START + 13)
52 #define XML_SC_TYPE_VERTJUSTIFY (XML_SC_TYPES_START + 14)
53 #define XML_SC_TYPE_VERTJUSTIFY_METHOD (XML_SC_TYPES_START + 15)
54 #define XML_SC_ISTEXTWRAPPED (XML_SC_TYPES_START + 16)
55 #define XML_SC_TYPE_EQUAL (XML_SC_TYPES_START + 17)
56 #define XML_SC_TYPE_VERTICAL (XML_SC_TYPES_START + 18)
58 // CTF_SC_HORIJUSTIFY (XML_SC_CTF_START + 1)
59 // CTF_SC_HORIJUSTIFY_SOURCE (XML_SC_CTF_START + 2)
60 #define CTF_SC_ALLPADDING (XML_SC_CTF_START + 3)
61 #define CTF_SC_BOTTOMPADDING (XML_SC_CTF_START + 4)
62 #define CTF_SC_LEFTPADDING (XML_SC_CTF_START + 5)
63 #define CTF_SC_RIGHTPADDING (XML_SC_CTF_START + 6)
64 #define CTF_SC_TOPPADDING (XML_SC_CTF_START + 7)
65 #define CTF_SC_ALLBORDER (XML_SC_CTF_START + 8)
66 #define CTF_SC_LEFTBORDER (XML_SC_CTF_START + 9)
67 #define CTF_SC_RIGHTBORDER (XML_SC_CTF_START + 10)
68 #define CTF_SC_TOPBORDER (XML_SC_CTF_START + 11)
69 #define CTF_SC_BOTTOMBORDER (XML_SC_CTF_START + 12)
70 #define CTF_SC_ALLBORDERWIDTH (XML_SC_CTF_START + 13)
71 #define CTF_SC_LEFTBORDERWIDTH (XML_SC_CTF_START + 14)
72 #define CTF_SC_RIGHTBORDERWIDTH (XML_SC_CTF_START + 15)
73 #define CTF_SC_TOPBORDERWIDTH (XML_SC_CTF_START + 16)
74 #define CTF_SC_BOTTOMBORDERWIDTH (XML_SC_CTF_START + 17)
75 #define CTF_SC_NUMBERFORMAT (XML_SC_CTF_START + 18)
76 #define CTF_SC_MAP (XML_SC_CTF_START + 19)
77 // CTF_SC_PARAINDENT (XML_SC_CTF_START + 20)
78 // CTF_SC_OLDTEXTBACKGROUND (XML_SC_CTF_START + 21)
79 #define CTF_SC_IMPORT_MAP (XML_SC_CTF_START + 22)
80 #define CTF_SC_CELLSTYLE (XML_SC_CTF_START + 23)
81 #define CTF_SC_VALIDATION (XML_SC_CTF_START + 24)
82 #define CTF_SC_DIAGONALTLBR (XML_SC_CTF_START + 25)
83 #define CTF_SC_DIAGONALTLBRWIDTH (XML_SC_CTF_START + 26)
84 #define CTF_SC_DIAGONALBLTR (XML_SC_CTF_START + 27)
85 #define CTF_SC_DIAGONALBLTRWIDTH (XML_SC_CTF_START + 28)
86 #define CTF_SC_DIAGONALTLBRWIDTHS (XML_SC_CTF_START + 29)
87 #define CTF_SC_DIAGONALBLTRWIDTHS (XML_SC_CTF_START + 30)
89 #define CTF_SC_ROWHEIGHT (XML_SC_CTF_START + 50)
90 #define CTF_SC_ROWOPTIMALHEIGHT (XML_SC_CTF_START + 51)
91 #define CTF_SC_ROWBREAKBEFORE (XML_SC_CTF_START + 52)
92 #define CTF_SC_ISVISIBLE (XML_SC_CTF_START + 53)
94 #define CTF_SC_MASTERPAGENAME (XML_SC_CTF_START + 53)
95 #define CTF_SC_HYPERLINK (XML_SC_CTF_START + 54)
98 #define XML_SC_TYPE_BREAKBEFORE (XML_SC_TYPES_START + 50)
102 class ScXMLCellExportPropertyMapper
: public SvXMLExportPropertyMapper
105 /** Application-specific filter. By default do nothing. */
106 virtual void ContextFilter(
107 bool bEnableFoFontFamily
,
108 ::std::vector
< XMLPropertyState
>& rProperties
,
109 const css::uno::Reference
<css::beans::XPropertySet
>& rPropSet
) const override
;
111 explicit ScXMLCellExportPropertyMapper(
112 const rtl::Reference
< XMLPropertySetMapper
>& rMapper
);
113 virtual ~ScXMLCellExportPropertyMapper() override
;
114 virtual void handleElementItem(
115 SvXMLExport
& rExport
,
116 const XMLPropertyState
& rProperty
,
117 SvXmlExportFlags nFlags
,
118 const ::std::vector
< XMLPropertyState
> *pProperties
,
119 sal_uInt32 nIdx
) const override
;
121 /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
122 virtual void handleSpecialItem(
123 SvXMLAttributeList
& rAttrList
,
124 const XMLPropertyState
& rProperty
,
125 const SvXMLUnitConverter
& rUnitConverter
,
126 const SvXMLNamespaceMap
& rNamespaceMap
,
127 const ::std::vector
< XMLPropertyState
> *pProperties
,
128 sal_uInt32 nIdx
) const override
;
131 class ScXMLRowExportPropertyMapper
: public SvXMLExportPropertyMapper
134 /** Application-specific filter. By default do nothing. */
135 virtual void ContextFilter(
136 bool bEnableFoFontFamily
,
137 ::std::vector
< XMLPropertyState
>& rProperties
,
138 const css::uno::Reference
<css::beans::XPropertySet
>& rPropSet
) const override
;
140 explicit ScXMLRowExportPropertyMapper(
141 const rtl::Reference
< XMLPropertySetMapper
>& rMapper
);
142 virtual ~ScXMLRowExportPropertyMapper() override
;
145 class ScXMLColumnExportPropertyMapper
: public SvXMLExportPropertyMapper
148 explicit ScXMLColumnExportPropertyMapper(
149 const rtl::Reference
< XMLPropertySetMapper
>& rMapper
);
150 virtual ~ScXMLColumnExportPropertyMapper() override
;
152 /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
153 virtual void handleSpecialItem(
154 SvXMLAttributeList
& rAttrList
,
155 const XMLPropertyState
& rProperty
,
156 const SvXMLUnitConverter
& rUnitConverter
,
157 const SvXMLNamespaceMap
& rNamespaceMap
,
158 const ::std::vector
< XMLPropertyState
> *pProperties
,
159 sal_uInt32 nIdx
) const override
;
162 class ScXMLTableExportPropertyMapper
: public SvXMLExportPropertyMapper
166 explicit ScXMLTableExportPropertyMapper(
167 const rtl::Reference
< XMLPropertySetMapper
>& rMapper
);
168 virtual ~ScXMLTableExportPropertyMapper() override
;
170 /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
171 virtual void handleSpecialItem(
172 SvXMLAttributeList
& rAttrList
,
173 const XMLPropertyState
& rProperty
,
174 const SvXMLUnitConverter
& rUnitConverter
,
175 const SvXMLNamespaceMap
& rNamespaceMap
,
176 const ::std::vector
< XMLPropertyState
> *pProperties
,
177 sal_uInt32 nIdx
) const override
;
180 class ScXMLAutoStylePoolP
: public SvXMLAutoStylePoolP
182 ScXMLExport
& rScXMLExport
;
184 virtual void exportStyleAttributes(
185 SvXMLAttributeList
& rAttrList
,
186 XmlStyleFamily nFamily
,
187 const ::std::vector
< XMLPropertyState
>& rProperties
,
188 const SvXMLExportPropertyMapper
& rPropExp
,
189 const SvXMLUnitConverter
& rUnitConverter
,
190 const SvXMLNamespaceMap
& rNamespaceMap
193 virtual void exportStyleContent(
194 const css::uno::Reference
< css::xml::sax::XDocumentHandler
> & rHandler
,
195 XmlStyleFamily nFamily
,
196 const ::std::vector
< XMLPropertyState
>& rProperties
,
197 const SvXMLExportPropertyMapper
& rPropExp
198 , const SvXMLUnitConverter
& rUnitConverter
,
199 const SvXMLNamespaceMap
& rNamespaceMap
203 explicit ScXMLAutoStylePoolP(ScXMLExport
& rScXMLExport
);
204 virtual ~ScXMLAutoStylePoolP() override
;
207 class XMLScPropHdlFactory
: public XMLPropertyHandlerFactory
210 XMLScPropHdlFactory();
211 virtual ~XMLScPropHdlFactory() override
;
212 virtual const XMLPropertyHandler
* GetPropertyHandler( sal_Int32 nType
) const override
;
215 class XmlScPropHdl_CellProtection
: public XMLPropertyHandler
218 virtual ~XmlScPropHdl_CellProtection() override
;
219 virtual bool equals( const css::uno::Any
& r1
, const css::uno::Any
& r2
) const override
;
220 virtual bool importXML( const OUString
& rStrImpValue
, css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
221 virtual bool exportXML( OUString
& rStrExpValue
, const css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
224 class XmlScPropHdl_PrintContent
: public XMLPropertyHandler
227 virtual ~XmlScPropHdl_PrintContent() override
;
228 virtual bool equals( const css::uno::Any
& r1
, const css::uno::Any
& r2
) const override
;
229 virtual bool importXML( const OUString
& rStrImpValue
, css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
230 virtual bool exportXML( OUString
& rStrExpValue
, const css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
233 class XmlScPropHdl_JustifyMethod
: public XMLPropertyHandler
236 virtual ~XmlScPropHdl_JustifyMethod() override
;
237 virtual bool equals( const css::uno::Any
& r1
, const css::uno::Any
& r2
) const override
;
238 virtual bool importXML( const OUString
& rStrImpValue
, css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
239 virtual bool exportXML( OUString
& rStrExpValue
, const css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
242 class XmlScPropHdl_HoriJustify
: public XMLPropertyHandler
245 virtual ~XmlScPropHdl_HoriJustify() override
;
246 virtual bool equals( const css::uno::Any
& r1
, const css::uno::Any
& r2
) const override
;
247 virtual bool importXML( const OUString
& rStrImpValue
, css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
248 virtual bool exportXML( OUString
& rStrExpValue
, const css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
251 class XmlScPropHdl_HoriJustifySource
: public XMLPropertyHandler
254 virtual ~XmlScPropHdl_HoriJustifySource() override
;
255 virtual bool equals( const css::uno::Any
& r1
, const css::uno::Any
& r2
) const override
;
256 virtual bool importXML( const OUString
& rStrImpValue
, css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
257 virtual bool exportXML( OUString
& rStrExpValue
, const css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
260 class XmlScPropHdl_HoriJustifyRepeat
: public XMLPropertyHandler
263 virtual ~XmlScPropHdl_HoriJustifyRepeat() override
;
264 virtual bool equals( const css::uno::Any
& r1
, const css::uno::Any
& r2
) const override
;
265 virtual bool importXML( const OUString
& rStrImpValue
, css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
266 virtual bool exportXML( OUString
& rStrExpValue
, const css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
269 class XmlScPropHdl_Orientation
: public XMLPropertyHandler
272 virtual ~XmlScPropHdl_Orientation() override
;
273 virtual bool equals( const css::uno::Any
& r1
, const css::uno::Any
& r2
) const override
;
274 virtual bool importXML( const OUString
& rStrImpValue
, css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
275 virtual bool exportXML( OUString
& rStrExpValue
, const css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
278 class XmlScPropHdl_RotateAngle
: public XMLPropertyHandler
281 virtual ~XmlScPropHdl_RotateAngle() override
;
282 virtual bool equals( const css::uno::Any
& r1
, const css::uno::Any
& r2
) const override
;
283 virtual bool importXML( const OUString
& rStrImpValue
, css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
284 virtual bool exportXML( OUString
& rStrExpValue
, const css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
287 class XmlScPropHdl_RotateReference
: public XMLPropertyHandler
290 virtual ~XmlScPropHdl_RotateReference() override
;
291 virtual bool equals( const css::uno::Any
& r1
, const css::uno::Any
& r2
) const override
;
292 virtual bool importXML( const OUString
& rStrImpValue
, css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
293 virtual bool exportXML( OUString
& rStrExpValue
, const css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
296 class XmlScPropHdl_VertJustify
: public XMLPropertyHandler
299 virtual ~XmlScPropHdl_VertJustify() override
;
300 virtual bool equals( const css::uno::Any
& r1
, const css::uno::Any
& r2
) const override
;
301 virtual bool importXML( const OUString
& rStrImpValue
, css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
302 virtual bool exportXML( OUString
& rStrExpValue
, const css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
305 class XmlScPropHdl_BreakBefore
: public XMLPropertyHandler
308 virtual ~XmlScPropHdl_BreakBefore() override
;
309 virtual bool equals( const css::uno::Any
& r1
, const css::uno::Any
& r2
) const override
;
310 virtual bool importXML( const OUString
& rStrImpValue
, css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
311 virtual bool exportXML( OUString
& rStrExpValue
, const css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
314 class XmlScPropHdl_IsTextWrapped
: public XMLPropertyHandler
317 virtual ~XmlScPropHdl_IsTextWrapped() override
;
318 virtual bool equals( const css::uno::Any
& r1
, const css::uno::Any
& r2
) const override
;
319 virtual bool importXML( const OUString
& rStrImpValue
, css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
320 virtual bool exportXML( OUString
& rStrExpValue
, const css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
323 class XmlScPropHdl_IsEqual
: public XMLPropertyHandler
326 virtual bool equals( const css::uno::Any
& /* r1 */, const css::uno::Any
& /* r2 */ ) const override
{ return true; }
327 virtual bool importXML( const OUString
& rStrImpValue
, css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
328 virtual bool exportXML( OUString
& rStrExpValue
, const css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
331 class XmlScPropHdl_Vertical
: public XMLPropertyHandler
334 virtual ~XmlScPropHdl_Vertical() override
;
335 virtual bool equals( const css::uno::Any
& r1
, const css::uno::Any
& r2
) const override
;
336 virtual bool importXML( const OUString
& rStrImpValue
, css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
337 virtual bool exportXML( OUString
& rStrExpValue
, const css::uno::Any
& rValue
, const SvXMLUnitConverter
& rUnitConverter
) const override
;
340 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */