xref: /AOO41X/main/unotools/inc/unotools/eventlisteneradapter.hxx (revision bae3752ec30c258ca902793e4eea3c818b0bcaad)
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 #include "unotools/unotoolsdllapi.h"
24 
25 #ifndef _UNOTOOLS_EVENTLISTENERADAPTER_HXX_
26 #define _UNOTOOLS_EVENTLISTENERADAPTER_HXX_
27 #include <com/sun/star/lang/XComponent.hpp>
28 
29 //.........................................................................
30 namespace utl
31 {
32 //.........................................................................
33 
34     struct OEventListenerAdapterImpl;
35     //=====================================================================
36     //= OEventListenerAdapter
37     //=====================================================================
38     /** base class for non-UNO dispose listeners
39     */
40     class UNOTOOLS_DLLPUBLIC OEventListenerAdapter
41     {
42         friend class OEventListenerImpl;
43 
44     private:
45         UNOTOOLS_DLLPRIVATE OEventListenerAdapter( const OEventListenerAdapter& _rSource ); // never implemented
46         UNOTOOLS_DLLPRIVATE const OEventListenerAdapter& operator=( const OEventListenerAdapter& _rSource );    // never implemented
47 
48     protected:
49         OEventListenerAdapterImpl*  m_pImpl;
50 
51     protected:
52                 OEventListenerAdapter();
53         virtual ~OEventListenerAdapter();
54 
55         void startComponentListening( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& _rxComp );
56         void stopComponentListening( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& _rxComp );
57         void stopAllComponentListening(  );
58 
59         virtual void _disposing( const ::com::sun::star::lang::EventObject& _rSource ) = 0;
60     };
61 
62 //.........................................................................
63 }   // namespace utl
64 //.........................................................................
65 
66 #endif // _UNOTOOLS_EVENTLISTENERADAPTER_HXX_
67 
68