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/XAttributeList.hpp>
23 #include "xmlitmap.hxx"
24 
25 class SvXMLUnitConverter;
26 class SfxPoolItem;
27 class SfxItemSet;
28 class SvXMLNamespaceMap;
29 struct SvXMLItemMapEntry;
30 
32 {
33 protected:
35 
36 public:
37  explicit SvXMLImportItemMapper( SvXMLItemMapEntriesRef const & rMapEntries );
38  virtual ~SvXMLImportItemMapper();
39 
41  void importXML( SfxItemSet& rSet,
42  css::uno::Reference< css::xml::sax::XAttributeList > 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  const SvXMLNamespaceMap& rNamespaceMap );
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 };
79 
80 inline const SvXMLItemMapEntriesRef&
82 {
83  return mrMapEntries;
84 }
85 
86 #endif // INCLUDED_SW_SOURCE_FILTER_XML_XMLIMPIT_HXX
87 
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SvXMLItemMapEntriesRef & getMapEntries() const
Definition: xmlimpit.hxx:81
SvXMLImportItemMapper(SvXMLItemMapEntriesRef const &rMapEntries)
Definition: xmlimpit.cxx:65
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:204
void importXML(SfxItemSet &rSet, css::uno::Reference< css::xml::sax::XAttributeList > const &xAttrList, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap)
fills the given itemset with the attributes in the given list
Definition: xmlimpit.cxx:82
virtual bool handleSpecialItem(const SvXMLItemMapEntry &rEntry, SfxPoolItem &rItem, SfxItemSet &rSet, const OUString &rValue, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap)
this method is called for every item that has the MID_SW_FLAG_SPECIAL_ITEM_IMPORT flag set ...
Definition: xmlimpit.cxx:191
virtual void setMapEntries(SvXMLItemMapEntriesRef rMapEntries)
Definition: xmlimpit.cxx:76
SvXMLItemMapEntriesRef mrMapEntries
Definition: xmlimpit.hxx:34
virtual void finished(SfxItemSet &rSet, SvXMLUnitConverter const &rUnitConverter) const
This method is called when all attributes have benn processed.
Definition: xmlimpit.cxx:215
virtual ~SvXMLImportItemMapper()
Definition: xmlimpit.cxx:71
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:244