UDK 3.2.7 C/C++ API Reference
cppuhelper/compbase_ex.hxx
Go to the documentation of this file.
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 _CPPUHELPER_COMPBASE_EX_HXX_
00029 #define _CPPUHELPER_COMPBASE_EX_HXX_
00030 
00031 #include <osl/mutex.hxx>
00032 #include <cppuhelper/implbase_ex.hxx>
00033 #include <cppuhelper/interfacecontainer.hxx>
00034 #include <com/sun/star/lang/XComponent.hpp>
00035 #include "cppuhelperdllapi.h"
00036 
00038 
00039 namespace cppu
00040 {
00041 
00045 class CPPUHELPER_DLLPUBLIC SAL_NO_VTABLE WeakComponentImplHelperBase
00046     : public ::cppu::OWeakObject
00047     , public ::com::sun::star::lang::XComponent
00048 {
00049 protected:
00052     ::cppu::OBroadcastHelper rBHelper;
00053 
00056     virtual void SAL_CALL disposing();
00057 
00062     WeakComponentImplHelperBase( ::osl::Mutex & rMutex ) SAL_THROW(());
00063 public:
00066     virtual ~WeakComponentImplHelperBase() SAL_THROW(());
00067 
00068     // these are here to force memory de/allocation to sal lib.
00069     inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW(())
00070         { return ::rtl_allocateMemory( nSize ); }
00071     inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW(())
00072         { ::rtl_freeMemory( pMem ); }
00073     inline static void * SAL_CALL operator new( size_t, void * pMem ) SAL_THROW(())
00074         { return pMem; }
00075     inline static void SAL_CALL operator delete( void *, void * ) SAL_THROW(())
00076         {}
00077 
00078     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
00079         ::com::sun::star::uno::Type const & rType )
00080         throw (::com::sun::star::uno::RuntimeException);
00081     virtual void SAL_CALL acquire()
00082         throw ();
00083     virtual void SAL_CALL release()
00084         throw ();
00085     virtual void SAL_CALL dispose()
00086         throw (::com::sun::star::uno::RuntimeException);
00087     virtual void SAL_CALL addEventListener(
00088         ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener )
00089         throw (::com::sun::star::uno::RuntimeException);
00090     virtual void SAL_CALL removeEventListener(
00091         ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener )
00092         throw (::com::sun::star::uno::RuntimeException);
00093 };
00094 
00098 class CPPUHELPER_DLLPUBLIC SAL_NO_VTABLE WeakAggComponentImplHelperBase
00099     : public ::cppu::OWeakAggObject
00100     , public ::com::sun::star::lang::XComponent
00101 {
00102 protected:
00103     ::cppu::OBroadcastHelper rBHelper;
00104 
00107     virtual void SAL_CALL disposing();
00108 
00109     WeakAggComponentImplHelperBase( ::osl::Mutex & rMutex ) SAL_THROW(());
00110 public:
00111     virtual ~WeakAggComponentImplHelperBase() SAL_THROW(());
00112 
00113     // these are here to force memory de/allocation to sal lib.
00114     inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW(())
00115         { return ::rtl_allocateMemory( nSize ); }
00116     inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW(())
00117         { ::rtl_freeMemory( pMem ); }
00118     inline static void * SAL_CALL operator new( size_t, void * pMem ) SAL_THROW(())
00119         { return pMem; }
00120     inline static void SAL_CALL operator delete( void *, void * ) SAL_THROW(())
00121         {}
00122 
00123     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
00124         ::com::sun::star::uno::Type const & rType )
00125         throw (::com::sun::star::uno::RuntimeException);
00126     virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(
00127         ::com::sun::star::uno::Type const & rType )
00128         throw (::com::sun::star::uno::RuntimeException);
00129     virtual void SAL_CALL acquire()
00130         throw ();
00131     virtual void SAL_CALL release()
00132         throw ();
00133     virtual void SAL_CALL dispose()
00134         throw (::com::sun::star::uno::RuntimeException);
00135     virtual void SAL_CALL addEventListener(
00136         ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener )
00137         throw (::com::sun::star::uno::RuntimeException);
00138     virtual void SAL_CALL removeEventListener(
00139         ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener )
00140         throw (::com::sun::star::uno::RuntimeException);
00141 };
00142 
00145 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Any SAL_CALL WeakComponentImplHelper_query(
00146     ::com::sun::star::uno::Type const & rType,
00147     class_data * cd,
00148     void * that,
00149     ::cppu::WeakComponentImplHelperBase * pBase )
00150     SAL_THROW( (::com::sun::star::uno::RuntimeException) );
00153 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL WeakComponentImplHelper_getTypes(
00154     class_data * cd )
00155     SAL_THROW( (::com::sun::star::uno::RuntimeException) );
00156 
00159 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Any SAL_CALL WeakAggComponentImplHelper_queryAgg(
00160     ::com::sun::star::uno::Type const & rType,
00161     class_data * cd,
00162     void * that,
00163     ::cppu::WeakAggComponentImplHelperBase * pBase )
00164     SAL_THROW( (::com::sun::star::uno::RuntimeException) );
00167 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL WeakAggComponentImplHelper_getTypes(
00168     class_data * cd )
00169     SAL_THROW( (::com::sun::star::uno::RuntimeException) );
00170 
00171 }
00172 
00174 
00175 #endif
00176 
00177 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines