Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef SC_XMLSTYLE_HXX
30 : : #define SC_XMLSTYLE_HXX
31 : :
32 : : #include <xmloff/maptype.hxx>
33 : : #include <xmloff/xmlaustp.hxx>
34 : : #include <xmloff/xmltypes.hxx>
35 : : #include <xmloff/xmlprmap.hxx>
36 : : #include <xmloff/prhdlfac.hxx>
37 : : #include <xmloff/styleexp.hxx>
38 : : #include <xmloff/xmlexppr.hxx>
39 : : #include <xmloff/contextid.hxx>
40 : :
41 : : extern const XMLPropertyMapEntry aXMLScCellStylesProperties[];
42 : : extern const XMLPropertyMapEntry aXMLScColumnStylesProperties[];
43 : : extern const XMLPropertyMapEntry aXMLScRowStylesProperties[];
44 : : extern const XMLPropertyMapEntry aXMLScFromXLSRowStylesProperties[];
45 : : extern const XMLPropertyMapEntry aXMLScRowStylesImportProperties[];
46 : : extern const XMLPropertyMapEntry aXMLScTableStylesProperties[];
47 : : extern const XMLPropertyMapEntry aXMLScTableStylesImportProperties[];
48 : :
49 : : //CellStyles
50 : : #define XML_SC_TYPE_CELLPROTECTION (XML_SC_TYPES_START + 1)
51 : : #define XML_SC_TYPE_PRINTCONTENT (XML_SC_TYPES_START + 2)
52 : : #define XML_SC_TYPE_HORIJUSTIFY (XML_SC_TYPES_START + 3)
53 : : #define XML_SC_TYPE_HORIJUSTIFY_METHOD (XML_SC_TYPES_START + 4)
54 : : #define XML_SC_TYPE_HORIJUSTIFYSOURCE (XML_SC_TYPES_START + 5)
55 : : #define XML_SC_TYPE_HORIJUSTIFYREPEAT (XML_SC_TYPES_START + 6)
56 : : #define XML_SC_TYPE_ORIENTATION (XML_SC_TYPES_START + 7)
57 : : #define XML_SC_TYPE_ROTATEANGLE (XML_SC_TYPES_START + 8)
58 : : #define XML_SC_TYPE_ROTATEREFERENCE (XML_SC_TYPES_START + 9)
59 : : #define XML_SC_TYPE_BORDERLEFT (XML_SC_TYPES_START + 10)
60 : : #define XML_SC_TYPE_BORDERRIGHT (XML_SC_TYPES_START + 11)
61 : : #define XML_SC_TYPE_BORDERTOP (XML_SC_TYPES_START + 12)
62 : : #define XML_SC_TYPE_BORDERBOTTOM (XML_SC_TYPES_START + 13)
63 : : #define XML_SC_TYPE_VERTJUSTIFY (XML_SC_TYPES_START + 14)
64 : : #define XML_SC_TYPE_VERTJUSTIFY_METHOD (XML_SC_TYPES_START + 15)
65 : : #define XML_SC_ISTEXTWRAPPED (XML_SC_TYPES_START + 16)
66 : : #define XML_SC_TYPE_EQUAL (XML_SC_TYPES_START + 17)
67 : : #define XML_SC_TYPE_VERTICAL (XML_SC_TYPES_START + 18)
68 : :
69 : : // CTF_SC_HORIJUSTIFY (XML_SC_CTF_START + 1)
70 : : // CTF_SC_HORIJUSTIFY_SOURCE (XML_SC_CTF_START + 2)
71 : : #define CTF_SC_ALLPADDING (XML_SC_CTF_START + 3)
72 : : #define CTF_SC_BOTTOMPADDING (XML_SC_CTF_START + 4)
73 : : #define CTF_SC_LEFTPADDING (XML_SC_CTF_START + 5)
74 : : #define CTF_SC_RIGHTPADDING (XML_SC_CTF_START + 6)
75 : : #define CTF_SC_TOPPADDING (XML_SC_CTF_START + 7)
76 : : #define CTF_SC_ALLBORDER (XML_SC_CTF_START + 8)
77 : : #define CTF_SC_LEFTBORDER (XML_SC_CTF_START + 9)
78 : : #define CTF_SC_RIGHTBORDER (XML_SC_CTF_START + 10)
79 : : #define CTF_SC_TOPBORDER (XML_SC_CTF_START + 11)
80 : : #define CTF_SC_BOTTOMBORDER (XML_SC_CTF_START + 12)
81 : : #define CTF_SC_ALLBORDERWIDTH (XML_SC_CTF_START + 13)
82 : : #define CTF_SC_LEFTBORDERWIDTH (XML_SC_CTF_START + 14)
83 : : #define CTF_SC_RIGHTBORDERWIDTH (XML_SC_CTF_START + 15)
84 : : #define CTF_SC_TOPBORDERWIDTH (XML_SC_CTF_START + 16)
85 : : #define CTF_SC_BOTTOMBORDERWIDTH (XML_SC_CTF_START + 17)
86 : : #define CTF_SC_NUMBERFORMAT (XML_SC_CTF_START + 18)
87 : : #define CTF_SC_MAP (XML_SC_CTF_START + 19)
88 : : // CTF_SC_PARAINDENT (XML_SC_CTF_START + 20)
89 : : // CTF_SC_OLDTEXTBACKGROUND (XML_SC_CTF_START + 21)
90 : : #define CTF_SC_IMPORT_MAP (XML_SC_CTF_START + 22)
91 : : #define CTF_SC_CELLSTYLE (XML_SC_CTF_START + 23)
92 : : #define CTF_SC_VALIDATION (XML_SC_CTF_START + 24)
93 : : #define CTF_SC_DIAGONALTLBR (XML_SC_CTF_START + 25)
94 : : #define CTF_SC_DIAGONALTLBRWIDTH (XML_SC_CTF_START + 26)
95 : : #define CTF_SC_DIAGONALBLTR (XML_SC_CTF_START + 27)
96 : : #define CTF_SC_DIAGONALBLTRWIDTH (XML_SC_CTF_START + 28)
97 : : #define CTF_SC_DIAGONALTLBRWIDTHS (XML_SC_CTF_START + 29)
98 : : #define CTF_SC_DIAGONALBLTRWIDTHS (XML_SC_CTF_START + 30)
99 : :
100 : : #define CTF_SC_ROWHEIGHT (XML_SC_CTF_START + 50)
101 : : #define CTF_SC_ROWOPTIMALHEIGHT (XML_SC_CTF_START + 51)
102 : : #define CTF_SC_ROWBREAKBEFORE (XML_SC_CTF_START + 52)
103 : : #define CTF_SC_ISVISIBLE (XML_SC_CTF_START + 53)
104 : :
105 : : #define CTF_SC_MASTERPAGENAME (XML_SC_CTF_START + 53)
106 : :
107 : : //ColumnStyles
108 : : #define XML_SC_TYPE_BREAKBEFORE (XML_SC_TYPES_START + 50)
109 : :
110 : : class ScXMLExport;
111 : :
112 : : class ScXMLCellExportPropertyMapper : public SvXMLExportPropertyMapper
113 : : {
114 : : protected:
115 : : /** Application-specific filter. By default do nothing. */
116 : : virtual void ContextFilter(
117 : : ::std::vector< XMLPropertyState >& rProperties,
118 : : ::com::sun::star::uno::Reference<
119 : : ::com::sun::star::beans::XPropertySet > rPropSet ) const;
120 : : public:
121 : : ScXMLCellExportPropertyMapper(
122 : : const UniReference< XMLPropertySetMapper >& rMapper );
123 : : virtual ~ScXMLCellExportPropertyMapper();
124 : :
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;
133 : : };
134 : :
135 : : class ScXMLRowExportPropertyMapper : public SvXMLExportPropertyMapper
136 : : {
137 : : protected:
138 : : /** Application-specific filter. By default do nothing. */
139 : : virtual void ContextFilter(
140 : : ::std::vector< XMLPropertyState >& rProperties,
141 : : ::com::sun::star::uno::Reference<
142 : : ::com::sun::star::beans::XPropertySet > rPropSet ) const;
143 : : public:
144 : : ScXMLRowExportPropertyMapper(
145 : : const UniReference< XMLPropertySetMapper >& rMapper );
146 : : virtual ~ScXMLRowExportPropertyMapper();
147 : : };
148 : :
149 : : class ScXMLColumnExportPropertyMapper : public SvXMLExportPropertyMapper
150 : : {
151 : : public:
152 : : ScXMLColumnExportPropertyMapper(
153 : : const UniReference< XMLPropertySetMapper >& rMapper );
154 : : virtual ~ScXMLColumnExportPropertyMapper();
155 : :
156 : : /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
157 : : virtual void handleSpecialItem(
158 : : SvXMLAttributeList& rAttrList,
159 : : const XMLPropertyState& rProperty,
160 : : const SvXMLUnitConverter& rUnitConverter,
161 : : const SvXMLNamespaceMap& rNamespaceMap,
162 : : const ::std::vector< XMLPropertyState > *pProperties = 0,
163 : : sal_uInt32 nIdx = 0 ) const;
164 : : };
165 : :
166 : : class ScXMLTableExportPropertyMapper : public SvXMLExportPropertyMapper
167 : : {
168 : : protected:
169 : : public:
170 : : ScXMLTableExportPropertyMapper(
171 : : const UniReference< XMLPropertySetMapper >& rMapper );
172 : : virtual ~ScXMLTableExportPropertyMapper();
173 : :
174 : : /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
175 : : virtual void handleSpecialItem(
176 : : SvXMLAttributeList& rAttrList,
177 : : const XMLPropertyState& rProperty,
178 : : const SvXMLUnitConverter& rUnitConverter,
179 : : const SvXMLNamespaceMap& rNamespaceMap,
180 : : const ::std::vector< XMLPropertyState > *pProperties = 0,
181 : : sal_uInt32 nIdx = 0 ) const;
182 : : };
183 : :
184 : : class ScXMLAutoStylePoolP : public SvXMLAutoStylePoolP
185 : : {
186 : : ScXMLExport& rScXMLExport;
187 : :
188 : : virtual void exportStyleAttributes(
189 : : SvXMLAttributeList& rAttrList,
190 : : sal_Int32 nFamily,
191 : : const ::std::vector< XMLPropertyState >& rProperties,
192 : : const SvXMLExportPropertyMapper& rPropExp,
193 : : const SvXMLUnitConverter& rUnitConverter,
194 : : const SvXMLNamespaceMap& rNamespaceMap
195 : : ) const;
196 : :
197 : : virtual void exportStyleContent(
198 : : const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > & rHandler,
199 : : sal_Int32 nFamily,
200 : : const ::std::vector< XMLPropertyState >& rProperties,
201 : : const SvXMLExportPropertyMapper& rPropExp
202 : : , const SvXMLUnitConverter& rUnitConverter,
203 : : const SvXMLNamespaceMap& rNamespaceMap
204 : : ) const;
205 : :
206 : : public:
207 : : ScXMLAutoStylePoolP(ScXMLExport& rScXMLExport);
208 : : virtual ~ScXMLAutoStylePoolP();
209 : : };
210 : :
211 : : class ScXMLStyleExport : public XMLStyleExport
212 : : {
213 : : virtual void exportStyleAttributes(
214 : : const ::com::sun::star::uno::Reference<
215 : : ::com::sun::star::style::XStyle > & rStyle );
216 : : virtual void exportStyleContent(
217 : : const ::com::sun::star::uno::Reference<
218 : : ::com::sun::star::style::XStyle > & rStyle );
219 : : public:
220 : : ScXMLStyleExport(
221 : : SvXMLExport& rExp,
222 : : const ::rtl::OUString& rPoolStyleName,
223 : : SvXMLAutoStylePoolP *pAutoStyleP=0 );
224 : : virtual ~ScXMLStyleExport();
225 : : };
226 : :
227 : : class XMLScPropHdlFactory : public XMLPropertyHandlerFactory
228 : : {
229 : : public:
230 : : XMLScPropHdlFactory();
231 : : virtual ~XMLScPropHdlFactory();
232 : : virtual const XMLPropertyHandler* GetPropertyHandler( sal_Int32 nType ) const;
233 : : };
234 : :
235 : 400 : class XmlScPropHdl_CellProtection : public XMLPropertyHandler
236 : : {
237 : : public:
238 : : virtual ~XmlScPropHdl_CellProtection();
239 : : virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const;
240 : : virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
241 : : virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
242 : : };
243 : :
244 : 400 : class XmlScPropHdl_PrintContent : public XMLPropertyHandler
245 : : {
246 : : public:
247 : : virtual ~XmlScPropHdl_PrintContent();
248 : : virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const;
249 : : virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
250 : : virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
251 : : };
252 : :
253 : 800 : class XmlScPropHdl_JustifyMethod : public XMLPropertyHandler
254 : : {
255 : : public:
256 : : virtual ~XmlScPropHdl_JustifyMethod();
257 : : virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const;
258 : : virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
259 : : virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
260 : : };
261 : :
262 : 400 : class XmlScPropHdl_HoriJustify : public XMLPropertyHandler
263 : : {
264 : : public:
265 : : virtual ~XmlScPropHdl_HoriJustify();
266 : : virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const;
267 : : virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
268 : : virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
269 : : };
270 : :
271 : 400 : class XmlScPropHdl_HoriJustifySource : public XMLPropertyHandler
272 : : {
273 : : public:
274 : : virtual ~XmlScPropHdl_HoriJustifySource();
275 : : virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const;
276 : : virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
277 : : virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
278 : : };
279 : :
280 : 400 : class XmlScPropHdl_HoriJustifyRepeat : public XMLPropertyHandler
281 : : {
282 : : public:
283 : : virtual ~XmlScPropHdl_HoriJustifyRepeat();
284 : : virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const;
285 : : virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
286 : : virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
287 : : };
288 : :
289 : 400 : class XmlScPropHdl_Orientation : public XMLPropertyHandler
290 : : {
291 : : public:
292 : : virtual ~XmlScPropHdl_Orientation();
293 : : virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const;
294 : : virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
295 : : virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
296 : : };
297 : :
298 : 400 : class XmlScPropHdl_RotateAngle : public XMLPropertyHandler
299 : : {
300 : : public:
301 : : virtual ~XmlScPropHdl_RotateAngle();
302 : : virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const;
303 : : virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
304 : : virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
305 : : };
306 : :
307 : 400 : class XmlScPropHdl_RotateReference : public XMLPropertyHandler
308 : : {
309 : : public:
310 : : virtual ~XmlScPropHdl_RotateReference();
311 : : virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const;
312 : : virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
313 : : virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
314 : : };
315 : :
316 : 400 : class XmlScPropHdl_VertJustify : public XMLPropertyHandler
317 : : {
318 : : public:
319 : : virtual ~XmlScPropHdl_VertJustify();
320 : : virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const;
321 : : virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
322 : : virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
323 : : };
324 : :
325 : 400 : class XmlScPropHdl_BreakBefore : public XMLPropertyHandler
326 : : {
327 : : public:
328 : : virtual ~XmlScPropHdl_BreakBefore();
329 : : virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const;
330 : : virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
331 : : virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
332 : : };
333 : :
334 : 400 : class XmlScPropHdl_IsTextWrapped : public XMLPropertyHandler
335 : : {
336 : : public:
337 : : virtual ~XmlScPropHdl_IsTextWrapped();
338 : : virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const;
339 : : virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
340 : : virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
341 : : };
342 : :
343 : 400 : class XmlScPropHdl_IsEqual : public XMLPropertyHandler
344 : : {
345 : : public:
346 [ - + ]: 800 : virtual ~XmlScPropHdl_IsEqual() {}
347 : 0 : virtual bool equals( const ::com::sun::star::uno::Any& /* r1 */, const ::com::sun::star::uno::Any& /* r2 */ ) const { return sal_True; }
348 : : virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
349 : : virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
350 : : };
351 : :
352 : 400 : class XmlScPropHdl_Vertical : public XMLPropertyHandler
353 : : {
354 : : public:
355 : : virtual ~XmlScPropHdl_Vertical();
356 : : virtual bool equals( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 ) const;
357 : : virtual sal_Bool importXML( const ::rtl::OUString& rStrImpValue, ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
358 : : virtual sal_Bool exportXML( ::rtl::OUString& rStrExpValue, const ::com::sun::star::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const;
359 : : };
360 : :
361 : : #endif
362 : :
363 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|