My Project
UDK 3.2.7 C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
compbase2.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
3  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * Copyright 2000, 2010 Oracle and/or its affiliates.
7  *
8  * OpenOffice.org - a multi-platform office productivity suite
9  *
10  * This file is part of OpenOffice.org.
11  *
12  * OpenOffice.org is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License version 3
14  * only, as published by the Free Software Foundation.
15  *
16  * OpenOffice.org is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License version 3 for more details
20  * (a copy is included in the LICENSE file that accompanied this code).
21  *
22  * You should have received a copy of the GNU Lesser General Public License
23  * version 3 along with OpenOffice.org. If not, see
24  * <http://www.openoffice.org/license.html>
25  * for a copy of the LGPLv3 License.
26  *
27  ************************************************************************/
28 #ifndef _CPPUHELPER_COMPBASE2_HXX_
29 #define _CPPUHELPER_COMPBASE2_HXX_
30 
31 #include <cppuhelper/implbase2.hxx>
33 /*
34 __DEF_COMPIMPLHELPER_EX( 2 )
35 */
36 
37 namespace cppu
38 {
39 
40 // Suppress warnings about hidden functions in case any of the IfcN has
41 // functions named dispose, addEventListener, or removeEventListener:
42 #if defined __SUNPRO_CC
43 #pragma disable_warn
44 #endif
45 
60  template< class Ifc1, class Ifc2 >
61  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakComponentImplHelper2
62  : public WeakComponentImplHelperBase
63  , public ::com::sun::star::lang::XTypeProvider
64  , public Ifc1, public Ifc2
65  {
66  struct cd : public rtl::StaticAggregate< class_data, ImplClassData2 < Ifc1, Ifc2, WeakComponentImplHelper2<Ifc1, Ifc2> > > {};
67  public:
68  inline WeakComponentImplHelper2( ::osl::Mutex & rMutex ) throw ()
69  : WeakComponentImplHelperBase( rMutex )
70  {}
71  virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException)
72  { return WeakComponentImplHelper_query( rType, cd::get(), this, (WeakComponentImplHelperBase *)this ); }
73  virtual void SAL_CALL acquire() throw ()
74  { WeakComponentImplHelperBase::acquire(); }
75  virtual void SAL_CALL release() throw ()
76  { WeakComponentImplHelperBase::release(); }
77  virtual void SAL_CALL dispose()throw (::com::sun::star::uno::RuntimeException)
78  { WeakComponentImplHelperBase::dispose(); }
79  virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)throw (::com::sun::star::uno::RuntimeException)
80  { WeakComponentImplHelperBase::addEventListener(xListener); }
81  virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)throw (::com::sun::star::uno::RuntimeException)
82  { WeakComponentImplHelperBase::removeEventListener(xListener); }
83  virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException)
84  { return WeakComponentImplHelper_getTypes( cd::get() ); }
85  virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException)
86  { return ImplHelper_getImplementationId( cd::get() ); }
87  };
88 
89 #if defined __SUNPRO_CC
90 #pragma enable_warn
91 #endif
92 
102  template< class Ifc1, class Ifc2 >
103  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE PartialWeakComponentImplHelper2
104  : public WeakComponentImplHelperBase
105  , public ::com::sun::star::lang::XTypeProvider
106  , public Ifc1, public Ifc2
107  {
108  struct cd : public rtl::StaticAggregate< class_data, ImplClassData2 < Ifc1, Ifc2, PartialWeakComponentImplHelper2<Ifc1, Ifc2> > > {};
109  public:
110  inline PartialWeakComponentImplHelper2( ::osl::Mutex & rMutex ) throw ()
111  : WeakComponentImplHelperBase( rMutex )
112  {}
113  virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException)
114  { return WeakComponentImplHelper_query( rType, cd::get(), this, (WeakComponentImplHelperBase *)this ); }
115  virtual void SAL_CALL acquire() throw ()
116  { WeakComponentImplHelperBase::acquire(); }
117  virtual void SAL_CALL release() throw ()
118  { WeakComponentImplHelperBase::release(); }
119  virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException)
120  { return WeakComponentImplHelper_getTypes( cd::get() ); }
121  virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException)
122  { return ImplHelper_getImplementationId( cd::get() ); }
123  };
124 
125 
143  template< class Ifc1, class Ifc2 >
144  class SAL_NO_VTABLE SAL_DLLPUBLIC_TEMPLATE WeakAggComponentImplHelper2
145  : public WeakAggComponentImplHelperBase
146  , public ::com::sun::star::lang::XTypeProvider
147  , public Ifc1, public Ifc2
148  {
149  struct cd : public rtl::StaticAggregate< class_data, ImplClassData2 < Ifc1, Ifc2, WeakAggComponentImplHelper2<Ifc1, Ifc2> > > {};
150  public:
151  inline WeakAggComponentImplHelper2( ::osl::Mutex & rMutex ) throw ()
152  : WeakAggComponentImplHelperBase( rMutex )
153  {}
154  virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException)
156  virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( ::com::sun::star::uno::Type const & rType ) throw (::com::sun::star::uno::RuntimeException)
157  { return WeakAggComponentImplHelper_queryAgg( rType, cd::get(), this, (WeakAggComponentImplHelperBase *)this ); }
158  virtual void SAL_CALL acquire() throw ()
159  { WeakAggComponentImplHelperBase::acquire(); }
160  virtual void SAL_CALL release() throw ()
161  { WeakAggComponentImplHelperBase::release(); }
162  virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException)
163  { return WeakAggComponentImplHelper_getTypes( cd::get() ); }
164  virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException)
165  { return ImplHelper_getImplementationId( cd::get() ); }
166  };
167 }
168 
169 #endif
170 
171 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */