UDK 3.2.7 C/C++ API Reference
|
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 00002 /************************************************************************* 00003 * 00004 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 00005 * 00006 * Copyright 2000, 2010 Oracle and/or its affiliates. 00007 * 00008 * OpenOffice.org - a multi-platform office productivity suite 00009 * 00010 * This file is part of OpenOffice.org. 00011 * 00012 * OpenOffice.org is free software: you can redistribute it and/or modify 00013 * it under the terms of the GNU Lesser General Public License version 3 00014 * only, as published by the Free Software Foundation. 00015 * 00016 * OpenOffice.org is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Lesser General Public License version 3 for more details 00020 * (a copy is included in the LICENSE file that accompanied this code). 00021 * 00022 * You should have received a copy of the GNU Lesser General Public License 00023 * version 3 along with OpenOffice.org. If not, see 00024 * <http://www.openoffice.org/license.html> 00025 * for a copy of the LGPLv3 License. 00026 * 00027 ************************************************************************/ 00028 #ifndef _COM_SUN_STAR_UNO_TYPE_H_ 00029 #define _COM_SUN_STAR_UNO_TYPE_H_ 00030 00031 #include <typelib/typedescription.h> 00032 #ifndef _COM_SUN_STAR_UNO_TYPECLASS_HDL_ 00033 #include <com/sun/star/uno/TypeClass.hdl> 00034 #endif 00035 #include <cppu/macros.hxx> 00036 #include <rtl/ustring.hxx> 00037 #include <rtl/alloc.h> 00038 00039 00040 namespace com 00041 { 00042 namespace sun 00043 { 00044 namespace star 00045 { 00046 namespace uno 00047 { 00048 00051 enum UnoType_NoAcquire 00052 { 00056 UNO_TYPE_NO_ACQUIRE 00057 }; 00058 00066 class Type 00067 { 00070 typelib_TypeDescriptionReference * _pType; 00071 00072 public: 00074 // these are here to force memory de/allocation to sal lib. 00075 inline static void * SAL_CALL operator new ( size_t nSize ) SAL_THROW(()) 00076 { return ::rtl_allocateMemory( nSize ); } 00077 inline static void SAL_CALL operator delete ( void * pMem ) SAL_THROW(()) 00078 { ::rtl_freeMemory( pMem ); } 00079 inline static void * SAL_CALL operator new ( size_t, void * pMem ) SAL_THROW(()) 00080 { return pMem; } 00081 inline static void SAL_CALL operator delete ( void *, void * ) SAL_THROW(()) 00082 {} 00084 00087 inline Type() SAL_THROW(()); 00088 00094 inline Type( TypeClass eTypeClass, const ::rtl::OUString & rTypeName ) SAL_THROW(()); 00095 00101 inline Type( TypeClass eTypeClass, const sal_Char * pTypeName ) SAL_THROW(()); 00102 00107 inline Type( typelib_TypeDescriptionReference * pType ) SAL_THROW(()); 00108 00115 inline Type( typelib_TypeDescriptionReference * pType, UnoType_NoAcquire dummy ) SAL_THROW(()); 00122 inline Type( typelib_TypeDescriptionReference * pType, __sal_NoAcquire dummy ) SAL_THROW(()); 00123 00128 inline Type( const Type & rType ) SAL_THROW(()); 00129 00132 inline ~Type() SAL_THROW(()) 00133 { ::typelib_typedescriptionreference_release( _pType ); } 00134 00140 inline Type & SAL_CALL operator = ( const Type & rType ) SAL_THROW(()); 00141 00146 inline TypeClass SAL_CALL getTypeClass() const SAL_THROW(()) 00147 { return (TypeClass)_pType->eTypeClass; } 00148 00153 inline ::rtl::OUString SAL_CALL getTypeName() const SAL_THROW(()); 00154 00159 inline void SAL_CALL getDescription( typelib_TypeDescription ** ppDescr ) const SAL_THROW(()) 00160 { ::typelib_typedescriptionreference_getDescription( ppDescr, _pType ); } 00161 00166 inline typelib_TypeDescriptionReference * SAL_CALL getTypeLibType() const SAL_THROW(()) 00167 { return _pType; } 00168 00177 inline sal_Bool SAL_CALL isAssignableFrom( const Type & rType ) const SAL_THROW(()) 00178 { return ::typelib_typedescriptionreference_isAssignableFrom( _pType, rType._pType ); } 00179 00185 inline sal_Bool SAL_CALL equals( const Type & rType ) const SAL_THROW(()) 00186 { return ::typelib_typedescriptionreference_equals( _pType, rType._pType ); } 00192 inline sal_Bool SAL_CALL operator == ( const Type & rType ) const SAL_THROW(()) 00193 { return ::typelib_typedescriptionreference_equals( _pType, rType._pType ); } 00199 inline sal_Bool SAL_CALL operator != ( const Type & rType ) const SAL_THROW(()) 00200 { return (! ::typelib_typedescriptionreference_equals( _pType, rType._pType )); } 00201 }; 00202 00205 template< class T > 00206 class Array 00207 { 00208 public: 00209 static typelib_TypeDescriptionReference * s_pType; 00210 }; 00211 00212 } 00213 } 00214 } 00215 } 00216 00226 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const ::com::sun::star::uno::Type * ) SAL_THROW(()); 00227 00231 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuVoidType() SAL_THROW(()); 00236 inline const ::com::sun::star::uno::Type & SAL_CALL getVoidCppuType() SAL_THROW(()); 00237 00242 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuBooleanType() SAL_THROW(()); 00247 inline const ::com::sun::star::uno::Type & SAL_CALL getBooleanCppuType() SAL_THROW(()); 00257 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Bool * ) SAL_THROW(()); 00267 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( 00268 bool const * ) SAL_THROW(()); 00269 00274 inline const ::com::sun::star::uno::Type & SAL_CALL getCharCppuType() SAL_THROW(()); 00279 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuCharType() SAL_THROW(()); 00280 00290 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int8 * ) SAL_THROW(()); 00291 00301 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const ::rtl::OUString * ) SAL_THROW(()); 00302 00312 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int16 * ) SAL_THROW(()); 00313 00323 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt16 * ) SAL_THROW(()); 00324 00334 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int32 * ) SAL_THROW(()); 00335 00345 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt32 * ) SAL_THROW(()); 00346 00356 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int64 * ) SAL_THROW(()); 00357 00367 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt64 * ) SAL_THROW(()); 00368 00378 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const float * ) SAL_THROW(()); 00379 00389 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const double * ) SAL_THROW(()); 00390 00396 template< class T > 00397 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuArrayType1( T * pT ) SAL_THROW(()); 00403 template< class T > 00404 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuArrayType2( T * pT ) SAL_THROW(()); 00410 template< class T > 00411 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuArrayType3( T * pT ) SAL_THROW(()); 00417 template< class T > 00418 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuArrayType4( T * pT ) SAL_THROW(()); 00424 template< class T > 00425 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuArrayType5( T * pT ) SAL_THROW(()); 00431 template< class T > 00432 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuArrayType6( T * pT ) SAL_THROW(()); 00433 00452 template< typename T > inline const ::com::sun::star::uno::Type & SAL_CALL 00453 getCppuType() SAL_THROW(()); 00454 00466 template<> inline const ::com::sun::star::uno::Type & SAL_CALL 00467 getCppuType< sal_Unicode >() SAL_THROW(()); 00468 00469 #endif 00470 00471 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */