My Project
UDK 3.2.7 C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
compbase_ex.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_COMPBASE_EX_HXX_
29 #define _CPPUHELPER_COMPBASE_EX_HXX_
30 
31 #include <osl/mutex.hxx>
34 #include <com/sun/star/lang/XComponent.hpp>
35 #include "cppuhelperdllapi.h"
36 
38 
39 namespace cppu
40 {
41 
45 class CPPUHELPER_DLLPUBLIC SAL_NO_VTABLE WeakComponentImplHelperBase
46  : public ::cppu::OWeakObject
47  , public ::com::sun::star::lang::XComponent
48 {
49 protected:
52  ::cppu::OBroadcastHelper rBHelper;
53 
56  virtual void SAL_CALL disposing();
57 
62  WeakComponentImplHelperBase( ::osl::Mutex & rMutex ) SAL_THROW(());
63 public:
66  virtual ~WeakComponentImplHelperBase() SAL_THROW(());
67 
68  // these are here to force memory de/allocation to sal lib.
69  inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW(())
70  { return ::rtl_allocateMemory( nSize ); }
71  inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW(())
72  { ::rtl_freeMemory( pMem ); }
73  inline static void * SAL_CALL operator new( size_t, void * pMem ) SAL_THROW(())
74  { return pMem; }
75  inline static void SAL_CALL operator delete( void *, void * ) SAL_THROW(())
76  {}
77 
78  virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
79  ::com::sun::star::uno::Type const & rType )
80  throw (::com::sun::star::uno::RuntimeException);
81  virtual void SAL_CALL acquire()
82  throw ();
83  virtual void SAL_CALL release()
84  throw ();
85  virtual void SAL_CALL dispose()
86  throw (::com::sun::star::uno::RuntimeException);
87  virtual void SAL_CALL addEventListener(
88  ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener )
89  throw (::com::sun::star::uno::RuntimeException);
90  virtual void SAL_CALL removeEventListener(
91  ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener )
92  throw (::com::sun::star::uno::RuntimeException);
93 };
94 
98 class CPPUHELPER_DLLPUBLIC SAL_NO_VTABLE WeakAggComponentImplHelperBase
99  : public ::cppu::OWeakAggObject
100  , public ::com::sun::star::lang::XComponent
101 {
102 protected:
103  ::cppu::OBroadcastHelper rBHelper;
104 
107  virtual void SAL_CALL disposing();
108 
109  WeakAggComponentImplHelperBase( ::osl::Mutex & rMutex ) SAL_THROW(());
110 public:
111  virtual ~WeakAggComponentImplHelperBase() SAL_THROW(());
112 
113  // these are here to force memory de/allocation to sal lib.
114  inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW(())
115  { return ::rtl_allocateMemory( nSize ); }
116  inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW(())
117  { ::rtl_freeMemory( pMem ); }
118  inline static void * SAL_CALL operator new( size_t, void * pMem ) SAL_THROW(())
119  { return pMem; }
120  inline static void SAL_CALL operator delete( void *, void * ) SAL_THROW(())
121  {}
122 
123  virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
124  ::com::sun::star::uno::Type const & rType )
125  throw (::com::sun::star::uno::RuntimeException);
126  virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(
127  ::com::sun::star::uno::Type const & rType )
128  throw (::com::sun::star::uno::RuntimeException);
129  virtual void SAL_CALL acquire()
130  throw ();
131  virtual void SAL_CALL release()
132  throw ();
133  virtual void SAL_CALL dispose()
134  throw (::com::sun::star::uno::RuntimeException);
135  virtual void SAL_CALL addEventListener(
136  ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener )
137  throw (::com::sun::star::uno::RuntimeException);
138  virtual void SAL_CALL removeEventListener(
139  ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > const & xListener )
140  throw (::com::sun::star::uno::RuntimeException);
141 };
142 
145 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Any SAL_CALL WeakComponentImplHelper_query(
146  ::com::sun::star::uno::Type const & rType,
147  class_data * cd,
148  void * that,
149  ::cppu::WeakComponentImplHelperBase * pBase )
150  SAL_THROW( (::com::sun::star::uno::RuntimeException) );
153 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL WeakComponentImplHelper_getTypes(
154  class_data * cd )
155  SAL_THROW( (::com::sun::star::uno::RuntimeException) );
156 
159 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Any SAL_CALL WeakAggComponentImplHelper_queryAgg(
160  ::com::sun::star::uno::Type const & rType,
161  class_data * cd,
162  void * that,
163  ::cppu::WeakAggComponentImplHelperBase * pBase )
164  SAL_THROW( (::com::sun::star::uno::RuntimeException) );
167 CPPUHELPER_DLLPUBLIC ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL WeakAggComponentImplHelper_getTypes(
168  class_data * cd )
169  SAL_THROW( (::com::sun::star::uno::RuntimeException) );
170 
171 }
172 
174 
175 #endif
176 
177 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */