1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _COMPHELPER_WEAK_HXX_
24 #define _COMPHELPER_WEAK_HXX_
25 
26 #include "comphelper/comphelperdllapi.h"
27 
28 #include <com/sun/star/lang/XTypeProvider.hpp>
29 #include <cppuhelper/weak.hxx>
30 
31 namespace comphelper
32 {
33 /** Base class to implement an UNO object supporting types and weak references, i.e. the object can be held
34     weakly (by a ::com::sun::star::uno::WeakReference).
35     This implementation copes with reference counting.  Upon last release(), the virtual dtor
36     is called.
37 
38 	In addition to the features from cppu::OWeakObject, derivations from this class can
39 	also used as a base class for ::cppu::ImplInheritanceHelper?
40 */
41 class COMPHELPER_DLLPUBLIC OWeakTypeObject : public ::cppu::OWeakObject, public ::com::sun::star::lang::XTypeProvider
42 {
43 public:
44 	OWeakTypeObject();
45 	virtual ~OWeakTypeObject();
46 
47     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type & rType )	throw (::com::sun::star::uno::RuntimeException);
48     virtual void SAL_CALL acquire()	throw ();
49     virtual void SAL_CALL release()	throw ();
50     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw (::com::sun::star::uno::RuntimeException);
51     virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL getImplementationId(  ) throw (::com::sun::star::uno::RuntimeException);
52 
53 };
54 
55 }
56 
57 #endif
58 
59 
60