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