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 { namespace sun { namespace star { namespace uno { template <typename > class Reference; } } } }
33 namespace com { namespace sun { namespace star { namespace 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  const css::uno::Reference<css::beans::XPropertySet>& rPropSet,
68  bool bDefault, bool bDisableFoFontFamily ) const;
69 
71  virtual void ContextFilter(
72  bool bEnableFoFontFamily,
73  ::std::vector< XMLPropertyState >& rProperties,
74  const css::uno::Reference<css::beans::XPropertySet >& rPropSet ) const;
75 
77  void _exportXML( sal_uInt16 nPropType, sal_uInt16& rPropTypeFlags,
78  SvXMLAttributeList& rAttrList,
79  const ::std::vector< XMLPropertyState >& rProperties,
80  const SvXMLUnitConverter& rUnitConverter,
81  const SvXMLNamespaceMap& rNamespaceMap,
82  std::vector<sal_uInt16>* pIndexArray,
83  sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx ) const;
84 
85  void _exportXML( SvXMLAttributeList& rAttrList,
86  const XMLPropertyState& rProperty,
87  const SvXMLUnitConverter& rUnitConverter,
88  const SvXMLNamespaceMap& rNamespaceMap,
89  const ::std::vector< XMLPropertyState > *pProperties,
90  sal_uInt32 nIdx ) const;
91 
92  void exportElementItems(
94  const ::std::vector< XMLPropertyState >& rProperties,
95  SvXmlExportFlags nFlags,
96  const std::vector<sal_uInt16>& rIndexArray ) const;
97 
98 public:
99 
102  virtual ~SvXMLExportPropertyMapper() override;
103 
104  // Add a ExportPropertyMapper at the end of the import mapper chain.
105  // The added mapper MUST not be used outside the Mapper chain any longer,
106  // because its PropertyMapper will be replaced.
107  void ChainExportMapper(
109 
116  std::vector<XMLPropertyState> Filter(
117  const css::uno::Reference<css::beans::XPropertySet>& rPropSet, bool bEnableFoFontFamily = false ) const;
118 
124  std::vector<XMLPropertyState> FilterDefaults(
125  const css::uno::Reference<css::beans::XPropertySet>& rPropSet ) const;
126 
129  bool LessPartial( const ::std::vector< XMLPropertyState >& aProperties1,
130  const ::std::vector< XMLPropertyState >& aProperties2 ) const;
131 
133  bool Equals( const ::std::vector< XMLPropertyState >& aProperties1,
134  const ::std::vector< XMLPropertyState >& aProperties2 ) const;
135  void exportXML(
137  const ::std::vector< XMLPropertyState >& rProperties,
138  SvXmlExportFlags nFlags,
139  bool bUseExtensionNamespaceForGraphicProperties = false ) const;
140 
146  void exportXML(
148  const ::std::vector< XMLPropertyState >& rProperties,
149  sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx,
150  SvXmlExportFlags nFlags, bool bExtensionNamespace = false ) const;
151 
154  virtual void handleElementItem(
156  const XMLPropertyState& rProperty,
157  SvXmlExportFlags nFlags,
158  const ::std::vector< XMLPropertyState > *pProperties,
159  sal_uInt32 nIdx ) const;
160 
163  virtual void handleSpecialItem(
164  SvXMLAttributeList& rAttrList,
165  const XMLPropertyState& rProperty,
166  const SvXMLUnitConverter& rUnitConverter,
167  const SvXMLNamespaceMap& rNamespaceMap,
168  const ::std::vector< XMLPropertyState > *pProperties,
169  sal_uInt32 nIdx ) const;
170 
171  const rtl::Reference<XMLPropertySetMapper>& getPropertySetMapper() const;
172 
173  void SetStyleName( const OUString& rStyleName );
174  const OUString& GetStyleName() const;
175 };
176 
177 #endif // INCLUDED_XMLOFF_XMLEXPPR_HXX
178 
179 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
Definition: xmluconv.hxx:77
Reference
#file
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:104
css::uno::Any const SvXMLExport & rExport
Definition: ImageStyle.hxx:38
#define XMLOFF_DLLPUBLIC
Definition: dllapi.h:29