xref: /aoo41x/main/svx/inc/svx/unoprov.hxx (revision 3334a7e6)
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 SVX_UNOPROV_HXX
25 #define SVX_UNOPROV_HXX
26 
27 #include <com/sun/star/lang/XServiceInfo.hpp>
28 #include <svl/itemprop.hxx>
29 #include <tools/list.hxx>
30 #include "svx/svxdllapi.h"
31 
32 class SvxItemPropertySet;
33 class SfxItemPool;
34 
35 /***********************************************************************
36 * class UHashMap                                                       *
37 ***********************************************************************/
38 
39 struct UHashMapEntry
40 {
41 	::rtl::OUString aIdentifier;
42 	sal_uInt32 nId;
43 
UHashMapEntryUHashMapEntry44 	UHashMapEntry(const sal_Char * value, sal_Int32 length, sal_uInt32 _nId) : aIdentifier(value,length,RTL_TEXTENCODING_ASCII_US), nId(_nId) { }
45 };
46 
47 DECLARE_LIST( UHashMapEntryList, UHashMapEntry* )
48 
49 #define HASHARRAYSIZE	0x10
50 #define UHASHMAP_NOTFOUND sal::static_int_cast< sal_uInt32 >(~0)
51 
52 class UHashMap
53 {
54 private:
55 	UHashMapEntryList m_aHashList[HASHARRAYSIZE];
56 
57 public:
58 	UHashMap( UHashMapEntry* pMap );
~UHashMap()59 	~UHashMap() {};
60 
61 	sal_uInt32 getId( const ::rtl::OUString& rCompareString );
62 };
63 
64 /***********************************************************************
65 * Soriterer                                                            *
66 ***********************************************************************/
67 
68 #define	SVXMAP_SHAPE				0
69 #define	SVXMAP_CONNECTOR			1
70 #define	SVXMAP_DIMENSIONING			2
71 #define	SVXMAP_CIRCLE				3
72 #define	SVXMAP_POLYPOLYGON			4
73 #define	SVXMAP_POLYPOLYGONBEZIER	5
74 #define	SVXMAP_GRAPHICOBJECT		6
75 #define	SVXMAP_3DSCENEOBJECT		7
76 #define	SVXMAP_3DCUBEOBJEKT			8
77 #define	SVXMAP_3DSPHEREOBJECT		9
78 #define	SVXMAP_3DLATHEOBJECT		10
79 #define	SVXMAP_3DEXTRUDEOBJECT		11
80 #define	SVXMAP_3DPOLYGONOBJECT		12
81 #define	SVXMAP_ALL					13
82 #define SVXMAP_GROUP				14
83 #define SVXMAP_CAPTION				15
84 #define SVXMAP_OLE2					16
85 #define SVXMAP_PLUGIN				17
86 #define SVXMAP_FRAME				18
87 #define SVXMAP_APPLET				19
88 #define SVXMAP_CONTROL				20
89 #define SVXMAP_TEXT					21
90 #define SVXMAP_CUSTOMSHAPE			22
91 #define SVXMAP_MEDIA				23
92 #define SVXMAP_TABLE				24
93 #define SVXMAP_PAGE                 25
94 #define	SVXMAP_END					26	// last+1 !
95 /***********************************************************************
96 * SvxUnoPropertyMapProvider											   *
97 ***********************************************************************/
98 class SVX_DLLPUBLIC SvxUnoPropertyMapProvider
99 {
100     SfxItemPropertyMapEntry* aMapArr[SVXMAP_END];
101     SvxItemPropertySet* aSetArr[SVXMAP_END];
102 //	void Sort(sal_uInt16 nId);
103 public:
104 	SvxUnoPropertyMapProvider();
105     ~SvxUnoPropertyMapProvider();
106     const SfxItemPropertyMapEntry* GetMap(sal_uInt16 nPropertyId);
107     const SvxItemPropertySet* GetPropertySet(sal_uInt16 nPropertyId, SfxItemPool& rPool);
108 };
109 
110 /***********************************************************************
111 * Globals                                                              *
112 ***********************************************************************/
113 
114 const sal_Int16 OBJ_OLE2_APPLET	= 100;
115 const sal_Int16 OBJ_OLE2_PLUGIN = 101;
116 
117 extern SvxUnoPropertyMapProvider aSvxMapProvider;
118 extern UHashMapEntry pSdrShapeIdentifierMap[];
119 extern UHashMap aSdrShapeIdentifierMap;
120 
121 #define E3D_INVENTOR_FLAG			(0x80000000)
122 
123 #include <editeng/unoipset.hxx>
124 
125 /***********************************************************************
126 * class SvxPropertySetInfoPool                                         *
127 ***********************************************************************/
128 
129 const sal_Int32 SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS = 0;
130 const sal_Int32 SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER = 1;
131 const sal_Int32 SVXUNO_SERVICEID_LASTID = 1;
132 
133 namespace comphelper { class PropertySetInfo; }
134 
135 class SvxPropertySetInfoPool
136 {
137 public:
138 	SVX_DLLPUBLIC static comphelper::PropertySetInfo* getOrCreate( sal_Int32 nServiceId ) throw();
139 
140 private:
141 	static comphelper::PropertySetInfo* mpInfos[SVXUNO_SERVICEID_LASTID+1];
142 };
143 
144 #endif
145 
146