UDK 3.2.7 C/C++ API Reference
cppuhelper/component.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_COMPONENT_HXX_
00029 #define _CPPUHELPER_COMPONENT_HXX_
00030 
00031 #include <osl/mutex.hxx>
00032 #include <cppuhelper/weakagg.hxx>
00033 #include <cppuhelper/interfacecontainer.hxx>
00034 
00035 #include <cppuhelper/implbase1.hxx>
00036 
00037 #include <com/sun/star/lang/XComponent.hpp>
00038 #include <com/sun/star/lang/XEventListener.hpp>
00039 
00040 #include "cppuhelperdllapi.h"
00041 
00042 namespace cppu
00043 {
00044 
00054 class CPPUHELPER_DLLPUBLIC OComponentHelper
00055     : public ::cppu::OWeakAggObject
00056     , public ::com::sun::star::lang::XTypeProvider
00057     , public ::com::sun::star::lang::XComponent
00058 {
00059 public:
00066     OComponentHelper( ::osl::Mutex & rMutex ) SAL_THROW(());
00069     virtual ~OComponentHelper() SAL_THROW( (::com::sun::star::uno::RuntimeException) );
00070 
00071     // XAggregation
00072     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
00073         ::com::sun::star::uno::Type const & rType )
00074         throw (::com::sun::star::uno::RuntimeException);
00075     virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(
00076         ::com::sun::star::uno::Type const & rType )
00077         throw (::com::sun::star::uno::RuntimeException);
00078     virtual void SAL_CALL acquire()
00079         throw ();
00080     virtual void SAL_CALL release()
00081         throw ();
00082 
00086     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId()
00087         throw(::com::sun::star::uno::RuntimeException) = 0;
00091     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
00092         throw (::com::sun::star::uno::RuntimeException);
00093 
00094     // XComponent
00095     virtual void SAL_CALL dispose()
00096         throw(::com::sun::star::uno::RuntimeException);
00097     virtual void SAL_CALL addEventListener(
00098         const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener )
00099         throw(::com::sun::star::uno::RuntimeException);
00100     virtual void SAL_CALL removeEventListener(
00101         const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener )
00102         throw(::com::sun::star::uno::RuntimeException);
00103 
00104 protected:
00107     virtual void SAL_CALL disposing();
00108 
00110     OBroadcastHelper    rBHelper;
00112 
00113 private:
00114     inline OComponentHelper( const OComponentHelper & ) SAL_THROW(());
00115     inline OComponentHelper & operator = ( const OComponentHelper & ) SAL_THROW(());
00116 };
00117 
00118 }
00119 
00120 #endif
00121 
00122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines