LibreOffice Module xmloff (master)  1
xmlprmap.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_XMLOFF_XMLPRMAP_HXX
21 #define INCLUDED_XMLOFF_XMLPRMAP_HXX
22 
23 #include <xmloff/dllapi.h>
24 #include <unotools/saveopt.hxx>
25 #include <rtl/ustring.hxx>
26 
28 #include <memory>
29 
30 namespace rtl { template <class reference_type> class Reference; }
31 
32 class SvXMLUnitConverter;
33 class XMLPropertyHandler;
35 struct XMLPropertyMapEntry;
36 struct XMLPropertyState;
37 
39 {
40  struct Impl;
41 
42  std::unique_ptr<Impl> mpImpl;
43 
44  XMLPropertySetMapper( const XMLPropertySetMapper& ) = delete;
46 
47 public:
55  const XMLPropertyMapEntry* pEntries,
57  bool bForExport );
58 
59  virtual ~XMLPropertySetMapper() override;
60 
61  void AddMapperEntry( const rtl::Reference < XMLPropertySetMapper >& rMapper );
62 
64  sal_Int32 GetEntryCount() const;
65 
67  sal_uInt32 GetEntryFlags( sal_Int32 nIndex ) const;
68 
70  sal_uInt32 GetEntryType( sal_Int32 nIndex ) const;
71 
73  sal_uInt16 GetEntryNameSpace( sal_Int32 nIndex ) const;
74 
76  const OUString& GetEntryXMLName( sal_Int32 nIndex ) const;
77 
79  const OUString& GetEntryAPIName( sal_Int32 nIndex ) const;
80 
82  sal_Int16 GetEntryContextId( sal_Int32 nIndex ) const;
83 
88  SvtSaveOptions::ODFSaneDefaultVersion GetEarliestODFVersionForExport(sal_Int32 nIndex) const;
89 
92  sal_Int32 GetEntryIndex(
93  sal_uInt16 nNamespace, const OUString& rStrName, sal_uInt32 nPropType,
94  sal_Int32 nStartAt = -1 ) const;
95 
97  const XMLPropertyHandler* GetPropertyHandler( sal_Int32 nIndex ) const;
98 
101  bool exportXML(
102  OUString& rStrExpValue, const XMLPropertyState& rProperty,
103  const SvXMLUnitConverter& rUnitConverter ) const;
104 
105  bool importXML(
106  const OUString& rStrImpValue, XMLPropertyState& rProperty,
107  const SvXMLUnitConverter& rUnitConverter ) const;
108 
110  sal_Int32 FindEntryIndex(
111  const char* sApiName, sal_uInt16 nNameSpace, const OUString& sXMLName ) const;
112 
114  sal_Int32 FindEntryIndex( const sal_Int16 nContextId ) const;
115 
117  void RemoveEntry( sal_Int32 nIndex );
118 };
119 
120 #endif // INCLUDED_XMLOFF_XMLPRMAP_HXX
121 
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
Definition: xmluconv.hxx:77
Reference
This class is a base-class to create XMLPropertyHandler.
Definition: prhdlfac.hxx:40
Represents a property with its API-name, its XML-name and the type of its value.
Definition: maptype.hxx:31
void operator=(SimpleReferenceObject) SAL_DELETED_FUNCTION
std::unique_ptr< Impl > mpImpl
Definition: xmlprmap.hxx:40
static const XMLPropertyHandler * GetPropertyHandler(sal_Int32 nType)
Definition: txtprhdl.cxx:1218
Smart struct to transport an Any with an index to the appropriate property-name.
Definition: maptype.hxx:122
Abstract base-class for different XML-types.
Definition: xmlprhdl.hxx:35
#define XMLOFF_DLLPUBLIC
Definition: dllapi.h:29