nss: upgrade to release 3.73
[LibreOffice.git] / include / xmloff / maptype.hxx
blobdbde180797cf0f1f863fda597b65de9fe981108f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_XMLOFF_MAPTYPE_HXX
21 #define INCLUDED_XMLOFF_MAPTYPE_HXX
23 #include <com/sun/star/uno/Any.hxx>
24 #include <xmloff/xmltoken.hxx>
25 #include <unotools/saveopt.hxx>
28 /** Represents a property with its API-name, its XML-name and the type of
29 its value.
31 struct XMLPropertyMapEntry
33 const char* msApiName; /// Property-Name
34 sal_Int32 nApiNameLength; /// length of property name
35 enum ::xmloff::token::XMLTokenEnum meXMLName; /// XML-Name
36 sal_uInt16 mnNameSpace; /** declares the Namespace in which this
37 property exists */
39 /**
40 * The lowest 14 bits specify the basic XML type of the property value, of
41 * which the 11th bit specifies the application type. The basic type has
42 * the 11th bit off and the 14th bit on. For the most part, the lower 14
43 * bits are used as a single value.
45 * <p>The next 4 bits specify the family type of the property value. This
46 * can be one of the following:</p>
48 * <ul>
49 * <li>XML_TYPE_PROP_GRAPHIC</li>
50 * <li>XML_TYPE_PROP_DRAWING_PAGE</li>
51 * <li>XML_TYPE_PROP_PAGE_LAYOUT</li>
52 * <li>XML_TYPE_PROP_HEADER_FOOTER</li>
53 * <li>XML_TYPE_PROP_TEXT</li>
54 * <li>XML_TYPE_PROP_PARAGRAPH</li>
55 * <li>XML_TYPE_PROP_RUBY</li>
56 * <li>XML_TYPE_PROP_SECTION</li>
57 * <li>XML_TYPE_PROP_TABLE</li>
58 * <li>XML_TYPE_PROP_TABLE_COLUMN</li>
59 * <li>XML_TYPE_PROP_TABLE_ROW</li>
60 * <li>XML_TYPE_PROP_TABLE_CELL</li>
61 * <li>XML_TYPE_PROP_LIST_LEVEL</li>
62 * <li>XML_TYPE_PROP_CHART</li>
63 * </ul>
65 * <p>The next 2 bits are not used.</p>
67 * <p>The last 12 bits specify additional rules on how to special-case the
68 * value during import and export. This value may be a combination of the
69 * following flags:</p>
71 * <ul>
72 * <li>MID_FLAG_PROPERTY_MAY_THROW</li>
73 * <li>MID_FLAG_DEFAULT_ITEM_EXPORT</li>
74 * <li>MID_FLAG_MUST_EXIST</li>
75 * <li>MID_FLAG_MERGE_ATTRIBUTE</li>
76 * <li>MID_FLAG_MERGE_PROPERTY</li>
77 * <li>MID_FLAG_MULTI_PROPERTY</li>
78 * <li>MID_FLAG_ELEMENT_ITEM_IMPORT</li>
79 * <li>MID_FLAG_ELEMENT_ITEM_EXPORT</li>
80 * <li>MID_FLAG_SPECIAL_ITEM_IMPORT</li>
81 * <li>MID_FLAG_SPECIAL_ITEM_EXPORT</li>
82 * <li>MID_FLAG_NO_PROPERTY_IMPORT</li>
83 * <li>MID_FLAG_NO_PROPERTY_EXPORT</li>
84 * </ul>
86 sal_uInt32 mnType;
88 sal_Int16 mnContextId; /// User defined id for context filtering
89 /** no export to standard namespace when the used ODF version is lower than this;
90 no export to extension namespace when the used ODF version is at least this
92 SvtSaveOptions::ODFSaneDefaultVersion mnEarliestODFVersionForExport;
94 /** Flag to specify whether entry is only used during import.
96 Allows to handle more than one Namespace/XML-Name to Property-Name
97 mapping, i.e. for extensions. If several entries for the same
98 Property-Name exist, all except one must have this flag set.
100 bool mbImportOnly;
102 XMLPropertyMapEntry(
103 const char* sApiName,
104 sal_Int32 nApiNameLength_,
105 sal_uInt16 nNameSpace,
106 enum ::xmloff::token::XMLTokenEnum eXMLName,
107 sal_uInt32 nType,
108 sal_Int16 nContextId,
109 SvtSaveOptions::ODFSaneDefaultVersion nEarliestODFVersionForExport,
110 bool bImportOnly)
111 : msApiName(sApiName), nApiNameLength(nApiNameLength_),
112 meXMLName(eXMLName), mnNameSpace(nNameSpace), mnType(nType),
113 mnContextId(nContextId), mnEarliestODFVersionForExport(nEarliestODFVersionForExport),
114 mbImportOnly(bImportOnly)
119 /** Smart struct to transport an Any with an index to the appropriate
120 property-name
122 struct XMLPropertyState
124 sal_Int32 mnIndex;
125 css::uno::Any maValue;
127 XMLPropertyState( sal_Int32 nIndex )
128 : mnIndex( nIndex ) {}
129 XMLPropertyState( sal_Int32 nIndex, const css::uno::Any& rValue )
130 : mnIndex( nIndex ), maValue( rValue ) {}
133 #endif // INCLUDED_XMLOFF_MAPTYPE_HXX
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */