LibreOffice Module sw (master) 1
xmlimpit.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#ifndef INCLUDED_SW_SOURCE_FILTER_XML_XMLIMPIT_HXX
20#define INCLUDED_SW_SOURCE_FILTER_XML_XMLIMPIT_HXX
21
22#include <com/sun/star/xml/sax/XFastAttributeList.hpp>
23#include "xmlitmap.hxx"
24
26class SfxPoolItem;
27class SfxItemSet;
31
33{
35
36public:
37 explicit SvXMLImportItemMapper( SvXMLItemMapEntriesRef aMapEntries );
38 virtual ~SvXMLImportItemMapper();
39
41 void importXML( SfxItemSet& rSet,
42 css::uno::Reference< css::xml::sax::XFastAttributeList > const & xAttrList,
43 const SvXMLUnitConverter& rUnitConverter,
44 const SvXMLNamespaceMap& rNamespaceMap );
45
48 virtual bool handleSpecialItem( const SvXMLItemMapEntry& rEntry,
49 SfxPoolItem& rItem,
50 SfxItemSet& rSet,
51 const OUString& rValue,
52 const SvXMLUnitConverter& rUnitConverter );
53
56 virtual bool handleNoItem( const SvXMLItemMapEntry& rEntry,
57 SfxItemSet& rSet,
58 const OUString& rValue,
59 const SvXMLUnitConverter& rUnitConverter,
60 const SvXMLNamespaceMap& rNamespaceMap );
61
64 virtual void finished(SfxItemSet & rSet,
65 SvXMLUnitConverter const& rUnitConverter) const;
66
67 virtual void setMapEntries( SvXMLItemMapEntriesRef rMapEntries );
68 inline const SvXMLItemMapEntriesRef& getMapEntries() const;
69
72 static bool PutXMLValue(
73 SfxPoolItem& rItem,
74 const OUString& rValue,
75 sal_uInt16 nMemberId,
76 const SvXMLUnitConverter& rUnitConverter );
77private:
79 css::uno::Reference< css::xml::sax::XFastAttributeList > const & xAttrList,
80 const SvXMLUnitConverter& rUnitConverter,
81 std::unique_ptr<SvXMLAttrContainerItem>& pUnknownItem );
82
83};
84
85inline const SvXMLItemMapEntriesRef&
87{
88 return mrMapEntries;
89}
90
91#endif // INCLUDED_SW_SOURCE_FILTER_XML_XMLIMPIT_HXX
92
93/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvXMLImportItemMapper(SvXMLItemMapEntriesRef aMapEntries)
Definition: xmlimpit.cxx:64
virtual void setMapEntries(SvXMLItemMapEntriesRef rMapEntries)
Definition: xmlimpit.cxx:75
void importXMLUnknownAttributes(SfxItemSet &rSet, css::uno::Reference< css::xml::sax::XFastAttributeList > const &xAttrList, const SvXMLUnitConverter &rUnitConverter, std::unique_ptr< SvXMLAttrContainerItem > &pUnknownItem)
Definition: xmlimpit.cxx:198
SvXMLItemMapEntriesRef mrMapEntries
Definition: xmlimpit.hxx:34
static bool PutXMLValue(SfxPoolItem &rItem, const OUString &rValue, sal_uInt16 nMemberId, const SvXMLUnitConverter &rUnitConverter)
This method is called for every item that should be set based upon an XML attribute value.
Definition: xmlimpit.cxx:310
virtual bool handleSpecialItem(const SvXMLItemMapEntry &rEntry, SfxPoolItem &rItem, SfxItemSet &rSet, const OUString &rValue, const SvXMLUnitConverter &rUnitConverter)
this method is called for every item that has the MID_SW_FLAG_SPECIAL_ITEM_IMPORT flag set
Definition: xmlimpit.cxx:254
const SvXMLItemMapEntriesRef & getMapEntries() const
Definition: xmlimpit.hxx:86
virtual void finished(SfxItemSet &rSet, SvXMLUnitConverter const &rUnitConverter) const
This method is called when all attributes have benn processed.
Definition: xmlimpit.cxx:277
virtual ~SvXMLImportItemMapper()
Definition: xmlimpit.cxx:70
void importXML(SfxItemSet &rSet, css::uno::Reference< css::xml::sax::XFastAttributeList > const &xAttrList, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap)
fills the given itemset with the attributes in the given list
Definition: xmlimpit.cxx:81
virtual bool handleNoItem(const SvXMLItemMapEntry &rEntry, SfxItemSet &rSet, const OUString &rValue, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap)
this method is called for every item that has the MID_SW_FLAG_NO_ITEM_IMPORT flag set
Definition: xmlimpit.cxx:266