Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_svx / unoprov.hxx
bloba134b2e1a0d931065ef4c10448b9fdb97676adf8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: unoprov.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SVX_UNOPROV_HXX
32 #define SVX_UNOPROV_HXX
34 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
35 #include <com/sun/star/lang/XServiceInfo.hpp>
36 #endif
38 #ifndef _SVDPOOL_HXX //autogen
39 #include <bf_svx/svdpool.hxx>
40 #endif
41 #ifndef _SFX_ITEMPROP_HXX //autogen
42 #include <bf_svtools/itemprop.hxx>
43 #endif
44 #ifndef _LIST_HXX
45 #include <tools/list.hxx>
46 #endif
47 namespace binfilter {
49 /***********************************************************************
50 * class UHashMap *
51 ***********************************************************************/
53 struct UHashMapEntry
55 ::rtl::OUString aIdentifier;
56 UINT32 nId;
58 UHashMapEntry(const sal_Char * value, sal_Int32 length, UINT32 _nId) : aIdentifier(value,length,RTL_TEXTENCODING_ASCII_US), nId(_nId) { }
61 DECLARE_LIST( UHashMapEntryList, UHashMapEntry* )//STRIP008 DECLARE_LIST( UHashMapEntryList, UHashMapEntry* );
63 #define HASHARRAYSIZE 0x10
64 #define UHASHMAP_NOTFOUND (~0)
66 class UHashMap
68 private:
69 UHashMapEntryList m_aHashList[HASHARRAYSIZE];
71 public:
72 UHashMap( UHashMapEntry* pMap );
73 ~UHashMap() {};
75 UINT32 getId( const ::rtl::OUString& rCompareString );
78 /***********************************************************************
79 * Soriterer *
80 ***********************************************************************/
82 #define SVXMAP_SHAPE 0
83 #define SVXMAP_CONNECTOR 1
84 #define SVXMAP_DIMENSIONING 2
85 #define SVXMAP_CIRCLE 3
86 #define SVXMAP_POLYPOLYGON 4
87 #define SVXMAP_POLYPOLYGONBEZIER 5
88 #define SVXMAP_GRAPHICOBJECT 6
89 #define SVXMAP_3DSCENEOBJECT 7
90 #define SVXMAP_3DCUBEOBJEKT 8
91 #define SVXMAP_3DSPHEREOBJECT 9
92 #define SVXMAP_3DLATHEOBJECT 10
93 #define SVXMAP_3DEXTRUDEOBJECT 11
94 #define SVXMAP_3DPOLYGONOBJECT 12
95 #define SVXMAP_ALL 13
96 #define SVXMAP_GROUP 14
97 #define SVXMAP_CAPTION 15
98 #define SVXMAP_OLE2 16
99 #define SVXMAP_PLUGIN 17
100 #define SVXMAP_FRAME 18
101 #define SVXMAP_APPLET 19
102 #define SVXMAP_CONTROL 20
103 #define SVXMAP_TEXT 21
104 #define SVXMAP_END 22 // last+1 !
106 /***********************************************************************
107 * SvxUnoPropertyMapProvider *
108 ***********************************************************************/
109 class SvxUnoPropertyMapProvider
111 SfxItemPropertyMap* aMapArr[SVXMAP_END];
112 void Sort(USHORT nId);
113 public:
114 SvxUnoPropertyMapProvider();
115 SfxItemPropertyMap* GetMap(UINT16 nPropertyId);
118 /***********************************************************************
119 * Globals *
120 ***********************************************************************/
122 const sal_Int16 OBJ_OLE2_APPLET = 100;
123 const sal_Int16 OBJ_OLE2_PLUGIN = 101;
125 extern SvxUnoPropertyMapProvider aSvxMapProvider;
126 extern UHashMapEntry pSdrShapeIdentifierMap[];
127 extern UHashMap aSdrShapeIdentifierMap;
129 #define SFX_METRIC_ITEM (0x40)
130 #define E3D_INVENTOR_FLAG (0x80000000)
131 }//end of namespace binfilter
132 #include <bf_svx/unoipset.hxx>
133 namespace binfilter {
135 /***********************************************************************
136 * class SvxServiceInfoHelper *
137 ***********************************************************************/
139 /** this class provides a basic helper for classes suporting the XServiceInfo Interface.
141 * you can overload the <code>getSupprotedServiceNames</code> to implement a XServiceInfo.
142 * you can use the static helper methods to combine your services with that of parent
143 * or aggregatet classes.
145 class SvxServiceInfoHelper : public ::com::sun::star::lang::XServiceInfo
147 public:
148 // XServiceInfo
149 virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
150 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
151 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
153 // helper
154 static void addToSequence( ::com::sun::star::uno::Sequence< ::rtl::OUString >& rSeq,UINT16 nServices, /* sal_Char* */... ) throw();
155 static sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& SupportedServices ) throw();
158 /***********************************************************************
159 * class SvxPropertySetInfoPool *
160 ***********************************************************************/
162 const sal_Int32 SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS = 0;
163 const sal_Int32 SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER = 1;
164 const sal_Int32 SVXUNO_SERVICEID_LASTID = 1;
165 }//end of namespace binfilter
166 namespace comphelper { class PropertySetInfo; }
167 namespace binfilter {
168 class SvxPropertySetInfoPool
170 public:
171 static comphelper::PropertySetInfo* getOrCreate( sal_Int32 nServiceId ) throw();
173 private:
174 static comphelper::PropertySetInfo* mpInfos[SVXUNO_SERVICEID_LASTID+1];
177 }//end of namespace binfilter
178 #endif