Line data Source code
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_MAPTYPE_HXX
21 : #define INCLUDED_XMLOFF_MAPTYPE_HXX
22 :
23 : #include <com/sun/star/uno/Any.hxx>
24 : #include <xmloff/xmltoken.hxx>
25 : #include <unotools/saveopt.hxx>
26 :
27 :
28 :
29 : /** Represents a property with its API-name, its XML-name and the type of
30 : its value.
31 : */
32 : struct XMLPropertyMapEntry
33 : {
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
39 :
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.
45 : *
46 : * <p>The next 4 bits specify the family type of the property value. This
47 : * can be one of the following:</p>
48 : *
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>
65 : *
66 : * <p>The next 2 bits are not used.</p>
67 : *
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>
71 : *
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>
86 : */
87 : sal_uInt32 mnType;
88 :
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
91 :
92 : /** Flag to specify whether entry is only used during import.
93 :
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.
97 : */
98 : bool mbImportOnly;
99 : };
100 :
101 :
102 :
103 : /** Smart struct to transport an Any with an index to the appropriate
104 : property-name
105 : */
106 1199570 : struct XMLPropertyState
107 : {
108 : sal_Int32 mnIndex;
109 : ::com::sun::star::uno::Any maValue;
110 :
111 219330 : XMLPropertyState( sal_Int32 nIndex )
112 219330 : : mnIndex( nIndex ) {}
113 73453 : XMLPropertyState( sal_Int32 nIndex, const ::com::sun::star::uno::Any& rValue )
114 73453 : : mnIndex( nIndex ), maValue( rValue ) {}
115 762414 : XMLPropertyState( const XMLPropertyState& rPropState )
116 762414 : : mnIndex( rPropState.mnIndex ), maValue( rPropState.maValue ) {}
117 : };
118 :
119 : #endif // INCLUDED_XMLOFF_MAPTYPE_HXX
120 :
121 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|