Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / sc / source / filter / xml / xmlstyle.hxx
blob36a42737cf242f0dccb826e9e66a73545edc9744
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/prhdlfac.hxx>
27 #include <xmloff/styleexp.hxx>
28 #include <xmloff/xmlexppr.hxx>
29 #include <xmloff/contextid.hxx>
30 #include <xmloff/xmlprhdl.hxx>
32 extern const XMLPropertyMapEntry aXMLScCellStylesProperties[];
33 extern const XMLPropertyMapEntry aXMLScColumnStylesProperties[];
34 extern const XMLPropertyMapEntry aXMLScRowStylesProperties[];
35 extern const XMLPropertyMapEntry aXMLScFromXLSRowStylesProperties[];
36 extern const XMLPropertyMapEntry aXMLScRowStylesImportProperties[];
37 extern const XMLPropertyMapEntry aXMLScTableStylesProperties[];
38 extern const XMLPropertyMapEntry aXMLScTableStylesImportProperties[];
40 //CellStyles
41 #define XML_SC_TYPE_CELLPROTECTION (XML_SC_TYPES_START + 1)
42 #define XML_SC_TYPE_PRINTCONTENT (XML_SC_TYPES_START + 2)
43 #define XML_SC_TYPE_HORIJUSTIFY (XML_SC_TYPES_START + 3)
44 #define XML_SC_TYPE_HORIJUSTIFY_METHOD (XML_SC_TYPES_START + 4)
45 #define XML_SC_TYPE_HORIJUSTIFYSOURCE (XML_SC_TYPES_START + 5)
46 #define XML_SC_TYPE_HORIJUSTIFYREPEAT (XML_SC_TYPES_START + 6)
47 #define XML_SC_TYPE_ORIENTATION (XML_SC_TYPES_START + 7)
48 #define XML_SC_TYPE_ROTATEANGLE (XML_SC_TYPES_START + 8)
49 #define XML_SC_TYPE_ROTATEREFERENCE (XML_SC_TYPES_START + 9)
50 #define XML_SC_TYPE_BORDERLEFT (XML_SC_TYPES_START + 10)
51 #define XML_SC_TYPE_BORDERRIGHT (XML_SC_TYPES_START + 11)
52 #define XML_SC_TYPE_BORDERTOP (XML_SC_TYPES_START + 12)
53 #define XML_SC_TYPE_BORDERBOTTOM (XML_SC_TYPES_START + 13)
54 #define XML_SC_TYPE_VERTJUSTIFY (XML_SC_TYPES_START + 14)
55 #define XML_SC_TYPE_VERTJUSTIFY_METHOD (XML_SC_TYPES_START + 15)
56 #define XML_SC_ISTEXTWRAPPED (XML_SC_TYPES_START + 16)
57 #define XML_SC_TYPE_EQUAL (XML_SC_TYPES_START + 17)
58 #define XML_SC_TYPE_VERTICAL (XML_SC_TYPES_START + 18)
60 // CTF_SC_HORIJUSTIFY (XML_SC_CTF_START + 1)
61 // CTF_SC_HORIJUSTIFY_SOURCE (XML_SC_CTF_START + 2)
62 #define CTF_SC_ALLPADDING (XML_SC_CTF_START + 3)
63 #define CTF_SC_BOTTOMPADDING (XML_SC_CTF_START + 4)
64 #define CTF_SC_LEFTPADDING (XML_SC_CTF_START + 5)
65 #define CTF_SC_RIGHTPADDING (XML_SC_CTF_START + 6)
66 #define CTF_SC_TOPPADDING (XML_SC_CTF_START + 7)
67 #define CTF_SC_ALLBORDER (XML_SC_CTF_START + 8)
68 #define CTF_SC_LEFTBORDER (XML_SC_CTF_START + 9)
69 #define CTF_SC_RIGHTBORDER (XML_SC_CTF_START + 10)
70 #define CTF_SC_TOPBORDER (XML_SC_CTF_START + 11)
71 #define CTF_SC_BOTTOMBORDER (XML_SC_CTF_START + 12)
72 #define CTF_SC_ALLBORDERWIDTH (XML_SC_CTF_START + 13)
73 #define CTF_SC_LEFTBORDERWIDTH (XML_SC_CTF_START + 14)
74 #define CTF_SC_RIGHTBORDERWIDTH (XML_SC_CTF_START + 15)
75 #define CTF_SC_TOPBORDERWIDTH (XML_SC_CTF_START + 16)
76 #define CTF_SC_BOTTOMBORDERWIDTH (XML_SC_CTF_START + 17)
77 #define CTF_SC_NUMBERFORMAT (XML_SC_CTF_START + 18)
78 #define CTF_SC_MAP (XML_SC_CTF_START + 19)
79 // CTF_SC_PARAINDENT (XML_SC_CTF_START + 20)
80 // CTF_SC_OLDTEXTBACKGROUND (XML_SC_CTF_START + 21)
81 #define CTF_SC_IMPORT_MAP (XML_SC_CTF_START + 22)
82 #define CTF_SC_CELLSTYLE (XML_SC_CTF_START + 23)
83 #define CTF_SC_VALIDATION (XML_SC_CTF_START + 24)
84 #define CTF_SC_DIAGONALTLBR (XML_SC_CTF_START + 25)
85 #define CTF_SC_DIAGONALTLBRWIDTH (XML_SC_CTF_START + 26)
86 #define CTF_SC_DIAGONALBLTR (XML_SC_CTF_START + 27)
87 #define CTF_SC_DIAGONALBLTRWIDTH (XML_SC_CTF_START + 28)
88 #define CTF_SC_DIAGONALTLBRWIDTHS (XML_SC_CTF_START + 29)
89 #define CTF_SC_DIAGONALBLTRWIDTHS (XML_SC_CTF_START + 30)
91 #define CTF_SC_ROWHEIGHT (XML_SC_CTF_START + 50)
92 #define CTF_SC_ROWOPTIMALHEIGHT (XML_SC_CTF_START + 51)
93 #define CTF_SC_ROWBREAKBEFORE (XML_SC_CTF_START + 52)
94 #define CTF_SC_ISVISIBLE (XML_SC_CTF_START + 53)
96 #define CTF_SC_MASTERPAGENAME (XML_SC_CTF_START + 53)
97 #define CTF_SC_HYPERLINK (XML_SC_CTF_START + 54)
99 //ColumnStyles
100 #define XML_SC_TYPE_BREAKBEFORE (XML_SC_TYPES_START + 50)
102 class ScXMLExport;
104 class ScXMLCellExportPropertyMapper : public SvXMLExportPropertyMapper
106 protected:
107 /** Application-specific filter. By default do nothing. */
108 virtual void ContextFilter(
109 bool bEnableFoFontFamily,
110 ::std::vector< XMLPropertyState >& rProperties,
111 const css::uno::Reference<css::beans::XPropertySet >& rPropSet ) const override;
112 public:
113 explicit ScXMLCellExportPropertyMapper(
114 const rtl::Reference< XMLPropertySetMapper >& rMapper );
115 virtual ~ScXMLCellExportPropertyMapper() override;
116 virtual void handleElementItem(
117 SvXMLExport& rExport,
118 const XMLPropertyState& rProperty,
119 SvXmlExportFlags nFlags,
120 const ::std::vector< XMLPropertyState > *pProperties,
121 sal_uInt32 nIdx ) const override;
123 /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
124 virtual void handleSpecialItem(
125 SvXMLAttributeList& rAttrList,
126 const XMLPropertyState& rProperty,
127 const SvXMLUnitConverter& rUnitConverter,
128 const SvXMLNamespaceMap& rNamespaceMap,
129 const ::std::vector< XMLPropertyState > *pProperties,
130 sal_uInt32 nIdx ) const override;
133 class ScXMLRowExportPropertyMapper : public SvXMLExportPropertyMapper
135 protected:
136 /** Application-specific filter. By default do nothing. */
137 virtual void ContextFilter(
138 bool bEnableFoFontFamily,
139 ::std::vector< XMLPropertyState >& rProperties,
140 const css::uno::Reference<css::beans::XPropertySet >& rPropSet ) const override;
141 public:
142 explicit ScXMLRowExportPropertyMapper(
143 const rtl::Reference< XMLPropertySetMapper >& rMapper );
144 virtual ~ScXMLRowExportPropertyMapper() override;
147 class ScXMLColumnExportPropertyMapper : public SvXMLExportPropertyMapper
149 public:
150 explicit ScXMLColumnExportPropertyMapper(
151 const rtl::Reference< XMLPropertySetMapper >& rMapper );
152 virtual ~ScXMLColumnExportPropertyMapper() override;
154 /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
155 virtual void handleSpecialItem(
156 SvXMLAttributeList& rAttrList,
157 const XMLPropertyState& rProperty,
158 const SvXMLUnitConverter& rUnitConverter,
159 const SvXMLNamespaceMap& rNamespaceMap,
160 const ::std::vector< XMLPropertyState > *pProperties,
161 sal_uInt32 nIdx ) const override;
164 class ScXMLTableExportPropertyMapper : public SvXMLExportPropertyMapper
166 protected:
167 public:
168 explicit ScXMLTableExportPropertyMapper(
169 const rtl::Reference< XMLPropertySetMapper >& rMapper );
170 virtual ~ScXMLTableExportPropertyMapper() override;
172 /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
173 virtual void handleSpecialItem(
174 SvXMLAttributeList& rAttrList,
175 const XMLPropertyState& rProperty,
176 const SvXMLUnitConverter& rUnitConverter,
177 const SvXMLNamespaceMap& rNamespaceMap,
178 const ::std::vector< XMLPropertyState > *pProperties,
179 sal_uInt32 nIdx ) const override;
182 class ScXMLAutoStylePoolP : public SvXMLAutoStylePoolP
184 ScXMLExport& rScXMLExport;
186 virtual void exportStyleAttributes(
187 SvXMLAttributeList& rAttrList,
188 sal_Int32 nFamily,
189 const ::std::vector< XMLPropertyState >& rProperties,
190 const SvXMLExportPropertyMapper& rPropExp,
191 const SvXMLUnitConverter& rUnitConverter,
192 const SvXMLNamespaceMap& rNamespaceMap
193 ) const override;
195 virtual void exportStyleContent(
196 const css::uno::Reference< css::xml::sax::XDocumentHandler > & rHandler,
197 sal_Int32 nFamily,
198 const ::std::vector< XMLPropertyState >& rProperties,
199 const SvXMLExportPropertyMapper& rPropExp
200 , const SvXMLUnitConverter& rUnitConverter,
201 const SvXMLNamespaceMap& rNamespaceMap
202 ) const override;
204 public:
205 explicit ScXMLAutoStylePoolP(ScXMLExport& rScXMLExport);
206 virtual ~ScXMLAutoStylePoolP() override;
209 class ScXMLStyleExport : public XMLStyleExport
211 virtual void exportStyleAttributes(
212 const css::uno::Reference< css::style::XStyle > & rStyle ) override;
213 virtual void exportStyleContent(
214 const css::uno::Reference< css::style::XStyle > & rStyle ) override;
215 public:
216 ScXMLStyleExport(
217 SvXMLExport& rExp,
218 SvXMLAutoStylePoolP *pAutoStyleP );
219 virtual ~ScXMLStyleExport() override;
222 class XMLScPropHdlFactory : public XMLPropertyHandlerFactory
224 public:
225 XMLScPropHdlFactory();
226 virtual ~XMLScPropHdlFactory() override;
227 virtual const XMLPropertyHandler* GetPropertyHandler( sal_Int32 nType ) const override;
230 class XmlScPropHdl_CellProtection : public XMLPropertyHandler
232 public:
233 virtual ~XmlScPropHdl_CellProtection() override;
234 virtual bool equals( const css::uno::Any& r1, const css::uno::Any& r2 ) const override;
235 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
236 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
239 class XmlScPropHdl_PrintContent : public XMLPropertyHandler
241 public:
242 virtual ~XmlScPropHdl_PrintContent() override;
243 virtual bool equals( const css::uno::Any& r1, const css::uno::Any& r2 ) const override;
244 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
245 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
248 class XmlScPropHdl_JustifyMethod : public XMLPropertyHandler
250 public:
251 virtual ~XmlScPropHdl_JustifyMethod() override;
252 virtual bool equals( const css::uno::Any& r1, const css::uno::Any& r2 ) const override;
253 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
254 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
257 class XmlScPropHdl_HoriJustify : public XMLPropertyHandler
259 public:
260 virtual ~XmlScPropHdl_HoriJustify() override;
261 virtual bool equals( const css::uno::Any& r1, const css::uno::Any& r2 ) const override;
262 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
263 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
266 class XmlScPropHdl_HoriJustifySource : public XMLPropertyHandler
268 public:
269 virtual ~XmlScPropHdl_HoriJustifySource() override;
270 virtual bool equals( const css::uno::Any& r1, const css::uno::Any& r2 ) const override;
271 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
272 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
275 class XmlScPropHdl_HoriJustifyRepeat : public XMLPropertyHandler
277 public:
278 virtual ~XmlScPropHdl_HoriJustifyRepeat() override;
279 virtual bool equals( const css::uno::Any& r1, const css::uno::Any& r2 ) const override;
280 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
281 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
284 class XmlScPropHdl_Orientation : public XMLPropertyHandler
286 public:
287 virtual ~XmlScPropHdl_Orientation() override;
288 virtual bool equals( const css::uno::Any& r1, const css::uno::Any& r2 ) const override;
289 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
290 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
293 class XmlScPropHdl_RotateAngle : public XMLPropertyHandler
295 public:
296 virtual ~XmlScPropHdl_RotateAngle() override;
297 virtual bool equals( const css::uno::Any& r1, const css::uno::Any& r2 ) const override;
298 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
299 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
302 class XmlScPropHdl_RotateReference : public XMLPropertyHandler
304 public:
305 virtual ~XmlScPropHdl_RotateReference() override;
306 virtual bool equals( const css::uno::Any& r1, const css::uno::Any& r2 ) const override;
307 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
308 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
311 class XmlScPropHdl_VertJustify : public XMLPropertyHandler
313 public:
314 virtual ~XmlScPropHdl_VertJustify() override;
315 virtual bool equals( const css::uno::Any& r1, const css::uno::Any& r2 ) const override;
316 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
317 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
320 class XmlScPropHdl_BreakBefore : public XMLPropertyHandler
322 public:
323 virtual ~XmlScPropHdl_BreakBefore() override;
324 virtual bool equals( const css::uno::Any& r1, const css::uno::Any& r2 ) const override;
325 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
326 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
329 class XmlScPropHdl_IsTextWrapped : public XMLPropertyHandler
331 public:
332 virtual ~XmlScPropHdl_IsTextWrapped() override;
333 virtual bool equals( const css::uno::Any& r1, const css::uno::Any& r2 ) const override;
334 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
335 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
338 class XmlScPropHdl_IsEqual : public XMLPropertyHandler
340 public:
341 virtual bool equals( const css::uno::Any& /* r1 */, const css::uno::Any& /* r2 */ ) const override { return true; }
342 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
343 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
346 class XmlScPropHdl_Vertical : public XMLPropertyHandler
348 public:
349 virtual ~XmlScPropHdl_Vertical() override;
350 virtual bool equals( const css::uno::Any& r1, const css::uno::Any& r2 ) const override;
351 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
352 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
355 #endif
357 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */