AlterOffice
AlterOffice 3.4 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Type.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 
3 #ifndef INCLUDED_COM_SUN_STAR_UNO_TYPE_H
4 #define INCLUDED_COM_SUN_STAR_UNO_TYPE_H
5 
7 #include "com/sun/star/uno/TypeClass.hdl"
8 #include "rtl/ustring.hxx"
9 #include "rtl/alloc.h"
10 
11 
12 namespace com
13 {
14 namespace sun
15 {
16 namespace star
17 {
18 namespace uno
19 {
20 
24 {
29 };
30 
38 class SAL_WARN_UNUSED SAL_DLLPUBLIC_RTTI Type
39 {
43 
44 public:
46  // these are here to force memory de/allocation to sal lib.
47  static void * SAL_CALL operator new ( size_t nSize )
48  { return ::rtl_allocateMemory( nSize ); }
49  static void SAL_CALL operator delete ( void * pMem )
50  { ::rtl_freeMemory( pMem ); }
51  static void * SAL_CALL operator new ( size_t, void * pMem )
52  { return pMem; }
53  static void SAL_CALL operator delete ( void *, void * )
54  {}
56 
59  inline Type();
60 
66  inline Type( TypeClass eTypeClass, const ::rtl::OUString & rTypeName );
67 
73  inline Type( TypeClass eTypeClass, const char * pTypeName );
74 
79  inline Type( typelib_TypeDescriptionReference * pType );
80 
94  inline Type( typelib_TypeDescriptionReference * pType, __sal_NoAcquire dummy );
95 
100  inline Type( const Type & rType );
101 
106 
112  inline Type & SAL_CALL operator = ( const Type & rType );
113 
114 #if defined LIBO_INTERNAL_ONLY
115  inline Type & SAL_CALL operator = ( Type && );
116 #endif
117 
122  TypeClass SAL_CALL getTypeClass() const
123  { return static_cast<TypeClass>(_pType->eTypeClass); }
124 
129  inline ::rtl::OUString SAL_CALL getTypeName() const;
130 
135  void SAL_CALL getDescription( typelib_TypeDescription ** ppDescr ) const
137 
143  { return _pType; }
144 
153  bool SAL_CALL isAssignableFrom( const Type & rType ) const
155 
161  bool SAL_CALL equals( const Type & rType ) const
162  { return ::typelib_typedescriptionreference_equals( _pType, rType._pType ); }
168  bool SAL_CALL operator == ( const Type & rType ) const
169  { return ::typelib_typedescriptionreference_equals( _pType, rType._pType ); }
175  bool SAL_CALL operator != ( const Type & rType ) const
176  { return (! ::typelib_typedescriptionreference_equals( _pType, rType._pType )); }
177 };
178 
181 template< class T >
182 class Array
183 {
184 public:
186 };
187 
188 }
189 }
190 }
191 }
192 
205 SAL_DEPRECATED("use cppu::UnoType")
206 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const ::com::sun::star::uno::Type * );
207 
214 SAL_DEPRECATED("use cppu::UnoType")
215 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuVoidType();
223 SAL_DEPRECATED("use cppu::UnoType")
224 inline const ::com::sun::star::uno::Type & SAL_CALL getVoidCppuType();
225 
233 SAL_DEPRECATED("use cppu::UnoType")
234 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuBooleanType();
242 SAL_DEPRECATED("use cppu::UnoType")
243 inline const ::com::sun::star::uno::Type & SAL_CALL getBooleanCppuType();
256 SAL_DEPRECATED("use cppu::UnoType")
257 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Bool * );
270 SAL_DEPRECATED("use cppu::UnoType")
271 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType(
272  bool const * );
273 
281 SAL_DEPRECATED("use cppu::UnoType")
282 inline const ::com::sun::star::uno::Type & SAL_CALL getCharCppuType();
290 SAL_DEPRECATED("use cppu::UnoType")
291 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuCharType();
292 
305 SAL_DEPRECATED("use cppu::UnoType")
306 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int8 * );
307 
320 SAL_DEPRECATED("use cppu::UnoType")
321 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const ::rtl::OUString * );
322 
335 SAL_DEPRECATED("use cppu::UnoType")
336 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int16 * );
337 
350 SAL_DEPRECATED("use cppu::UnoType")
351 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt16 * );
352 
365 SAL_DEPRECATED("use cppu::UnoType")
366 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int32 * );
367 
380 SAL_DEPRECATED("use cppu::UnoType")
381 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt32 * );
382 
395 SAL_DEPRECATED("use cppu::UnoType")
396 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int64 * );
397 
410 SAL_DEPRECATED("use cppu::UnoType")
411 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt64 * );
412 
425 SAL_DEPRECATED("use cppu::UnoType")
426 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const float * );
427 
440 SAL_DEPRECATED("use cppu::UnoType")
441 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const double * );
442 
461 template< typename T > SAL_DEPRECATED("use cppu::UnoType")
462 inline const ::com::sun::star::uno::Type & SAL_CALL
463 getCppuType();
464 
476 template<> SAL_DEPRECATED("use cppu::UnoType")
477 inline const ::com::sun::star::uno::Type & SAL_CALL
478 getCppuType< sal_Unicode >();
479 
480 #endif
481 
482 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
~Type()
Destructor: Releases acquired C type description reference.
Definition: Type.h:104
CPPU_DLLPUBLIC void typelib_typedescriptionreference_release(typelib_TypeDescriptionReference *pRef) SAL_THROW_EXTERN_C()
Increments reference count of type description reference.
const ::com::sun::star::uno::Type & getBooleanCppuType()
Gets the meta type of IDL type boolean.
Definition: Type.hxx:123
unsigned char sal_Bool
Definition: types.h:18
SAL_DLLPUBLIC void rtl_freeMemory(void *Ptr) SAL_THROW_EXTERN_C()
Free memory.
struct SAL_DLLPUBLIC_RTTI _typelib_TypeDescriptionReference typelib_TypeDescriptionReference
Holds a weak reference to a type description.
__sal_NoAcquire
Definition: types.h:332
const ::com::sun::star::uno::Type & getCppuType(SAL_UNUSED_PARAMETER const ::com::sun::star::uno::Any *)
Gets the meta type of IDL type any.
Definition: Any.h:470
typelib_TypeDescriptionReference * getTypeLibType() const
Gets the C typelib type description reference pointer.
Definition: Type.h:142
sal_uInt16 sal_Unicode
Definition: types.h:103
CPPU_DLLPUBLIC void typelib_typedescriptionreference_getDescription(typelib_TypeDescription **ppRet, typelib_TypeDescriptionReference *pRef) SAL_THROW_EXTERN_C()
Retrieves the type description for a given reference.
const ::com::sun::star::uno::Type & getCharCppuType()
Gets the meta type of IDL type char.
Definition: Type.hxx:138
bool operator==(const Any &rAny, const C &value)
Template equality operator: compares set value of left side any to right side value.
Definition: Any.hxx:642
static typelib_TypeDescriptionReference * s_pType
Definition: Type.h:185
const ::com::sun::star::uno::Type & getCppuVoidType()
Gets the meta type of IDL type void.
Definition: Type.hxx:110
#define SAL_DEPRECATED(message)
Use as follows: SAL_DEPRECATED(&quot;Don&#39;t use, it&#39;s evil.&quot;) void doit(int nPara);.
Definition: types.h:454
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:567
const ::com::sun::star::uno::Type & getVoidCppuType()
Gets the meta type of IDL type void.
Definition: Type.hxx:114
C++ class representing an IDL meta type.
Definition: Type.h:38
const ::com::sun::star::uno::Type & getCppuCharType()
Gets the meta type of IDL type char.
Definition: Type.hxx:142
struct SAL_DLLPUBLIC_RTTI _typelib_TypeDescription typelib_TypeDescription
Full type description of a type.
bool operator!=(const Any &rAny, const C &value)
Template inequality operator: compares set value of left side any to right side value.
Definition: Any.hxx:653
UnoType_NoAcquire
Enum defining UNO_TYPE_NO_ACQUIRE for type description reference transfer.
Definition: Type.h:23
CPPU_DLLPUBLIC sal_Bool typelib_typedescriptionreference_isAssignableFrom(typelib_TypeDescriptionReference *pAssignable, typelib_TypeDescriptionReference *pFrom) SAL_THROW_EXTERN_C()
Tests if values of type pAssignable can be assigned by values of type pFrom.
CPPU_DLLPUBLIC sal_Bool typelib_typedescriptionreference_equals(const typelib_TypeDescriptionReference *p1, const typelib_TypeDescriptionReference *p2) SAL_THROW_EXTERN_C()
Tests whether two types description references are equal, i.e.
const ::com::sun::star::uno::Type & getCppuBooleanType()
Gets the meta type of IDL type boolean.
Definition: Type.hxx:119
SAL_DLLPUBLIC void * rtl_allocateMemory(sal_Size Bytes) SAL_THROW_EXTERN_C()
Allocate memory.
This enum value can be used for creating a Type object granting a given type description reference...
Definition: Type.h:28
signed char sal_Int8
Definition: types.h:23
Helper class to specify a type pointer for idl arrays.
Definition: Type.h:182
bool equals(const Type &rType) const
Compares two types.
Definition: Type.h:161
rtl::OUString getTypeName(rtl::OUString const &rEnvDcp)
Get the OBI type part of an environment descriptor.
Definition: EnvDcp.hxx:21
bool isAssignableFrom(const Type &rType) const
Tests if values of this reflected type can be assigned by values of given type.
Definition: Type.h:153
void getDescription(typelib_TypeDescription **ppDescr) const
Obtains a full type description of set type.
Definition: Type.h:135
TypeClass getTypeClass() const
Gets the type class of set type.
Definition: Type.h:122