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>
30
31namespace rtl { template <class reference_type> class Reference; }
32
37struct XMLPropertyState;
38
40{
41 struct Impl;
42
43 std::unique_ptr<Impl> mpImpl;
44
47
48public:
56 const XMLPropertyMapEntry* pEntries,
58 bool bForExport );
59
60 virtual ~XMLPropertySetMapper() override;
61
62 void AddMapperEntry( const rtl::Reference < XMLPropertySetMapper >& rMapper );
63
65 sal_Int32 GetEntryCount() const;
66
68 sal_uInt32 GetEntryFlags( sal_Int32 nIndex ) const;
69
71 sal_uInt32 GetEntryType( sal_Int32 nIndex ) const;
72
74 sal_uInt16 GetEntryNameSpace( sal_Int32 nIndex ) const;
75
77 const OUString& GetEntryXMLName( sal_Int32 nIndex ) const;
78
80 const OUString& GetEntryAPIName( sal_Int32 nIndex ) const;
81
83 sal_Int16 GetEntryContextId( sal_Int32 nIndex ) const;
84
89 SvtSaveOptions::ODFSaneDefaultVersion GetEarliestODFVersionForExport(sal_Int32 nIndex) const;
90
93 sal_Int32 GetEntryIndex(
94 sal_uInt16 nNamespace, std::u16string_view rStrName, sal_uInt32 nPropType,
95 sal_Int32 nStartAt = -1 ) const;
96
99 sal_Int32 GetEntryIndex(
100 sal_Int32 nElement, sal_uInt32 nPropType,
101 sal_Int32 nStartAt = -1 ) const;
102
104 const XMLPropertyHandler* GetPropertyHandler( sal_Int32 nIndex ) const;
105
108 bool exportXML(
109 OUString& rStrExpValue, const XMLPropertyState& rProperty,
110 const SvXMLUnitConverter& rUnitConverter ) const;
111
112 bool importXML(
113 const OUString& rStrImpValue, XMLPropertyState& rProperty,
114 const SvXMLUnitConverter& rUnitConverter ) const;
115
117 sal_Int32 FindEntryIndex(
118 const char* sApiName, sal_uInt16 nNameSpace, std::u16string_view sXMLName ) const;
119
121 sal_Int32 FindEntryIndex( const sal_Int16 nContextId ) const;
122
124 void RemoveEntry( sal_Int32 nIndex );
125
126 void GetEntryAPINames(o3tl::sorted_vector<OUString>& rNames) const;
127};
128
129#endif // INCLUDED_XMLOFF_XMLPRMAP_HXX
130
131/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
Definition: xmluconv.hxx:83
This class is a base-class to create XMLPropertyHandler.
Definition: prhdlfac.hxx:41
Abstract base-class for different XML-types.
Definition: xmlprhdl.hxx:36
std::unique_ptr< Impl > mpImpl
Definition: xmlprmap.hxx:41
XMLPropertySetMapper(const XMLPropertySetMapper &)=delete
void operator=(SimpleReferenceObject) SAL_DELETED_FUNCTION
#define XMLOFF_DLLPUBLIC
Definition: dllapi.h:29
XMLOFF_DLLPUBLIC bool importXML(css::uno::Reference< css::xml::sax::XFastAttributeList > const &xAttrList, css::uno::Any &rValue, OUString &rStrName, SvXMLImport &rImport)
XMLOFF_DLLPUBLIC void exportXML(OUString const &rStrName, css::uno::Any const &rValue, SvXMLExport &rExport)
Reference
Represents a property with its API-name, its XML-name and the type of its value.
Definition: maptype.hxx:33
Smart struct to transport an Any with an index to the appropriate property-name.
Definition: maptype.hxx:140
static const XMLPropertyHandler * GetPropertyHandler(sal_Int32 nType)
Definition: txtprhdl.cxx:1224