tdf#161878 Ignore nested SYMBOL field inside IF field
[LibreOffice.git] / include / xmloff / XMLConstantsPropertyHandler.hxx
blob5fc6f735a8a8251bb550471c5c5aa40a3456d35c
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_XMLOFF_XMLCONSTANTSPROPERTYHANDLER_HXX
21 #define INCLUDED_XMLOFF_XMLCONSTANTSPROPERTYHANDLER_HXX
23 #include <config_options.h>
24 #include <sal/config.h>
25 #include <xmloff/dllapi.h>
26 #include <xmloff/xmlprhdl.hxx>
27 #include <xmloff/xmltoken.hxx>
29 template<typename EnumT>
30 struct SvXMLEnumMapEntry;
33 /** Abstract base-class for different XML-types. Derivations of this class
34 knows how to compare, im/export a special XML-type
36 class UNLESS_MERGELIBS_MORE(XMLOFF_DLLPUBLIC) XMLConstantsPropertyHandler: public XMLPropertyHandler
38 const SvXMLEnumMapEntry<sal_uInt16> *m_pMap;
39 const enum ::xmloff::token::XMLTokenEnum m_eDefault;
41 public:
42 template<typename EnumT>
43 XMLConstantsPropertyHandler( const SvXMLEnumMapEntry<EnumT> *pM,
44 enum ::xmloff::token::XMLTokenEnum eDflt)
45 : m_pMap(reinterpret_cast<const SvXMLEnumMapEntry<sal_uInt16>*>(pM)), m_eDefault(eDflt) {}
47 // Just needed for virtual destruction
48 virtual ~XMLConstantsPropertyHandler() override;
50 /// Imports the given value in case of the given XML-data-type
51 virtual bool importXML(
52 const OUString& rStrImpValue,
53 css::uno::Any& rValue,
54 const SvXMLUnitConverter& rUnitConverter ) const override final;
56 /// Exports the given value in case of the given XML-data-type
57 virtual bool exportXML(
58 OUString& rStrExpValue,
59 const css::uno::Any& rValue,
60 const SvXMLUnitConverter& rUnitConverter ) const override final;
63 #endif // INCLUDED_XMLOFF_XMLCONSTANTSPROPERTYHANDLER_HXX
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */