|
UDK 3.2.7 C/C++ API Reference
|
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 00002 /* 00003 * This file is part of the LibreOffice project. 00004 * 00005 * This Source Code Form is subject to the terms of the Mozilla Public 00006 * License, v. 2.0. If a copy of the MPL was not distributed with this 00007 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 00008 * 00009 * This file incorporates work covered by the following license notice: 00010 * 00011 * Licensed to the Apache Software Foundation (ASF) under one or more 00012 * contributor license agreements. See the NOTICE file distributed 00013 * with this work for additional information regarding copyright 00014 * ownership. The ASF licenses this file to you under the Apache 00015 * License, Version 2.0 (the "License"); you may not use this file 00016 * except in compliance with the License. You may obtain a copy of 00017 * the License at http://www.apache.org/licenses/LICENSE-2.0 . 00018 */ 00019 #ifndef _COM_SUN_STAR_UNO_TYPE_H_ 00020 #define _COM_SUN_STAR_UNO_TYPE_H_ 00021 00022 #include <typelib/typedescription.h> 00023 #include <com/sun/star/uno/TypeClass.hdl> 00024 #include <cppu/macros.hxx> 00025 #include <rtl/ustring.hxx> 00026 #include <rtl/alloc.h> 00027 00028 00029 namespace com 00030 { 00031 namespace sun 00032 { 00033 namespace star 00034 { 00035 namespace uno 00036 { 00037 00040 enum UnoType_NoAcquire 00041 { 00045 UNO_TYPE_NO_ACQUIRE 00046 }; 00047 00055 class Type 00056 { 00059 typelib_TypeDescriptionReference * _pType; 00060 00061 public: 00063 // these are here to force memory de/allocation to sal lib. 00064 inline static void * SAL_CALL operator new ( size_t nSize ) SAL_THROW(()) 00065 { return ::rtl_allocateMemory( nSize ); } 00066 inline static void SAL_CALL operator delete ( void * pMem ) SAL_THROW(()) 00067 { ::rtl_freeMemory( pMem ); } 00068 inline static void * SAL_CALL operator new ( size_t, void * pMem ) SAL_THROW(()) 00069 { return pMem; } 00070 inline static void SAL_CALL operator delete ( void *, void * ) SAL_THROW(()) 00071 {} 00073 00076 inline Type() SAL_THROW(()); 00077 00083 inline Type( TypeClass eTypeClass, const ::rtl::OUString & rTypeName ) SAL_THROW(()); 00084 00090 inline Type( TypeClass eTypeClass, const sal_Char * pTypeName ) SAL_THROW(()); 00091 00096 inline Type( typelib_TypeDescriptionReference * pType ) SAL_THROW(()); 00097 00104 inline Type( typelib_TypeDescriptionReference * pType, UnoType_NoAcquire dummy ) SAL_THROW(()); 00111 inline Type( typelib_TypeDescriptionReference * pType, __sal_NoAcquire dummy ) SAL_THROW(()); 00112 00117 inline Type( const Type & rType ) SAL_THROW(()); 00118 00121 inline ~Type() SAL_THROW(()) 00122 { ::typelib_typedescriptionreference_release( _pType ); } 00123 00129 inline Type & SAL_CALL operator = ( const Type & rType ) SAL_THROW(()); 00130 00135 inline TypeClass SAL_CALL getTypeClass() const SAL_THROW(()) 00136 { return (TypeClass)_pType->eTypeClass; } 00137 00142 inline ::rtl::OUString SAL_CALL getTypeName() const SAL_THROW(()); 00143 00148 inline void SAL_CALL getDescription( typelib_TypeDescription ** ppDescr ) const SAL_THROW(()) 00149 { ::typelib_typedescriptionreference_getDescription( ppDescr, _pType ); } 00150 00155 inline typelib_TypeDescriptionReference * SAL_CALL getTypeLibType() const SAL_THROW(()) 00156 { return _pType; } 00157 00166 inline sal_Bool SAL_CALL isAssignableFrom( const Type & rType ) const SAL_THROW(()) 00167 { return ::typelib_typedescriptionreference_isAssignableFrom( _pType, rType._pType ); } 00168 00174 inline sal_Bool SAL_CALL equals( const Type & rType ) const SAL_THROW(()) 00175 { return ::typelib_typedescriptionreference_equals( _pType, rType._pType ); } 00181 inline sal_Bool SAL_CALL operator == ( const Type & rType ) const SAL_THROW(()) 00182 { return ::typelib_typedescriptionreference_equals( _pType, rType._pType ); } 00188 inline sal_Bool SAL_CALL operator != ( const Type & rType ) const SAL_THROW(()) 00189 { return (! ::typelib_typedescriptionreference_equals( _pType, rType._pType )); } 00190 }; 00191 00194 template< class T > 00195 class Array 00196 { 00197 public: 00198 static typelib_TypeDescriptionReference * s_pType; 00199 }; 00200 00201 } 00202 } 00203 } 00204 } 00205 00215 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const ::com::sun::star::uno::Type * ) SAL_THROW(()); 00216 00220 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuVoidType() SAL_THROW(()); 00225 inline const ::com::sun::star::uno::Type & SAL_CALL getVoidCppuType() SAL_THROW(()); 00226 00231 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuBooleanType() SAL_THROW(()); 00236 inline const ::com::sun::star::uno::Type & SAL_CALL getBooleanCppuType() SAL_THROW(()); 00246 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Bool * ) SAL_THROW(()); 00256 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( 00257 bool const * ) SAL_THROW(()); 00258 00263 inline const ::com::sun::star::uno::Type & SAL_CALL getCharCppuType() SAL_THROW(()); 00268 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuCharType() SAL_THROW(()); 00269 00279 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int8 * ) SAL_THROW(()); 00280 00290 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const ::rtl::OUString * ) SAL_THROW(()); 00291 00301 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int16 * ) SAL_THROW(()); 00302 00312 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt16 * ) SAL_THROW(()); 00313 00323 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int32 * ) SAL_THROW(()); 00324 00334 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt32 * ) SAL_THROW(()); 00335 00345 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_Int64 * ) SAL_THROW(()); 00346 00356 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const sal_uInt64 * ) SAL_THROW(()); 00357 00367 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const float * ) SAL_THROW(()); 00368 00378 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuType( const double * ) SAL_THROW(()); 00379 00385 template< class T > 00386 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuArrayType1( T * pT ) SAL_THROW(()); 00392 template< class T > 00393 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuArrayType2( T * pT ) SAL_THROW(()); 00399 template< class T > 00400 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuArrayType3( T * pT ) SAL_THROW(()); 00406 template< class T > 00407 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuArrayType4( T * pT ) SAL_THROW(()); 00413 template< class T > 00414 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuArrayType5( T * pT ) SAL_THROW(()); 00420 template< class T > 00421 inline const ::com::sun::star::uno::Type & SAL_CALL getCppuArrayType6( T * pT ) SAL_THROW(()); 00422 00441 template< typename T > inline const ::com::sun::star::uno::Type & SAL_CALL 00442 getCppuType() SAL_THROW(()); 00443 00455 template<> inline const ::com::sun::star::uno::Type & SAL_CALL 00456 getCppuType< sal_Unicode >() SAL_THROW(()); 00457 00458 #endif 00459 00460 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
1.7.3