1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
31 struct XMLPropertyMapEntry
33 const sal_Char
* msApiName
; /// Property-Name
34 sal_Int32 nApiNameLength
; /// length of property name
35 sal_uInt16 mnNameSpace
; /** declares the Namespace in which this
37 enum ::xmloff::token::XMLTokenEnum meXMLName
; /// XML-Name
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>
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>
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>
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>
88 sal_Int16 mnContextId
; /// User defined id for context filtering
89 SvtSaveOptions::ODFDefaultVersion mnEarliestODFVersionForExport
;// no export when the used ODF version is lower than this
91 /** Flag to specify whether entry is only used during import.
93 Allows to handle more than one Namespace/XML-Name to Property-Name
94 mapping, i.e. for extensions. If several entries for the same
95 Property-Name exist, all except one must have this flag set.
101 /** Smart struct to transport an Any with an index to the appropriate
104 struct XMLPropertyState
107 css::uno::Any maValue
;
109 XMLPropertyState( sal_Int32 nIndex
)
110 : mnIndex( nIndex
) {}
111 XMLPropertyState( sal_Int32 nIndex
, const css::uno::Any
& rValue
)
112 : mnIndex( nIndex
), maValue( rValue
) {}
113 XMLPropertyState( const XMLPropertyState
& rPropState
)
114 : mnIndex( rPropState
.mnIndex
), maValue( rPropState
.maValue
) {}
117 #endif // INCLUDED_XMLOFF_MAPTYPE_HXX
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */