Move setting of LD_LIBRARY_PATH closer to invocation of cppunittester
[LibreOffice.git] / xmloff / inc / xmlbahdl.hxx
blob7736d6d2f4324036d552da8776471e6be17bac34
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 #pragma once
22 #include <xmloff/xmlprhdl.hxx>
23 #include <xmloff/xmltoken.hxx>
26 /**
27 PropertyHandler for the XML-data-type: XML_TYPE_NUMBER
29 class XMLNumberPropHdl : public XMLPropertyHandler
31 sal_Int8 nBytes;
33 public:
34 explicit XMLNumberPropHdl( sal_Int8 nB ) : nBytes( nB ) {}
35 virtual ~XMLNumberPropHdl() override;
37 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
38 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
41 /**
42 PropertyHandler for the XML-data-type: XML_TYPE_NUMBER_NONE
44 class XMLNumberNonePropHdl : public XMLPropertyHandler
46 OUString sZeroStr;
47 sal_Int8 nBytes;
48 public:
49 explicit XMLNumberNonePropHdl( sal_Int8 nB = 4 );
50 XMLNumberNonePropHdl( enum ::xmloff::token::XMLTokenEnum eZeroString, sal_Int8 nB );
51 virtual ~XMLNumberNonePropHdl() override;
53 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
54 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
57 /**
58 PropertyHandler for the XML-data-type: XML_TYPE_MEASURE
60 class XMLMeasurePropHdl : public XMLPropertyHandler
62 sal_Int8 nBytes;
63 public:
64 explicit XMLMeasurePropHdl( sal_Int8 nB ) : nBytes( nB ) {}
65 virtual ~XMLMeasurePropHdl() override;
67 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
68 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
71 /**
72 PropertyHandler for the XML-data-type: XML_TYPE_UNIT_MEASURE
74 class XMLUnitMeasurePropHdl : public XMLPropertyHandler
76 public:
77 bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
78 bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
81 /**
82 PropertyHandler for the XML-data-type: XML_TYPE_PERCENT
84 class XMLPercentPropHdl : public XMLPropertyHandler
86 sal_Int8 nBytes;
87 public:
88 explicit XMLPercentPropHdl( sal_Int8 nB ) : nBytes( nB ) {}
89 virtual ~XMLPercentPropHdl() override;
91 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
92 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
95 /**
96 PropertyHandler for the XML-data-type: XML_TYPE_PERCENT
97 that is mapped on a double from 0.0 to 1.0
99 class XMLDoublePercentPropHdl : public XMLPropertyHandler
101 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
102 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
105 /// Maps between XML percentage and our 100th percent ints.
106 class XML100thPercentPropHdl : public XMLPropertyHandler
108 virtual bool importXML(const OUString& rStrImpValue, css::uno::Any& rValue,
109 const SvXMLUnitConverter& rUnitConverter) const override;
110 virtual bool exportXML(OUString& rStrExpValue, const css::uno::Any& rValue,
111 const SvXMLUnitConverter& rUnitConverter) const override;
115 PropertyHandler for the XML-data-type: XML_TYPE_NEG_PERCENT
117 class XMLNegPercentPropHdl : public XMLPropertyHandler
119 sal_Int8 nBytes;
120 public:
121 explicit XMLNegPercentPropHdl( sal_Int8 nB ) : nBytes( nB ) {}
122 virtual ~XMLNegPercentPropHdl() override;
124 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
125 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
129 PropertyHandler for the XML-data-type: XML_TYPE_PERCENT
131 class XMLMeasurePxPropHdl : public XMLPropertyHandler
133 sal_Int8 nBytes;
134 public:
135 explicit XMLMeasurePxPropHdl( sal_Int8 nB ) : nBytes( nB ) {}
136 virtual ~XMLMeasurePxPropHdl() override;
138 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
139 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
143 PropertyHandler for the XML-data-type: XML_TYPE_BOOL
145 class XMLBoolPropHdl : public XMLPropertyHandler
147 public:
148 virtual ~XMLBoolPropHdl() override;
150 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
151 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
154 class XMLBoolFalsePropHdl : public XMLBoolPropHdl
156 public:
157 virtual ~XMLBoolFalsePropHdl() override;
159 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
160 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
165 PropertyHandler for the XML-data-type: XML_TYPE_COLOR
167 class XMLColorPropHdl : public XMLPropertyHandler
169 public:
170 virtual ~XMLColorPropHdl() override;
172 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
173 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
177 PropertyHandler for the XML-data-type: XML_TYPE_HEX
179 class XMLHexPropHdl : public XMLPropertyHandler
181 public:
182 virtual ~XMLHexPropHdl() override;
184 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
185 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
189 PropertyHandler for the XML-data-type: XML_TYPE_STRING
191 class XMLStringPropHdl : public XMLPropertyHandler
193 public:
194 virtual ~XMLStringPropHdl() override;
196 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
197 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
201 PropertyHandler for the XML-data-type: XML_TYPE_STYLENAME
203 class XMLStyleNamePropHdl : public XMLStringPropHdl
205 public:
206 virtual ~XMLStyleNamePropHdl() override;
208 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
213 PropertyHandler for the XML-data-type: XML_TYPE_DOUBLE
215 class XMLDoublePropHdl : public XMLPropertyHandler
217 public:
218 virtual ~XMLDoublePropHdl() 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;
225 PropertyHandler for the XML-data-type: XML_TYPE_NBOOL
227 class XMLNBoolPropHdl : public XMLPropertyHandler
229 public:
230 virtual ~XMLNBoolPropHdl() override;
232 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
233 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
237 PropertyHandler for the XML-data-type: XML_TYPE_COLORTRANSPARENT
239 class XMLColorTransparentPropHdl : public XMLPropertyHandler
241 const OUString sTransparent;
243 public:
244 explicit XMLColorTransparentPropHdl( enum ::xmloff::token::XMLTokenEnum eTransparent = xmloff::token::XML_TOKEN_INVALID );
245 virtual ~XMLColorTransparentPropHdl() 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;
252 PropertyHandler for the XML-data-type: XML_TYPE_ISTRANSPARENT
254 class XMLIsTransparentPropHdl : public XMLPropertyHandler
256 const OUString sTransparent;
257 bool bTransPropValue;
259 public:
260 XMLIsTransparentPropHdl( enum ::xmloff::token::XMLTokenEnum eTransparent = xmloff::token::XML_TOKEN_INVALID,
261 bool bTransPropValue = true );
262 virtual ~XMLIsTransparentPropHdl() override;
264 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
265 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
269 PropertyHandler for the XML-data-type: XML_TYPE_COLORAUTO
271 class XMLColorAutoPropHdl : public XMLPropertyHandler
273 public:
274 XMLColorAutoPropHdl();
275 virtual ~XMLColorAutoPropHdl() override;
277 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
278 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
282 PropertyHandler for the XML-data-type: XML_TYPE_COLORISAUTO
284 class XMLIsAutoColorPropHdl : public XMLPropertyHandler
286 public:
287 XMLIsAutoColorPropHdl();
288 virtual ~XMLIsAutoColorPropHdl() override;
290 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
291 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
296 PropertyHandler for properties that cannot make use of importXML
297 and exportXML methods, but can make use of the default comparison
299 class XMLCompareOnlyPropHdl : public XMLPropertyHandler
301 public:
302 virtual ~XMLCompareOnlyPropHdl() override;
304 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
305 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
309 PropertyHandler for the XML-data-type: XML_TYPE_NUMBER_NO_ZERO
310 Reads/writes numeric properties, but fails for the value zero
311 (i.e., a value 0 property will not be written)
313 class XMLNumberWithoutZeroPropHdl : public XMLPropertyHandler
315 sal_Int8 nBytes;
316 public:
317 explicit XMLNumberWithoutZeroPropHdl( sal_Int8 nB );
318 virtual ~XMLNumberWithoutZeroPropHdl() override;
320 virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
321 virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override;
324 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */