xref: /AOO41X/main/sw/source/filter/xml/xmlitmap.hxx (revision 1d2dbeb0b7301723c6d13094e87a8714ef81a328)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _XMLITMAP_HXX
25 #define _XMLITMAP_HXX
26 
27 #include <sal/types.h>
28 #include <tools/ref.hxx>
29 #include <xmloff/xmltoken.hxx>
30 
31 namespace rtl { class OUString; }
32 
33 #define MID_SW_FLAG_MASK                    0x0000ffff
34 
35 // this flags are used in the item mapper for import and export
36 
37 #define MID_SW_FLAG_SPECIAL_ITEM_IMPORT 0x80000000
38 #define MID_SW_FLAG_NO_ITEM_IMPORT          0x40000000
39 #define MID_SW_FLAG_SPECIAL_ITEM_EXPORT 0x20000000
40 #define MID_SW_FLAG_NO_ITEM_EXPORT          0x10000000
41 #define MID_SW_FLAG_SPECIAL_ITEM            0xa0000000 // both import and export
42 #define MID_SW_FLAG_NO_ITEM             0x50000000 // both import and export
43 #define MID_SW_FLAG_ELEMENT_ITEM_IMPORT 0x08000000
44 #define MID_SW_FLAG_ELEMENT_ITEM_EXPORT 0x04000000
45 #define MID_SW_FLAG_ELEMENT_ITEM            0x0c000000  // both import and export
46 
47 // ---
48 
49 struct SvXMLItemMapEntry
50 {
51     sal_uInt16 nNameSpace;      // declares the Namespace in wich this item
52                                 // exists
53     enum ::xmloff::token::XMLTokenEnum eLocalName;
54                                 // the local name for the item inside
55                                 // the Namespace (as an XMLTokenEnum)
56     sal_uInt16 nWhichId;        // the WichId to identify the item
57                                 // in the pool
58     sal_uInt32 nMemberId;       // the memberid specifies wich part
59                                 // of the item should be imported or
60                                 // exported with this Namespace
61                                 // and localName
62 };
63 
64 // ---
65 
66 class SvXMLItemMapEntries_impl;
67 
68 /** this class manages an array of SvXMLItemMapEntry. It is
69     used for optimizing the static array on startup of import
70     or export */
71 class SvXMLItemMapEntries : public SvRefBase
72 {
73 protected:
74     SvXMLItemMapEntries_impl* mpImpl;
75 
76 public:
77     SvXMLItemMapEntries( SvXMLItemMapEntry* pEntrys );
78     virtual ~SvXMLItemMapEntries();
79 
80     SvXMLItemMapEntry* getByName( sal_uInt16 nNameSpace,
81                                   const ::rtl::OUString& rString,
82                                   SvXMLItemMapEntry* pStartAt = NULL ) const;
83     SvXMLItemMapEntry* getByIndex( sal_uInt16 nIndex ) const;
84 
85     sal_uInt16 getCount() const;
86 };
87 
88 SV_DECL_REF( SvXMLItemMapEntries )
89 SV_IMPL_REF( SvXMLItemMapEntries )
90 
91 
92 #endif  //  _XMLITMAP_HXX
93