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>
26 #include <o3tl/typed_flags_set.hxx>
27 #include <rtl/ustring.hxx>
28 
29 #include <memory>
30 #include <vector>
31 
32 namespace com::sun::star::uno { template <typename > class Reference; }
33 namespace com::sun::star::beans { class XPropertySet; }
34 namespace rtl { template <class reference_type> class Reference; }
35 
37 struct XMLPropertyState;
38 
39 enum class SvXmlExportFlags {
40  NONE = 0x0000,
41  IGN_WS = 0x0008
42 };
43 namespace o3tl
44 {
45  template<> struct typed_flags<SvXmlExportFlags> : is_typed_flags<SvXmlExportFlags, 0x08> {};
46 }
47 
48 class SvXMLUnitConverter;
49 class SvXMLAttributeList;
50 class SvXMLNamespaceMap;
51 class SvXMLExport;
52 
54 {
55  struct Impl;
56  std::unique_ptr<Impl> mpImpl;
57 
58 protected:
59 
66  std::vector<XMLPropertyState> Filter_(
67  SvXMLExport const& rExport,
68  const css::uno::Reference<css::beans::XPropertySet>& rPropSet,
69  bool bDefault, bool bDisableFoFontFamily ) const;
70 
72  virtual void ContextFilter(
73  bool bEnableFoFontFamily,
74  ::std::vector< XMLPropertyState >& rProperties,
75  const css::uno::Reference<css::beans::XPropertySet >& rPropSet ) const;
76 
78  void _exportXML( sal_uInt16 nPropType, sal_uInt16& rPropTypeFlags,
79  SvXMLAttributeList& rAttrList,
80  const ::std::vector< XMLPropertyState >& rProperties,
81  const SvXMLUnitConverter& rUnitConverter,
82  const SvXMLNamespaceMap& rNamespaceMap,
83  std::vector<sal_uInt16>* pIndexArray,
84  sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx ) const;
85 
86  void _exportXML( SvXMLAttributeList& rAttrList,
87  const XMLPropertyState& rProperty,
88  const SvXMLUnitConverter& rUnitConverter,
89  const SvXMLNamespaceMap& rNamespaceMap,
90  const ::std::vector< XMLPropertyState > *pProperties,
91  sal_uInt32 nIdx ) const;
92 
93  void exportElementItems(
94  SvXMLExport& rExport,
95  const ::std::vector< XMLPropertyState >& rProperties,
96  SvXmlExportFlags nFlags,
97  const std::vector<sal_uInt16>& rIndexArray ) const;
98 
99 public:
100 
103  virtual ~SvXMLExportPropertyMapper() override;
104 
105  // Add a ExportPropertyMapper at the end of the import mapper chain.
106  // The added mapper MUST not be used outside the Mapper chain any longer,
107  // because its PropertyMapper will be replaced.
108  void ChainExportMapper(
110 
117  std::vector<XMLPropertyState> Filter(
118  SvXMLExport const& rExport,
119  const css::uno::Reference<css::beans::XPropertySet>& rPropSet, bool bEnableFoFontFamily = false ) const;
120 
126  std::vector<XMLPropertyState> FilterDefaults(
127  SvXMLExport const& rExport,
128  const css::uno::Reference<css::beans::XPropertySet>& rPropSet ) const;
129 
132  bool LessPartial( const ::std::vector< XMLPropertyState >& aProperties1,
133  const ::std::vector< XMLPropertyState >& aProperties2 ) const;
134 
136  bool Equals( const ::std::vector< XMLPropertyState >& aProperties1,
137  const ::std::vector< XMLPropertyState >& aProperties2 ) const;
138  void exportXML(
139  SvXMLExport& rExport,
140  const ::std::vector< XMLPropertyState >& rProperties,
141  SvXmlExportFlags nFlags,
142  bool bUseExtensionNamespaceForGraphicProperties = false ) const;
143 
149  void exportXML(
150  SvXMLExport& rExport,
151  const ::std::vector< XMLPropertyState >& rProperties,
152  sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx,
153  SvXmlExportFlags nFlags, bool bExtensionNamespace = false ) const;
154 
157  virtual void handleElementItem(
158  SvXMLExport& rExport,
159  const XMLPropertyState& rProperty,
160  SvXmlExportFlags nFlags,
161  const ::std::vector< XMLPropertyState > *pProperties,
162  sal_uInt32 nIdx ) const;
163 
166  virtual void handleSpecialItem(
167  SvXMLAttributeList& rAttrList,
168  const XMLPropertyState& rProperty,
169  const SvXMLUnitConverter& rUnitConverter,
170  const SvXMLNamespaceMap& rNamespaceMap,
171  const ::std::vector< XMLPropertyState > *pProperties,
172  sal_uInt32 nIdx ) const;
173 
174  const rtl::Reference<XMLPropertySetMapper>& getPropertySetMapper() const;
175 
176  void SetStyleName( const OUString& rStyleName );
177  const OUString& GetStyleName() const;
178 };
179 
180 #endif // INCLUDED_XMLOFF_XMLEXPPR_HXX
181 
182 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
Definition: xmluconv.hxx:82
Reference
XMLOFF_DLLPUBLIC void exportXML(OUString const &rStrName, css::uno::Any const &rValue, SvXMLExport &rExport)
class SAL_NO_VTABLE XPropertySet
std::unique_ptr< Impl > mpImpl
Definition: xmlexppr.hxx:55
SvXmlExportFlags
Definition: xmlexppr.hxx:39
Smart struct to transport an Any with an index to the appropriate property-name.
Definition: maptype.hxx:122
#define XMLOFF_DLLPUBLIC
Definition: dllapi.h:29