LibreOffice Module xmloff (master) 1
xmlexppr.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_XMLOFF_XMLEXPPR_HXX
21#define INCLUDED_XMLOFF_XMLEXPPR_HXX
22
23#include <sal/config.h>
24#include <xmloff/dllapi.h>
28#include <rtl/ustring.hxx>
29#include <com/sun/star/uno/Sequence.hxx>
30
31#include <memory>
32#include <vector>
33
34namespace com::sun::star::uno { template <typename > class Reference; }
35namespace com::sun::star::beans { class XPropertySet; }
36namespace rtl { template <class reference_type> class Reference; }
37
39struct XMLPropertyState;
40
41enum class SvXmlExportFlags {
42 NONE = 0x0000,
43 IGN_WS = 0x0008
44};
45namespace o3tl
46{
47 template<> struct typed_flags<SvXmlExportFlags> : is_typed_flags<SvXmlExportFlags, 0x08> {};
48}
49
51namespace comphelper { class AttributeList; }
53class SvXMLExport;
54
56{
57 struct Impl;
58 std::unique_ptr<Impl> mpImpl;
59
60protected:
61
68 std::vector<XMLPropertyState> Filter_(
69 SvXMLExport const& rExport,
70 const css::uno::Reference<css::beans::XPropertySet>& rPropSet,
71 bool bDefault, bool bDisableFoFontFamily,
72 const css::uno::Sequence<OUString>* pOnlyTheseProps ) const;
73
75 virtual void ContextFilter(
76 bool bEnableFoFontFamily,
77 ::std::vector< XMLPropertyState >& rProperties,
78 const css::uno::Reference<css::beans::XPropertySet >& rPropSet ) const;
79
81 void _exportXML( sal_uInt16 nPropType, sal_uInt16& rPropTypeFlags,
83 const ::std::vector< XMLPropertyState >& rProperties,
84 const SvXMLUnitConverter& rUnitConverter,
85 const SvXMLNamespaceMap& rNamespaceMap,
86 std::vector<sal_uInt16>* pIndexArray,
87 sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx ) const;
88
89 void _exportXML( comphelper::AttributeList& rAttrList,
90 const XMLPropertyState& rProperty,
91 const SvXMLUnitConverter& rUnitConverter,
92 const SvXMLNamespaceMap& rNamespaceMap,
93 const ::std::vector< XMLPropertyState > *pProperties,
94 sal_uInt32 nIdx ) const;
95
96 void exportElementItems(
97 SvXMLExport& rExport,
98 const ::std::vector< XMLPropertyState >& rProperties,
99 SvXmlExportFlags nFlags,
100 const std::vector<sal_uInt16>& rIndexArray ) const;
101
102public:
103
106 virtual ~SvXMLExportPropertyMapper() override;
107
108 // Add a ExportPropertyMapper at the end of the import mapper chain.
109 // The added mapper MUST not be used outside the Mapper chain any longer,
110 // because its PropertyMapper will be replaced.
111 void ChainExportMapper(
113
120 std::vector<XMLPropertyState> Filter(
121 SvXMLExport const& rExport,
122 const css::uno::Reference<css::beans::XPropertySet>& rPropSet,
123 bool bEnableFoFontFamily = false,
124 const css::uno::Sequence<OUString>* pOnlyTheseProps = nullptr ) const;
125
131 std::vector<XMLPropertyState> FilterDefaults(
132 SvXMLExport const& rExport,
133 const css::uno::Reference<css::beans::XPropertySet>& rPropSet ) const;
134
137 bool LessPartial( const ::std::vector< XMLPropertyState >& aProperties1,
138 const ::std::vector< XMLPropertyState >& aProperties2 ) const;
139
141 bool Equals( const ::std::vector< XMLPropertyState >& aProperties1,
142 const ::std::vector< XMLPropertyState >& aProperties2 ) const;
143 void exportXML(
144 SvXMLExport& rExport,
145 const ::std::vector< XMLPropertyState >& rProperties,
146 SvXmlExportFlags nFlags,
147 bool bUseExtensionNamespaceForGraphicProperties = false ) const;
148
154 void exportXML(
155 SvXMLExport& rExport,
156 const ::std::vector< XMLPropertyState >& rProperties,
157 sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx,
158 SvXmlExportFlags nFlags, bool bExtensionNamespace = false ) const;
159
162 virtual void handleElementItem(
163 SvXMLExport& rExport,
164 const XMLPropertyState& rProperty,
165 SvXmlExportFlags nFlags,
166 const ::std::vector< XMLPropertyState > *pProperties,
167 sal_uInt32 nIdx ) const;
168
171 virtual void handleSpecialItem(
172 comphelper::AttributeList& rAttrList,
173 const XMLPropertyState& rProperty,
174 const SvXMLUnitConverter& rUnitConverter,
175 const SvXMLNamespaceMap& rNamespaceMap,
176 const ::std::vector< XMLPropertyState > *pProperties,
177 sal_uInt32 nIdx ) const;
178
179 const rtl::Reference<XMLPropertySetMapper>& getPropertySetMapper() const;
180
181 void SetStyleName( const OUString& rStyleName );
182 const OUString& GetStyleName() const;
183
184 void GetEntryAPINames(o3tl::sorted_vector<OUString>& rNames) const;
185};
186
187#endif // INCLUDED_XMLOFF_XMLEXPPR_HXX
188
189/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< Impl > mpImpl
Definition: xmlexppr.hxx:57
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
Definition: xmluconv.hxx:83
#define XMLOFF_DLLPUBLIC
Definition: dllapi.h:29
NONE
XMLOFF_DLLPUBLIC void exportXML(OUString const &rStrName, css::uno::Any const &rValue, SvXMLExport &rExport)
class SAL_NO_VTABLE XPropertySet
Reference
Smart struct to transport an Any with an index to the appropriate property-name.
Definition: maptype.hxx:140
SvXmlExportFlags
Definition: xmlexppr.hxx:41