xref: /trunk/main/cppu/inc/com/sun/star/uno/Type.h (revision 24f6443d)
1*24f6443dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*24f6443dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*24f6443dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*24f6443dSAndrew Rist  * distributed with this work for additional information
6*24f6443dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*24f6443dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*24f6443dSAndrew Rist  * "License"); you may not use this file except in compliance
9*24f6443dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*24f6443dSAndrew Rist  *
11*24f6443dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*24f6443dSAndrew Rist  *
13*24f6443dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*24f6443dSAndrew Rist  * software distributed under the License is distributed on an
15*24f6443dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*24f6443dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*24f6443dSAndrew Rist  * specific language governing permissions and limitations
18*24f6443dSAndrew Rist  * under the License.
19*24f6443dSAndrew Rist  *
20*24f6443dSAndrew Rist  *************************************************************/
21*24f6443dSAndrew Rist 
22*24f6443dSAndrew Rist 
23cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UNO_TYPE_H_
24cdf0e10cSrcweir #define _COM_SUN_STAR_UNO_TYPE_H_
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <typelib/typedescription.h>
27cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UNO_TYPECLASS_HDL_
28cdf0e10cSrcweir #include <com/sun/star/uno/TypeClass.hdl>
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #include <cppu/macros.hxx>
31cdf0e10cSrcweir #include <rtl/ustring.hxx>
32cdf0e10cSrcweir #include <rtl/alloc.h>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir 
35cdf0e10cSrcweir namespace com
36cdf0e10cSrcweir {
37cdf0e10cSrcweir namespace sun
38cdf0e10cSrcweir {
39cdf0e10cSrcweir namespace star
40cdf0e10cSrcweir {
41cdf0e10cSrcweir namespace uno
42cdf0e10cSrcweir {
43cdf0e10cSrcweir 
44cdf0e10cSrcweir /** Enum defining UNO_TYPE_NO_ACQUIRE for type description reference transfer.
45cdf0e10cSrcweir */
46cdf0e10cSrcweir enum UnoType_NoAcquire
47cdf0e10cSrcweir {
48cdf0e10cSrcweir 	/** This enum value can be used for creating a Type object granting a given type description
49cdf0e10cSrcweir         reference, i.e. transferring ownership to it.
50cdf0e10cSrcweir 	*/
51cdf0e10cSrcweir 	UNO_TYPE_NO_ACQUIRE
52cdf0e10cSrcweir };
53cdf0e10cSrcweir 
54cdf0e10cSrcweir /** C++ class representing an IDL meta type. This class is used to represent a a type,
55cdf0e10cSrcweir     i.e. a type name and its type class.
56cdf0e10cSrcweir 	Internally the type holds a C type description reference of the runtime.
57cdf0e10cSrcweir 	You can obtain a full type description of a type by calling member function getDescription().
58cdf0e10cSrcweir 
59cdf0e10cSrcweir     @see typelib_TypeDescriptionReference
60cdf0e10cSrcweir */
61cdf0e10cSrcweir class Type
62cdf0e10cSrcweir {
63cdf0e10cSrcweir 	/** the C typelib reference pointer
64cdf0e10cSrcweir         @internal
65cdf0e10cSrcweir 	*/
66cdf0e10cSrcweir 	typelib_TypeDescriptionReference * _pType;
67cdf0e10cSrcweir 
68cdf0e10cSrcweir public:
69cdf0e10cSrcweir 	// these are here to force memory de/allocation to sal lib.
70cdf0e10cSrcweir     /** @internal */
operator new(size_t nSize)71cdf0e10cSrcweir 	inline static void * SAL_CALL operator new ( size_t nSize ) SAL_THROW( () )
72cdf0e10cSrcweir 		{ return ::rtl_allocateMemory( nSize ); }
73cdf0e10cSrcweir     /** @internal */
operator delete(void * pMem)74cdf0e10cSrcweir 	inline static void SAL_CALL operator delete ( void * pMem ) SAL_THROW( () )
75cdf0e10cSrcweir 		{ ::rtl_freeMemory( pMem ); }
76cdf0e10cSrcweir     /** @internal */
operator new(size_t,void * pMem)77cdf0e10cSrcweir 	inline static void * SAL_CALL operator new ( size_t, void * pMem ) SAL_THROW( () )
78cdf0e10cSrcweir 		{ return pMem; }
79cdf0e10cSrcweir     /** @internal */
operator delete(void *,void *)80cdf0e10cSrcweir 	inline static void SAL_CALL operator delete ( void *, void * ) SAL_THROW( () )
81cdf0e10cSrcweir 		{}
82cdf0e10cSrcweir 
83cdf0e10cSrcweir 	/** Default Constructor: Type is set to void.
84cdf0e10cSrcweir 	*/
85cdf0e10cSrcweir 	inline Type() SAL_THROW( () );
86cdf0e10cSrcweir 
87cdf0e10cSrcweir 	/** Constructor: Type is constructed by given name and type class.
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 		@param eTypeClass type class of type
90cdf0e10cSrcweir 		@param rTypeName name of type
91cdf0e10cSrcweir 	*/
92cdf0e10cSrcweir 	inline Type( TypeClass eTypeClass, const ::rtl::OUString & rTypeName ) SAL_THROW( () );
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 	/** Constructor: Type is constructed by given name and type class.
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 		@param eTypeClass type class of type
97cdf0e10cSrcweir 		@param pTypeName name of type
98cdf0e10cSrcweir 	*/
99cdf0e10cSrcweir 	inline Type( TypeClass eTypeClass, const sal_Char * pTypeName ) SAL_THROW( () );
100cdf0e10cSrcweir 
101cdf0e10cSrcweir 	/** Constructor: Type is (copy) constructed by given C type description reference.
102cdf0e10cSrcweir 
103cdf0e10cSrcweir 		@param pType C type description reference
104cdf0e10cSrcweir 	*/
105cdf0e10cSrcweir 	inline Type( typelib_TypeDescriptionReference * pType ) SAL_THROW( () );
106cdf0e10cSrcweir 
107cdf0e10cSrcweir 	/** Constructor: Type is (copy) constructed by given C type description reference
108cdf0e10cSrcweir         without acquiring it.
109cdf0e10cSrcweir 
110cdf0e10cSrcweir 		@param pType C type description reference
111cdf0e10cSrcweir 		@param dummy UNO_TYPE_NO_ACQUIRE to force obvious distinction to other constructors
112cdf0e10cSrcweir 	*/
113cdf0e10cSrcweir 	inline Type( typelib_TypeDescriptionReference * pType, UnoType_NoAcquire ) SAL_THROW( () );
114cdf0e10cSrcweir 	/** Constructor: Type is (copy) constructed by given C type description reference
115cdf0e10cSrcweir         without acquiring it.
116cdf0e10cSrcweir 
117cdf0e10cSrcweir 		@param pType C type description reference
118cdf0e10cSrcweir 		@param dummy SAL_NO_ACQUIRE to force obvious distinction to other constructors
119cdf0e10cSrcweir 	*/
120cdf0e10cSrcweir 	inline Type( typelib_TypeDescriptionReference * pType, __sal_NoAcquire ) SAL_THROW( () );
121cdf0e10cSrcweir 
122cdf0e10cSrcweir     /** Copy constructor: Type is copy constructed by given type.
123cdf0e10cSrcweir 
124cdf0e10cSrcweir 		@param rType another type
125cdf0e10cSrcweir 	*/
126cdf0e10cSrcweir     inline Type( const Type & rType ) SAL_THROW( () );
127cdf0e10cSrcweir 
128cdf0e10cSrcweir 	/** Destructor: Releases acquired C type description reference.
129cdf0e10cSrcweir 	*/
130cdf0e10cSrcweir     inline ~Type() SAL_THROW( () )
131cdf0e10cSrcweir 		{ ::typelib_typedescriptionreference_release( _pType ); }
132cdf0e10cSrcweir 
133cdf0e10cSrcweir 	/** Assignment operator: Acquires right side type and releases previously set type.
134cdf0e10cSrcweir 
135cdf0e10cSrcweir 		@param rType another type (right side)
136cdf0e10cSrcweir 		@return this type
137cdf0e10cSrcweir 	*/
138cdf0e10cSrcweir 	inline Type & SAL_CALL operator = ( const Type & rType ) SAL_THROW( () );
139cdf0e10cSrcweir 
140cdf0e10cSrcweir 	/** Gets the type class of set type.
141cdf0e10cSrcweir 
142cdf0e10cSrcweir 		@return type class of set type
143cdf0e10cSrcweir 	*/
getTypeClass() const144cdf0e10cSrcweir 	inline TypeClass SAL_CALL getTypeClass() const SAL_THROW( () )
145cdf0e10cSrcweir 		{ return (TypeClass)_pType->eTypeClass; }
146cdf0e10cSrcweir 
147cdf0e10cSrcweir 	/** Gets the name of the set type.
148cdf0e10cSrcweir 
149cdf0e10cSrcweir 		@return name of the set type
150cdf0e10cSrcweir 	*/
151cdf0e10cSrcweir 	inline ::rtl::OUString SAL_CALL getTypeName() const SAL_THROW( () );
152cdf0e10cSrcweir 
153cdf0e10cSrcweir 	/** Obtains a full type description of set type.
154cdf0e10cSrcweir 
155cdf0e10cSrcweir 		@param ppDescr [inout] type description
156cdf0e10cSrcweir 	*/
getDescription(typelib_TypeDescription ** ppDescr) const157cdf0e10cSrcweir 	inline void SAL_CALL getDescription( typelib_TypeDescription ** ppDescr ) const SAL_THROW( () )
158cdf0e10cSrcweir 		{ ::typelib_typedescriptionreference_getDescription( ppDescr, _pType ); }
159cdf0e10cSrcweir 
160cdf0e10cSrcweir 	/** Gets the C typelib type description reference pointer. Does not acquire the reference!
161cdf0e10cSrcweir 
162cdf0e10cSrcweir 		@return UNacquired type description reference
163cdf0e10cSrcweir 	*/
getTypeLibType() const164cdf0e10cSrcweir 	inline typelib_TypeDescriptionReference * SAL_CALL getTypeLibType() const SAL_THROW( () )
165cdf0e10cSrcweir 		{ return _pType; }
166cdf0e10cSrcweir 
167cdf0e10cSrcweir     /** Tests if values of this reflected type can be assigned by values of given type.
168cdf0e10cSrcweir         This includes widening conversion (e.g., long assignable from short), as long as there
169cdf0e10cSrcweir         is no data loss.
170cdf0e10cSrcweir 
171cdf0e10cSrcweir 		@param rType another type
172cdf0e10cSrcweir 		@return true if values of this type can be assigned from values of given type,
173cdf0e10cSrcweir                 false otherwise
174cdf0e10cSrcweir 	*/
isAssignableFrom(const Type & rType) const175cdf0e10cSrcweir 	inline sal_Bool SAL_CALL isAssignableFrom( const Type & rType ) const SAL_THROW( () )
176cdf0e10cSrcweir 		{ return ::typelib_typedescriptionreference_isAssignableFrom( _pType, rType._pType ); }
177cdf0e10cSrcweir 
178cdf0e10cSrcweir 	/** Compares two types.
179cdf0e10cSrcweir 
180cdf0e10cSrcweir 		@param rType another type
181cdf0e10cSrcweir 		@return true if both types refer the same type, false otherwise
182cdf0e10cSrcweir 	*/
equals(const Type & rType) const183cdf0e10cSrcweir 	inline sal_Bool SAL_CALL equals( const Type & rType ) const SAL_THROW( () )
184cdf0e10cSrcweir 		{ return ::typelib_typedescriptionreference_equals( _pType, rType._pType ); }
185cdf0e10cSrcweir 	/** Equality operator: Compares two types.
186cdf0e10cSrcweir 
187cdf0e10cSrcweir 		@param rType another type
188cdf0e10cSrcweir 		@return true if both types refer the same type, false otherwise
189cdf0e10cSrcweir 	*/
operator ==(const Type & rType) const190cdf0e10cSrcweir 	inline sal_Bool SAL_CALL operator == ( const Type & rType ) const SAL_THROW( () )
191cdf0e10cSrcweir 		{ return ::typelib_typedescriptionreference_equals( _pType, rType._pType ); }
192cdf0e10cSrcweir 	/** Unequality operator: Compares two types.
193cdf0e10cSrcweir 
194cdf0e10cSrcweir 		@param rType another type
195cdf0e10cSrcweir 		@return false if both types refer the same type, true otherwise
196cdf0e10cSrcweir 	*/
operator !=(const Type & rType) const197cdf0e10cSrcweir 	inline sal_Bool SAL_CALL operator != ( const Type & rType ) const SAL_THROW( () )
198cdf0e10cSrcweir 		{ return (! ::typelib_typedescriptionreference_equals( _pType, rType._pType )); }
199cdf0e10cSrcweir };
200cdf0e10cSrcweir 
201cdf0e10cSrcweir /** Helper class to specify a type pointer for idl arrays.
202cdf0e10cSrcweir */
203cdf0e10cSrcweir template< class T >
204cdf0e10cSrcweir class Array
205cdf0e10cSrcweir {
206cdf0e10cSrcweir public:
207cdf0e10cSrcweir     static typelib_TypeDescriptionReference * s_pType;
208cdf0e10cSrcweir };
209cdf0e10cSrcweir 
210cdf0e10cSrcweir }
211cdf0e10cSrcweir }
212cdf0e10cSrcweir }
213cdf0e10cSrcweir }
214cdf0e10cSrcweir 
215cdf0e10cSrcweir /** Gets the meta type of IDL type "type".
216cdf0e10cSrcweir 
217cdf0e10cSrcweir     There are cases (involving templates) where uses of getCppuType are known to
218cdf0e10cSrcweir     not compile.  Use cppu::UnoType or cppu::getTypeFavourUnsigned instead.
219cdf0e10cSrcweir 
220cdf0e10cSrcweir 	@param dummy typed pointer for function signature
221cdf0e10cSrcweir 	@return type of IDL type "type"
222cdf0e10cSrcweir */
223cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const ::com::sun::star::uno::Type * ) SAL_THROW( () );
224cdf0e10cSrcweir 
225cdf0e10cSrcweir /** Gets the meta type of IDL type void.
226cdf0e10cSrcweir 	@return type of IDL type void
227cdf0e10cSrcweir */
228cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuVoidType() SAL_THROW( () );
229cdf0e10cSrcweir /** Gets the meta type of IDL type void.
230cdf0e10cSrcweir 
231cdf0e10cSrcweir 	@return type of IDL type void
232cdf0e10cSrcweir */
233cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getVoidCppuType() SAL_THROW( () );
234cdf0e10cSrcweir 
235cdf0e10cSrcweir /** Gets the meta type of IDL type boolean.
236cdf0e10cSrcweir 
237cdf0e10cSrcweir 	@return type of IDL type boolean
238cdf0e10cSrcweir */
239cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuBooleanType() SAL_THROW( () );
240cdf0e10cSrcweir /** Gets the meta type of IDL type boolean.
241cdf0e10cSrcweir 
242cdf0e10cSrcweir 	@return type of IDL type boolean
243cdf0e10cSrcweir */
244cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getBooleanCppuType() SAL_THROW( () );
245cdf0e10cSrcweir /** Gets the meta type of IDL type boolean.
246cdf0e10cSrcweir 
247cdf0e10cSrcweir     There are cases (involving templates) where uses of getCppuType are known to
248cdf0e10cSrcweir     not compile.  Use cppu::UnoType or cppu::getTypeFavourUnsigned instead.
249cdf0e10cSrcweir 
250cdf0e10cSrcweir 	@param dummy typed pointer for function signature
251cdf0e10cSrcweir 	@return type of IDL type boolean
252cdf0e10cSrcweir */
253cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Bool * ) SAL_THROW( () );
254cdf0e10cSrcweir /** Gets the meta type of IDL type boolean.
255cdf0e10cSrcweir 
256cdf0e10cSrcweir     There are cases (involving templates) where uses of getCppuType are known to
257cdf0e10cSrcweir     not compile.  Use cppu::UnoType or cppu::getTypeFavourUnsigned instead.
258cdf0e10cSrcweir 
259cdf0e10cSrcweir 	@param dummy typed pointer for function signature
260cdf0e10cSrcweir 	@return type of IDL type boolean
261cdf0e10cSrcweir */
262cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType(
263cdf0e10cSrcweir     bool const * ) SAL_THROW( () );
264cdf0e10cSrcweir 
265cdf0e10cSrcweir /** Gets the meta type of IDL type char.
266cdf0e10cSrcweir 
267cdf0e10cSrcweir 	@return type of IDL type char
268cdf0e10cSrcweir */
269cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCharCppuType() SAL_THROW( () );
270cdf0e10cSrcweir /** Gets the meta type of IDL type char.
271cdf0e10cSrcweir 
272cdf0e10cSrcweir 	@return type of IDL type char
273cdf0e10cSrcweir */
274cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuCharType() SAL_THROW( () );
275cdf0e10cSrcweir 
276cdf0e10cSrcweir /** Gets the meta type of IDL type byte.
277cdf0e10cSrcweir 
278cdf0e10cSrcweir     There are cases (involving templates) where uses of getCppuType are known to
279cdf0e10cSrcweir     not compile.  Use cppu::UnoType or cppu::getTypeFavourUnsigned instead.
280cdf0e10cSrcweir 
281cdf0e10cSrcweir 	@param dummy typed pointer for function signature
282cdf0e10cSrcweir 	@return type of IDL type byte
283cdf0e10cSrcweir */
284cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int8 * ) SAL_THROW( () );
285cdf0e10cSrcweir 
286cdf0e10cSrcweir /** Gets the meta type of IDL type string.
287cdf0e10cSrcweir 
288cdf0e10cSrcweir     There are cases (involving templates) where uses of getCppuType are known to
289cdf0e10cSrcweir     not compile.  Use cppu::UnoType or cppu::getTypeFavourUnsigned instead.
290cdf0e10cSrcweir 
291cdf0e10cSrcweir 	@param dummy typed pointer for function signature
292cdf0e10cSrcweir 	@return type of IDL type string
293cdf0e10cSrcweir */
294cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const ::rtl::OUString * ) SAL_THROW( () );
295cdf0e10cSrcweir 
296cdf0e10cSrcweir /** Gets the meta type of IDL type short.
297cdf0e10cSrcweir 
298cdf0e10cSrcweir     There are cases (involving templates) where uses of getCppuType are known to
299cdf0e10cSrcweir     not compile.  Use cppu::UnoType or cppu::getTypeFavourUnsigned instead.
300cdf0e10cSrcweir 
301cdf0e10cSrcweir 	@param dummy typed pointer for function signature
302cdf0e10cSrcweir 	@return type of IDL type short
303cdf0e10cSrcweir */
304cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int16 * ) SAL_THROW( () );
305cdf0e10cSrcweir 
306cdf0e10cSrcweir /** Gets the meta type of IDL type unsigned short.
307cdf0e10cSrcweir 
308cdf0e10cSrcweir     There are cases (involving templates) where uses of getCppuType are known to
309cdf0e10cSrcweir     not compile.  Use cppu::UnoType or cppu::getTypeFavourUnsigned instead.
310cdf0e10cSrcweir 
311cdf0e10cSrcweir 	@param dummy typed pointer for function signature
312cdf0e10cSrcweir 	@return type of IDL type unsigned short
313cdf0e10cSrcweir */
314cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt16 * ) SAL_THROW( () );
315cdf0e10cSrcweir 
316cdf0e10cSrcweir /** Gets the meta type of IDL type long.
317cdf0e10cSrcweir 
318cdf0e10cSrcweir     There are cases (involving templates) where uses of getCppuType are known to
319cdf0e10cSrcweir     not compile.  Use cppu::UnoType or cppu::getTypeFavourUnsigned instead.
320cdf0e10cSrcweir 
321cdf0e10cSrcweir 	@param dummy typed pointer for function signature
322cdf0e10cSrcweir 	@return type of IDL type long
323cdf0e10cSrcweir */
324cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int32 * ) SAL_THROW( () );
325cdf0e10cSrcweir 
326cdf0e10cSrcweir /** Gets the meta type of IDL type unsigned long.
327cdf0e10cSrcweir 
328cdf0e10cSrcweir     There are cases (involving templates) where uses of getCppuType are known to
329cdf0e10cSrcweir     not compile.  Use cppu::UnoType or cppu::getTypeFavourUnsigned instead.
330cdf0e10cSrcweir 
331cdf0e10cSrcweir 	@param dummy typed pointer for function signature
332cdf0e10cSrcweir 	@return type of IDL type unsigned long
333cdf0e10cSrcweir */
334cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt32 * ) SAL_THROW( () );
335cdf0e10cSrcweir 
336cdf0e10cSrcweir /** Gets the meta type of IDL type hyper.
337cdf0e10cSrcweir 
338cdf0e10cSrcweir     There are cases (involving templates) where uses of getCppuType are known to
339cdf0e10cSrcweir     not compile.  Use cppu::UnoType or cppu::getTypeFavourUnsigned instead.
340cdf0e10cSrcweir 
341cdf0e10cSrcweir 	@param dummy typed pointer for function signature
342cdf0e10cSrcweir 	@return type of IDL type hyper
343cdf0e10cSrcweir */
344cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int64 * ) SAL_THROW( () );
345cdf0e10cSrcweir 
346cdf0e10cSrcweir /** Gets the meta type of IDL type unsigned hyper.
347cdf0e10cSrcweir 
348cdf0e10cSrcweir     There are cases (involving templates) where uses of getCppuType are known to
349cdf0e10cSrcweir     not compile.  Use cppu::UnoType or cppu::getTypeFavourUnsigned instead.
350cdf0e10cSrcweir 
351cdf0e10cSrcweir 	@param dummy typed pointer for function signature
352cdf0e10cSrcweir 	@return type of IDL type unsigned hyper
353cdf0e10cSrcweir */
354cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt64 * ) SAL_THROW( () );
355cdf0e10cSrcweir 
356cdf0e10cSrcweir /** Gets the meta type of IDL type float.
357cdf0e10cSrcweir 
358cdf0e10cSrcweir     There are cases (involving templates) where uses of getCppuType are known to
359cdf0e10cSrcweir     not compile.  Use cppu::UnoType or cppu::getTypeFavourUnsigned instead.
360cdf0e10cSrcweir 
361cdf0e10cSrcweir 	@param dummy typed pointer for function signature
362cdf0e10cSrcweir 	@return type of IDL type float
363cdf0e10cSrcweir */
364cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const float * ) SAL_THROW( () );
365cdf0e10cSrcweir 
366cdf0e10cSrcweir /** Gets the meta type of IDL type double.
367cdf0e10cSrcweir 
368cdf0e10cSrcweir     There are cases (involving templates) where uses of getCppuType are known to
369cdf0e10cSrcweir     not compile.  Use cppu::UnoType or cppu::getTypeFavourUnsigned instead.
370cdf0e10cSrcweir 
371cdf0e10cSrcweir 	@param dummy typed pointer for function signature
372cdf0e10cSrcweir 	@return type of IDL type double
373cdf0e10cSrcweir */
374cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const double * ) SAL_THROW( () );
375cdf0e10cSrcweir 
376cdf0e10cSrcweir /** Array template function to get meta type for one-dimensional arrays.
377cdf0e10cSrcweir 
378cdf0e10cSrcweir     @param pT array pointer
379cdf0e10cSrcweir 	@return type of array
380cdf0e10cSrcweir */
381cdf0e10cSrcweir template< class T >
382cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuArrayType1( T * pT ) SAL_THROW( () );
383cdf0e10cSrcweir /** Array template function to get meta type for two-dimensional arrays.
384cdf0e10cSrcweir 
385cdf0e10cSrcweir     @param pT array pointer
386cdf0e10cSrcweir     @return type of array
387cdf0e10cSrcweir */
388cdf0e10cSrcweir template< class T >
389cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuArrayType2( T * pT ) SAL_THROW( () );
390cdf0e10cSrcweir /** Array template function to get meta type for three-dimensional arrays.
391cdf0e10cSrcweir 
392cdf0e10cSrcweir     @param pT array pointer
393cdf0e10cSrcweir     @return type of array
394cdf0e10cSrcweir */
395cdf0e10cSrcweir template< class T >
396cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuArrayType3( T * pT ) SAL_THROW( () );
397cdf0e10cSrcweir /** Array template function to get meta type for four-dimensional arrays.
398cdf0e10cSrcweir 
399cdf0e10cSrcweir     @param pT array pointer
400cdf0e10cSrcweir     @return type of array
401cdf0e10cSrcweir */
402cdf0e10cSrcweir template< class T >
403cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuArrayType4( T * pT ) SAL_THROW( () );
404cdf0e10cSrcweir /** Array template function to get meta type for five-dimensional arrays.
405cdf0e10cSrcweir 
406cdf0e10cSrcweir     @param pT array pointer
407cdf0e10cSrcweir     @return type of array
408cdf0e10cSrcweir */
409cdf0e10cSrcweir template< class T >
410cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuArrayType5( T * pT ) SAL_THROW( () );
411cdf0e10cSrcweir /** Array template function to get meta type for six-dimensional arrays.
412cdf0e10cSrcweir 
413cdf0e10cSrcweir     @param pT array pointer
414cdf0e10cSrcweir 	@return type of array
415cdf0e10cSrcweir */
416cdf0e10cSrcweir template< class T >
417cdf0e10cSrcweir inline const ::com::sun::star::uno::Type & SAL_CALL getCppuArrayType6( T * pT ) SAL_THROW( () );
418cdf0e10cSrcweir 
419cdf0e10cSrcweir /** Gets the meta type of an IDL type.
420cdf0e10cSrcweir 
421cdf0e10cSrcweir     The difference between this function template (with a type parameter) and
422cdf0e10cSrcweir     the overloaded getCppuType function with a single (dummy) parameter of a
423cdf0e10cSrcweir     specific type is that this function template may not work for the UNO type
424cdf0e10cSrcweir     "unsigned short" (sal_uInt16 in C++), while the overloaded one-parameter
425cdf0e10cSrcweir     function may not work for the UNO type "char" (sal_Unicode in C++, which may
426cdf0e10cSrcweir     have the same underlying C++ type as sal_uInt16 on certain platforms).
427cdf0e10cSrcweir 
428cdf0e10cSrcweir     @return type of the given IDL type
429cdf0e10cSrcweir 
430cdf0e10cSrcweir     @deprecated
431cdf0e10cSrcweir     Use cppu::UnoType instead (or the internal-only cppu::getTypeFavourChar).
432cdf0e10cSrcweir     Also note that getCppuType< com::sun::star::uno::Sequence< sal_Unicode > >()
433cdf0e10cSrcweir     does not work as expected.
434cdf0e10cSrcweir 
435cdf0e10cSrcweir     @since UDK 3.2.0
436cdf0e10cSrcweir */
437cdf0e10cSrcweir template< typename T > inline const ::com::sun::star::uno::Type & SAL_CALL
438cdf0e10cSrcweir getCppuType() SAL_THROW(());
439cdf0e10cSrcweir 
440cdf0e10cSrcweir /** Gets the meta type of IDL type char.
441cdf0e10cSrcweir 
442cdf0e10cSrcweir     @return type of IDL type char
443cdf0e10cSrcweir 
444cdf0e10cSrcweir     @deprecated
445cdf0e10cSrcweir     Use cppu::UnoType instead (or the internal-only cppu::getTypeFavourChar).
446cdf0e10cSrcweir     Also note that getCppuType< com::sun::star::uno::Sequence< sal_Unicode > >()
447cdf0e10cSrcweir     does not work as expected.
448cdf0e10cSrcweir 
449cdf0e10cSrcweir     @since UDK 3.2.0
450cdf0e10cSrcweir */
451cdf0e10cSrcweir template<> inline const ::com::sun::star::uno::Type & SAL_CALL
452cdf0e10cSrcweir getCppuType< sal_Unicode >() SAL_THROW(());
453cdf0e10cSrcweir 
454cdf0e10cSrcweir #endif
455