Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / xmloff / controlpropertyhdl.hxx
blobedcbd476f915a5afba5b826f019588f8647317ca
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_CONTROLPROPERTYHDL_HXX
21 #define INCLUDED_XMLOFF_CONTROLPROPERTYHDL_HXX
23 #include <sal/config.h>
25 #include <memory>
27 #include <xmloff/dllapi.h>
28 #include <xmloff/prhdlfac.hxx>
29 #include <rtl/ref.hxx>
30 #include <rtl/ustring.hxx>
31 #include <xmloff/xmlexppr.hxx>
32 #include <xmloff/XMLConstantsPropertyHandler.hxx>
34 template<typename EnumT> struct SvXMLEnumMapEntry;
35 class Color;
37 namespace xmloff
41 class IFormsExportContext;
42 class OFormLayerXMLImport_Impl;
45 //= ORotationAngleHandler
47 class ORotationAngleHandler : public XMLPropertyHandler
49 public:
50 ORotationAngleHandler();
52 virtual bool importXML( const OUString& _rStrImpValue, css::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const override;
53 virtual bool exportXML( OUString& _rStrExpValue, const css::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const override;
57 //= OFontWidthHandler
59 class OFontWidthHandler : public XMLPropertyHandler
61 public:
62 OFontWidthHandler();
64 virtual bool importXML( const OUString& _rStrImpValue, css::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const override;
65 virtual bool exportXML( OUString& _rStrExpValue, const css::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const override;
69 //= OControlBorderHandlerBase
71 class OControlBorderHandler : public XMLPropertyHandler
73 public:
74 enum BorderFacet
76 STYLE,
77 COLOR
80 OControlBorderHandler( const BorderFacet _eFacet );
82 virtual bool importXML( const OUString& _rStrImpValue, css::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const override;
83 virtual bool exportXML( OUString& _rStrExpValue, const css::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const override;
85 private:
86 BorderFacet m_eFacet;
90 //= OControlTextEmphasisHandler
92 class OControlTextEmphasisHandler : public XMLPropertyHandler
94 public:
95 OControlTextEmphasisHandler();
97 virtual bool importXML( const OUString& _rStrImpValue, css::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const override;
98 virtual bool exportXML( OUString& _rStrExpValue, const css::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const override;
102 //= ImageScaleModeHandler
104 class XMLOFF_DLLPUBLIC ImageScaleModeHandler : public XMLConstantsPropertyHandler
106 public:
107 ImageScaleModeHandler();
111 //= OControlPropertyHandlerFactory
113 class XMLOFF_DLLPUBLIC OControlPropertyHandlerFactory : public XMLPropertyHandlerFactory
115 mutable std::unique_ptr<XMLConstantsPropertyHandler> m_pTextAlignHandler;
116 mutable std::unique_ptr<OControlBorderHandler> m_pControlBorderStyleHandler;
117 mutable std::unique_ptr<OControlBorderHandler> m_pControlBorderColorHandler;
118 mutable std::unique_ptr<ORotationAngleHandler> m_pRotationAngleHandler;
119 mutable std::unique_ptr<OFontWidthHandler> m_pFontWidthHandler;
120 mutable std::unique_ptr<XMLConstantsPropertyHandler> m_pFontEmphasisHandler;
121 mutable std::unique_ptr<XMLConstantsPropertyHandler> m_pFontReliefHandler;
123 public:
124 OControlPropertyHandlerFactory();
126 virtual const XMLPropertyHandler* GetPropertyHandler(sal_Int32 _nType) const override;
130 } // namespace xmloff
133 #endif // INCLUDED_XMLOFF_CONTROLPROPERTYHDL_HXX
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */