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
28class SfxPoolItem;
29class SfxItemSet;
30namespace comphelper { class AttributeList; }
32class SvXMLExport;
33
35{
37
38protected:
40 void exportXML( const SvXMLExport& rExport,
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,
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 SfxItemSet &rSet,
57 const std::vector<sal_uInt16> &rIndexArray ) const;
58
59 static const SfxPoolItem* GetItem( const SfxItemSet &rSet,
60 sal_uInt16 nWhichId );
61
62public:
63 explicit SvXMLExportItemMapper( SvXMLItemMapEntriesRef rMapEntries );
64 virtual ~SvXMLExportItemMapper();
65
66 void exportXML( SvXMLExport& rExport,
67 const SfxItemSet& rSet,
68 const SvXMLUnitConverter& rUnitConverter,
69 ::xmloff::token::XMLTokenEnum ePropToken ) const;
70
73 virtual void handleSpecialItem( comphelper::AttributeList& rAttrList,
74 const SvXMLItemMapEntry& rEntry,
75 const SfxPoolItem& rItem,
76 const SvXMLUnitConverter& rUnitConverter,
77 const SvXMLNamespaceMap& rNamespaceMap,
78 const SfxItemSet *pSet ) const;
79
82 virtual void handleElementItem( const SvXMLItemMapEntry& rEntry,
83 const SfxPoolItem& rItem ) const;
84
85 inline void setMapEntries( SvXMLItemMapEntriesRef rMapEntries );
86
87 static bool QueryXMLValue( const SfxPoolItem& rItem,
88 OUString& rValue, sal_uInt16 nMemberId,
89 const SvXMLUnitConverter& rUnitConverter );
90};
91
92inline void
94{
95 mrMapEntries = rMapEntries;
96}
97
98#endif // INCLUDED_SW_SOURCE_FILTER_XML_XMLEXPIT_HXX
99
100/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static bool QueryXMLValue(const SfxPoolItem &rItem, OUString &rValue, sal_uInt16 nMemberId, const SvXMLUnitConverter &rUnitConverter)
Definition: xmlexpit.cxx:360
void exportXML(const SvXMLExport &rExport, comphelper::AttributeList &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:63
virtual ~SvXMLExportItemMapper()
Definition: xmlexpit.cxx:295
virtual void handleElementItem(const SvXMLItemMapEntry &rEntry, const SfxPoolItem &rItem) const
this method is called for every item that has the MID_SW_FLAG_ELEMENT_EXPORT flag set
Definition: xmlexpit.cxx:333
static const SfxPoolItem * GetItem(const SfxItemSet &rSet, sal_uInt16 nWhichId)
returns the item with the given WhichId from the given ItemSet if it's set
Definition: xmlexpit.cxx:273
SvXMLExportItemMapper(SvXMLItemMapEntriesRef rMapEntries)
Definition: xmlexpit.cxx:290
void exportElementItems(SvXMLExport &rExport, const SfxItemSet &rSet, const std::vector< sal_uInt16 > &rIndexArray) const
Definition: xmlexpit.cxx:241
void exportXML(SvXMLExport &rExport, const SfxItemSet &rSet, const SvXMLUnitConverter &rUnitConverter, ::xmloff::token::XMLTokenEnum ePropToken) const
virtual void handleSpecialItem(comphelper::AttributeList &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:321
SvXMLItemMapEntriesRef mrMapEntries
Definition: xmlexpit.hxx:36
void setMapEntries(SvXMLItemMapEntriesRef rMapEntries)
Definition: xmlexpit.hxx:93