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 
25 class SvXMLUnitConverter;
26 class SfxPoolItem;
27 class SfxItemSet;
28 class SvXMLNamespaceMap;
29 struct SvXMLItemMapEntry;
31 
33 {
34 protected:
36 
37 public:
38  explicit SvXMLImportItemMapper( SvXMLItemMapEntriesRef const & rMapEntries );
39  virtual ~SvXMLImportItemMapper();
40 
42  void importXML( SfxItemSet& rSet,
43  css::uno::Reference< css::xml::sax::XFastAttributeList > const & xAttrList,
44  const SvXMLUnitConverter& rUnitConverter,
45  const SvXMLNamespaceMap& rNamespaceMap );
46 
49  virtual bool handleSpecialItem( const SvXMLItemMapEntry& rEntry,
50  SfxPoolItem& rItem,
51  SfxItemSet& rSet,
52  const OUString& rValue,
53  const SvXMLUnitConverter& rUnitConverter );
54 
57  virtual bool handleNoItem( const SvXMLItemMapEntry& rEntry,
58  SfxItemSet& rSet,
59  const OUString& rValue,
60  const SvXMLUnitConverter& rUnitConverter,
61  const SvXMLNamespaceMap& rNamespaceMap );
62 
65  virtual void finished(SfxItemSet & rSet,
66  SvXMLUnitConverter const& rUnitConverter) const;
67 
68  virtual void setMapEntries( SvXMLItemMapEntriesRef rMapEntries );
69  inline const SvXMLItemMapEntriesRef& getMapEntries() const;
70 
73  static bool PutXMLValue(
74  SfxPoolItem& rItem,
75  const OUString& rValue,
76  sal_uInt16 nMemberId,
77  const SvXMLUnitConverter& rUnitConverter );
78 private:
80  css::uno::Reference< css::xml::sax::XFastAttributeList > const & xAttrList,
81  const SvXMLUnitConverter& rUnitConverter,
82  std::unique_ptr<SvXMLAttrContainerItem>& pUnknownItem );
83 
84 };
85 
86 inline const SvXMLItemMapEntriesRef&
88 {
89  return mrMapEntries;
90 }
91 
92 #endif // INCLUDED_SW_SOURCE_FILTER_XML_XMLIMPIT_HXX
93 
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SvXMLItemMapEntriesRef & getMapEntries() const
Definition: xmlimpit.hxx:87
SvXMLImportItemMapper(SvXMLItemMapEntriesRef const &rMapEntries)
Definition: xmlimpit.cxx:64
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
virtual void setMapEntries(SvXMLItemMapEntriesRef rMapEntries)
Definition: xmlimpit.cxx:75
SvXMLItemMapEntriesRef mrMapEntries
Definition: xmlimpit.hxx:35
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 importXMLUnknownAttributes(SfxItemSet &rSet, css::uno::Reference< css::xml::sax::XFastAttributeList > const &xAttrList, const SvXMLUnitConverter &rUnitConverter, std::unique_ptr< SvXMLAttrContainerItem > &pUnknownItem)
Definition: xmlimpit.cxx:198
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
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