Branch libreoffice-5-0-4
[LibreOffice.git] / include / xmloff / maptype.hxx
bloba942b1cc3bfc24c84648eadc00c12f42c4f18687
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>
29 /** Represents a property with its API-name, its XML-name and the type of
30 its value.
32 struct XMLPropertyMapEntry
34 const sal_Char* msApiName; /// Property-Name
35 sal_Int32 nApiNameLength; /// length of property name
36 sal_uInt16 mnNameSpace; /** declares the Namespace in which this
37 property exists */
38 enum ::xmloff::token::XMLTokenEnum meXMLName; /// XML-Name
40 /**
41 * The lowest 14 bits specify the basic XML type of the property value, of
42 * which the 11th bit specifies the application type. The basic type has
43 * the 11th bit off and the 14th bit on. For the most part, the lower 14
44 * bits are used as a single value.
46 * <p>The next 4 bits specify the family type of the property value. This
47 * can be one of the following:</p>
49 * <ul>
50 * <li>XML_TYPE_PROP_GRAPHIC</li>
51 * <li>XML_TYPE_PROP_DRAWING_PAGE</li>
52 * <li>XML_TYPE_PROP_PAGE_LAYOUT</li>
53 * <li>XML_TYPE_PROP_HEADER_FOOTER</li>
54 * <li>XML_TYPE_PROP_TEXT</li>
55 * <li>XML_TYPE_PROP_PARAGRAPH</li>
56 * <li>XML_TYPE_PROP_RUBY</li>
57 * <li>XML_TYPE_PROP_SECTION</li>
58 * <li>XML_TYPE_PROP_TABLE</li>
59 * <li>XML_TYPE_PROP_TABLE_COLUMN</li>
60 * <li>XML_TYPE_PROP_TABLE_ROW</li>
61 * <li>XML_TYPE_PROP_TABLE_CELL</li>
62 * <li>XML_TYPE_PROP_LIST_LEVEL</li>
63 * <li>XML_TYPE_PROP_CHART</li>
64 * </ul>
66 * <p>The next 2 bits are not used.</p>
68 * <p>The last 12 bits specify additional rules on how to special-case the
69 * value during import and export. This value may be a combination of the
70 * following flags:</p>
72 * <ul>
73 * <li>MID_FLAG_PROPERTY_MAY_THROW</li>
74 * <li>MID_FLAG_DEFAULT_ITEM_EXPORT</li>
75 * <li>MID_FLAG_MUST_EXIST</li>
76 * <li>MID_FLAG_MERGE_ATTRIBUTE</li>
77 * <li>MID_FLAG_MERGE_PROPERTY</li>
78 * <li>MID_FLAG_MULTI_PROPERTY</li>
79 * <li>MID_FLAG_ELEMENT_ITEM_IMPORT</li>
80 * <li>MID_FLAG_ELEMENT_ITEM_EXPORT</li>
81 * <li>MID_FLAG_SPECIAL_ITEM_IMPORT</li>
82 * <li>MID_FLAG_SPECIAL_ITEM_EXPORT</li>
83 * <li>MID_FLAG_NO_PROPERTY_IMPORT</li>
84 * <li>MID_FLAG_NO_PROPERTY_EXPORT</li>
85 * </ul>
87 sal_uInt32 mnType;
89 sal_Int16 mnContextId; /// User defined id for context filtering
90 SvtSaveOptions::ODFDefaultVersion mnEarliestODFVersionForExport;// no export when the used ODF version is lower than this
92 /** Flag to specify whether entry is only used during import.
94 Allows to handle more than one Namespace/XML-Name to Property-Name
95 mapping, i.e. for extensions. If several entries for the same
96 Property-Name exist, all except one must have this flag set.
98 bool mbImportOnly;
103 /** Smart struct to transport an Any with an index to the appropriate
104 property-name
106 struct XMLPropertyState
108 sal_Int32 mnIndex;
109 ::com::sun::star::uno::Any maValue;
111 XMLPropertyState( sal_Int32 nIndex )
112 : mnIndex( nIndex ) {}
113 XMLPropertyState( sal_Int32 nIndex, const ::com::sun::star::uno::Any& rValue )
114 : mnIndex( nIndex ), maValue( rValue ) {}
115 XMLPropertyState( const XMLPropertyState& rPropState )
116 : mnIndex( rPropState.mnIndex ), maValue( rPropState.maValue ) {}
119 #endif // INCLUDED_XMLOFF_MAPTYPE_HXX
121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */