xref: /aoo41x/main/svx/inc/svx/unoprov.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SVX_UNOPROV_HXX
29 #define SVX_UNOPROV_HXX
30 
31 #include <com/sun/star/lang/XServiceInfo.hpp>
32 #include <svl/itemprop.hxx>
33 #include <tools/list.hxx>
34 #include "svx/svxdllapi.h"
35 
36 class SvxItemPropertySet;
37 class SfxItemPool;
38 
39 /***********************************************************************
40 * class UHashMap                                                       *
41 ***********************************************************************/
42 
43 struct UHashMapEntry
44 {
45 	::rtl::OUString aIdentifier;
46 	sal_uInt32 nId;
47 
48 	UHashMapEntry(const sal_Char * value, sal_Int32 length, sal_uInt32 _nId) : aIdentifier(value,length,RTL_TEXTENCODING_ASCII_US), nId(_nId) { }
49 };
50 
51 DECLARE_LIST( UHashMapEntryList, UHashMapEntry* )
52 
53 #define HASHARRAYSIZE	0x10
54 #define UHASHMAP_NOTFOUND sal::static_int_cast< sal_uInt32 >(~0)
55 
56 class UHashMap
57 {
58 private:
59 	UHashMapEntryList m_aHashList[HASHARRAYSIZE];
60 
61 public:
62 	UHashMap( UHashMapEntry* pMap );
63 	~UHashMap() {};
64 
65 	sal_uInt32 getId( const ::rtl::OUString& rCompareString );
66 };
67 
68 /***********************************************************************
69 * Soriterer                                                            *
70 ***********************************************************************/
71 
72 #define	SVXMAP_SHAPE				0
73 #define	SVXMAP_CONNECTOR			1
74 #define	SVXMAP_DIMENSIONING			2
75 #define	SVXMAP_CIRCLE				3
76 #define	SVXMAP_POLYPOLYGON			4
77 #define	SVXMAP_POLYPOLYGONBEZIER	5
78 #define	SVXMAP_GRAPHICOBJECT		6
79 #define	SVXMAP_3DSCENEOBJECT		7
80 #define	SVXMAP_3DCUBEOBJEKT			8
81 #define	SVXMAP_3DSPHEREOBJECT		9
82 #define	SVXMAP_3DLATHEOBJECT		10
83 #define	SVXMAP_3DEXTRUDEOBJECT		11
84 #define	SVXMAP_3DPOLYGONOBJECT		12
85 #define	SVXMAP_ALL					13
86 #define SVXMAP_GROUP				14
87 #define SVXMAP_CAPTION				15
88 #define SVXMAP_OLE2					16
89 #define SVXMAP_PLUGIN				17
90 #define SVXMAP_FRAME				18
91 #define SVXMAP_APPLET				19
92 #define SVXMAP_CONTROL				20
93 #define SVXMAP_TEXT					21
94 #define SVXMAP_CUSTOMSHAPE			22
95 #define SVXMAP_MEDIA				23
96 #define SVXMAP_TABLE				24
97 #define SVXMAP_PAGE                 25
98 #define	SVXMAP_END					26	// last+1 !
99 /***********************************************************************
100 * SvxUnoPropertyMapProvider											   *
101 ***********************************************************************/
102 class SVX_DLLPUBLIC SvxUnoPropertyMapProvider
103 {
104     SfxItemPropertyMapEntry* aMapArr[SVXMAP_END];
105     SvxItemPropertySet* aSetArr[SVXMAP_END];
106 //	void Sort(sal_uInt16 nId);
107 public:
108 	SvxUnoPropertyMapProvider();
109     ~SvxUnoPropertyMapProvider();
110     const SfxItemPropertyMapEntry* GetMap(sal_uInt16 nPropertyId);
111     const SvxItemPropertySet* GetPropertySet(sal_uInt16 nPropertyId, SfxItemPool& rPool);
112 };
113 
114 /***********************************************************************
115 * Globals                                                              *
116 ***********************************************************************/
117 
118 const sal_Int16 OBJ_OLE2_APPLET	= 100;
119 const sal_Int16 OBJ_OLE2_PLUGIN = 101;
120 
121 extern SvxUnoPropertyMapProvider aSvxMapProvider;
122 extern UHashMapEntry pSdrShapeIdentifierMap[];
123 extern UHashMap aSdrShapeIdentifierMap;
124 
125 #define E3D_INVENTOR_FLAG			(0x80000000)
126 
127 #include <editeng/unoipset.hxx>
128 
129 /***********************************************************************
130 * class SvxPropertySetInfoPool                                         *
131 ***********************************************************************/
132 
133 const sal_Int32 SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS = 0;
134 const sal_Int32 SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER = 1;
135 const sal_Int32 SVXUNO_SERVICEID_LASTID = 1;
136 
137 namespace comphelper { class PropertySetInfo; }
138 
139 class SvxPropertySetInfoPool
140 {
141 public:
142 	SVX_DLLPUBLIC static comphelper::PropertySetInfo* getOrCreate( sal_Int32 nServiceId ) throw();
143 
144 private:
145 	static comphelper::PropertySetInfo* mpInfos[SVXUNO_SERVICEID_LASTID+1];
146 };
147 
148 #endif
149 
150