|
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 _CPPUHELPER_COMPBASE_EX_HXX_ 00020 #define _CPPUHELPER_COMPBASE_EX_HXX_ 00021 00022 #include <osl/mutex.hxx> 00023 #include <cppuhelper/implbase_ex.hxx> 00024 #include <cppuhelper/interfacecontainer.hxx> 00025 #include <com/sun/star/lang/XComponent.hpp> 00026 #include "cppuhelperdllapi.h" 00027 00029 00030 namespace cppu 00031 { 00032 00036 class CPPUHELPER_DLLPUBLIC SAL_NO_VTABLE WeakComponentImplHelperBase 00037 : public ::cppu::OWeakObject 00038 , public ::com::sun::star::lang::XComponent 00039 { 00040 protected: 00043 ::cppu::OBroadcastHelper rBHelper; 00044 00047 virtual void SAL_CALL disposing(); 00048 00053 WeakComponentImplHelperBase( ::osl::Mutex & rMutex ) SAL_THROW(()); 00054 public: 00057 virtual ~WeakComponentImplHelperBase() SAL_THROW(()); 00058 00059 // these are here to force memory de/allocation to sal lib. 00060 inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW(()) 00061 { return ::rtl_allocateMemory( nSize ); } 00062 inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW(()) 00063 { ::rtl_freeMemory( pMem ); } 00064 inline static void * SAL_CALL operator new( size_t, void * pMem ) SAL_THROW(()) 00065 { return pMem; } 00066 inline static void SAL_CALL operator delete( void *, void * ) SAL_THROW(()) 00067 {} 00068 00069 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( 00070 ::com::sun::star::uno::Type const & rType ) 00071 throw (::com::sun::star::uno::RuntimeException); 00072 virtual void SAL_CALL acquire() 00073 throw (); 00074 virtual void SAL_CALL release() 00075 throw (); 00076 virtual void SAL_CALL dispose() 00077 throw (::com::sun::star::uno::RuntimeException); 00078 virtual void SAL_CALL addEventListener( 00079 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener ) 00080 throw (::com::sun::star::uno::RuntimeException); 00081 virtual void SAL_CALL removeEventListener( 00082 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener ) 00083 throw (::com::sun::star::uno::RuntimeException); 00084 }; 00085 00089 class CPPUHELPER_DLLPUBLIC SAL_NO_VTABLE WeakAggComponentImplHelperBase 00090 : public ::cppu::OWeakAggObject 00091 , public ::com::sun::star::lang::XComponent 00092 { 00093 protected: 00094 ::cppu::OBroadcastHelper rBHelper; 00095 00098 virtual void SAL_CALL disposing(); 00099 00100 WeakAggComponentImplHelperBase( ::osl::Mutex & rMutex ) SAL_THROW(()); 00101 public: 00102 virtual ~WeakAggComponentImplHelperBase() SAL_THROW(()); 00103 00104 // these are here to force memory de/allocation to sal lib. 00105 inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW(()) 00106 { return ::rtl_allocateMemory( nSize ); } 00107 inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW(()) 00108 { ::rtl_freeMemory( pMem ); } 00109 inline static void * SAL_CALL operator new( size_t, void * pMem ) SAL_THROW(()) 00110 { return pMem; } 00111 inline static void SAL_CALL operator delete( void *, void * ) SAL_THROW(()) 00112 {} 00113 00114 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( 00115 ::com::sun::star::uno::Type const & rType ) 00116 throw (::com::sun::star::uno::RuntimeException); 00117 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( 00118 ::com::sun::star::uno::Type const & rType ) 00119 throw (::com::sun::star::uno::RuntimeException); 00120 virtual void SAL_CALL acquire() 00121 throw (); 00122 virtual void SAL_CALL release() 00123 throw (); 00124 virtual void SAL_CALL dispose() 00125 throw (::com::sun::star::uno::RuntimeException); 00126 virtual void SAL_CALL addEventListener( 00127 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener ) 00128 throw (::com::sun::star::uno::RuntimeException); 00129 virtual void SAL_CALL removeEventListener( 00130 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener ) 00131 throw (::com::sun::star::uno::RuntimeException); 00132 }; 00133 00136 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Any SAL_CALL WeakComponentImplHelper_query( 00137 ::com::sun::star::uno::Type const & rType, 00138 class_data * cd, 00139 void * that, 00140 ::cppu::WeakComponentImplHelperBase * pBase ) 00141 SAL_THROW( (::com::sun::star::uno::RuntimeException) ); 00144 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL WeakComponentImplHelper_getTypes( 00145 class_data * cd ) 00146 SAL_THROW( (::com::sun::star::uno::RuntimeException) ); 00147 00150 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Any SAL_CALL WeakAggComponentImplHelper_queryAgg( 00151 ::com::sun::star::uno::Type const & rType, 00152 class_data * cd, 00153 void * that, 00154 ::cppu::WeakAggComponentImplHelperBase * pBase ) 00155 SAL_THROW( (::com::sun::star::uno::RuntimeException) ); 00158 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL WeakAggComponentImplHelper_getTypes( 00159 class_data * cd ) 00160 SAL_THROW( (::com::sun::star::uno::RuntimeException) ); 00161 00162 } 00163 00165 00166 #endif 00167 00168 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
1.7.3