LibreOffice Module sw (master)  1
xmlexpit.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_SW_SOURCE_FILTER_XML_XMLEXPIT_HXX
21 #define INCLUDED_SW_SOURCE_FILTER_XML_XMLEXPIT_HXX
22 
23 #include <xmloff/xmlexppr.hxx>
24 #include "xmlitmap.hxx"
25 #include <vector>
26 
27 class SvXMLUnitConverter;
28 class SfxPoolItem;
29 class SfxItemSet;
30 class SvXMLAttributeList;
31 class SvXMLNamespaceMap;
32 class SvXMLExport;
33 
35 {
36 protected:
38 
40  void exportXML( const SvXMLExport& rExport,
41  SvXMLAttributeList& rAttrList,
42  const SfxItemSet& rSet,
43  const SvXMLUnitConverter& rUnitConverter,
44  const SvXMLNamespaceMap& rNamespaceMap,
45  std::vector<sal_uInt16> *pIndexArray ) const;
46 
47  void exportXML( const SvXMLExport& rExport,
48  SvXMLAttributeList& rAttrList,
49  const SfxPoolItem& rItem,
50  const SvXMLItemMapEntry &rEntry,
51  const SvXMLUnitConverter& rUnitConverter,
52  const SvXMLNamespaceMap& rNamespaceMap,
53  const SfxItemSet *pSet ) const;
54 
55  void exportElementItems( SvXMLExport& rExport,
56  const SvXMLUnitConverter& rUnitConverter,
57  const SfxItemSet &rSet,
58  SvXmlExportFlags nFlags,
59  const std::vector<sal_uInt16> &rIndexArray ) const;
60 
61  static const SfxPoolItem* GetItem( const SfxItemSet &rSet,
62  sal_uInt16 nWhichId );
63 
64 public:
65  explicit SvXMLExportItemMapper( SvXMLItemMapEntriesRef rMapEntries );
66  virtual ~SvXMLExportItemMapper();
67 
68  void exportXML( SvXMLExport& rExport,
69  const SfxItemSet& rSet,
70  const SvXMLUnitConverter& rUnitConverter,
71  ::xmloff::token::XMLTokenEnum ePropToken ) const;
72 
75  virtual void handleSpecialItem( SvXMLAttributeList& rAttrList,
76  const SvXMLItemMapEntry& rEntry,
77  const SfxPoolItem& rItem,
78  const SvXMLUnitConverter& rUnitConverter,
79  const SvXMLNamespaceMap& rNamespaceMap,
80  const SfxItemSet *pSet ) const;
81 
84  virtual void handleElementItem( SvXMLExport& rExport,
85  const SvXMLItemMapEntry& rEntry,
86  const SfxPoolItem& rItem,
87  const SvXMLUnitConverter& rUnitConverter,
88  const SfxItemSet& rSet,
89  SvXmlExportFlags nFlags ) const;
90 
91  inline void setMapEntries( SvXMLItemMapEntriesRef rMapEntries );
92 
93  static bool QueryXMLValue( const SfxPoolItem& rItem,
94  OUString& rValue, sal_uInt16 nMemberId,
95  const SvXMLUnitConverter& rUnitConverter );
96 };
97 
98 inline void
100 {
101  mrMapEntries = rMapEntries;
102 }
103 
104 #endif // INCLUDED_SW_SOURCE_FILTER_XML_XMLEXPIT_HXX
105 
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvXMLExportItemMapper(SvXMLItemMapEntriesRef rMapEntries)
Definition: xmlexpit.cxx:292
virtual ~SvXMLExportItemMapper()
Definition: xmlexpit.cxx:297
virtual void handleSpecialItem(SvXMLAttributeList &rAttrList, const SvXMLItemMapEntry &rEntry, const SfxPoolItem &rItem, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap, const SfxItemSet *pSet) const
this method is called for every item that has the MID_SW_FLAG_SPECIAL_ITEM_EXPORT flag set ...
Definition: xmlexpit.cxx:324
static const SfxPoolItem * GetItem(const SfxItemSet &rSet, sal_uInt16 nWhichId)
returns the item with the given WhichId from the given ItemSet if its set
Definition: xmlexpit.cxx:275
SvXMLItemMapEntriesRef mrMapEntries
Definition: xmlexpit.hxx:37
static bool QueryXMLValue(const SfxPoolItem &rItem, OUString &rValue, sal_uInt16 nMemberId, const SvXMLUnitConverter &rUnitConverter)
Definition: xmlexpit.cxx:367
void exportElementItems(SvXMLExport &rExport, const SvXMLUnitConverter &rUnitConverter, const SfxItemSet &rSet, SvXmlExportFlags nFlags, const std::vector< sal_uInt16 > &rIndexArray) const
Definition: xmlexpit.cxx:240
SvXmlExportFlags
void exportXML(const SvXMLExport &rExport, SvXMLAttributeList &rAttrList, const SfxItemSet &rSet, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap, std::vector< sal_uInt16 > *pIndexArray) const
fills the given attribute list with the items in the given set
Definition: xmlexpit.cxx:65
virtual void handleElementItem(SvXMLExport &rExport, const SvXMLItemMapEntry &rEntry, const SfxPoolItem &rItem, const SvXMLUnitConverter &rUnitConverter, const SfxItemSet &rSet, SvXmlExportFlags nFlags) const
this method is called for every item that has the MID_SW_FLAG_ELEMENT_EXPORT flag set ...
Definition: xmlexpit.cxx:336
void setMapEntries(SvXMLItemMapEntriesRef rMapEntries)
Definition: xmlexpit.hxx:99