1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SW_SOURCE_FILTER_XML_XMLEXPIT_HXX
21 #define INCLUDED_SW_SOURCE_FILTER_XML_XMLEXPIT_HXX
23 #include <xmloff/xmlexppr.hxx>
24 #include "xmlitmap.hxx"
27 class SvXMLUnitConverter
;
30 namespace comphelper
{ class AttributeList
; }
31 class SvXMLNamespaceMap
;
34 class SvXMLExportItemMapper
36 SvXMLItemMapEntriesRef mrMapEntries
;
39 /** fills the given attribute list with the items in the given set */
40 void exportXML( const SvXMLExport
& rExport
,
41 comphelper::AttributeList
& rAttrList
,
42 const SfxItemSet
& rSet
,
43 const SvXMLUnitConverter
& rUnitConverter
,
44 const SvXMLNamespaceMap
& rNamespaceMap
,
45 std::vector
<sal_uInt16
> *pIndexArray
) const;
47 void exportXML( const SvXMLExport
& rExport
,
48 comphelper::AttributeList
& rAttrList
,
49 const SfxPoolItem
& rItem
,
50 const SvXMLItemMapEntry
&rEntry
,
51 const SvXMLUnitConverter
& rUnitConverter
,
52 const SvXMLNamespaceMap
& rNamespaceMap
,
53 const SfxItemSet
*pSet
) const;
55 void exportElementItems( SvXMLExport
& rExport
,
56 const SfxItemSet
&rSet
,
57 const std::vector
<sal_uInt16
> &rIndexArray
) const;
59 static const SfxPoolItem
* GetItem( const SfxItemSet
&rSet
,
60 sal_uInt16 nWhichId
);
63 explicit SvXMLExportItemMapper( SvXMLItemMapEntriesRef rMapEntries
);
64 virtual ~SvXMLExportItemMapper();
66 void exportXML( SvXMLExport
& rExport
,
67 const SfxItemSet
& rSet
,
68 const SvXMLUnitConverter
& rUnitConverter
,
69 ::xmloff::token::XMLTokenEnum ePropToken
) const;
71 /** this method is called for every item that has the
72 MID_SW_FLAG_SPECIAL_ITEM_EXPORT flag set */
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;
80 /** this method is called for every item that has the
81 MID_SW_FLAG_ELEMENT_EXPORT flag set */
82 virtual void handleElementItem( const SvXMLItemMapEntry
& rEntry
,
83 const SfxPoolItem
& rItem
) const;
85 void setMapEntries(const SvXMLItemMapEntriesRef
& rMapEntries
)
87 mrMapEntries
= rMapEntries
;
90 static bool QueryXMLValue( const SfxPoolItem
& rItem
,
91 OUString
& rValue
, sal_uInt16 nMemberId
,
92 const SvXMLUnitConverter
& rUnitConverter
);
95 #endif // INCLUDED_SW_SOURCE_FILTER_XML_XMLEXPIT_HXX
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */