xref: /AOO41X/main/vcl/inc/xconnection.hxx (revision 161f4cd18255d886c4e915aa80ba7159d59cb848)
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 
24 #ifndef _VCL_XCONNECTION_HXX
25 #define _VCL_XCONNECTION_HXX
26 
27 #include <osl/mutex.hxx>
28 #include <rtl/ref.hxx>
29 #include <com/sun/star/uno/Reference.hxx>
30 
31 #include "vcl/displayconnectiondispatch.hxx"
32 
33 #ifndef _STLP_LIST
34 #include <list>
35 #endif
36 
37 namespace vcl {
38 
39     class DisplayConnection :
40         public DisplayConnectionDispatch
41     {
42         ::osl::Mutex                    m_aMutex;
43         ::std::list< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XEventHandler > >
44                                         m_aHandlers;
45         ::std::list< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XEventHandler > >
46                                         m_aErrorHandlers;
47         ::com::sun::star::uno::Any      m_aAny;
48     public:
49         DisplayConnection();
50         virtual ~DisplayConnection();
51 
52         void start();
53         void terminate();
54 
55         virtual bool dispatchEvent( void* pData, int nBytes );
56         virtual bool dispatchErrorEvent( void* pData, int nBytes );
57 
58         // XDisplayConnection
59         virtual void SAL_CALL addEventHandler( const ::com::sun::star::uno::Any& window, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XEventHandler >& handler, sal_Int32 eventMask ) throw();
60         virtual void SAL_CALL removeEventHandler( const ::com::sun::star::uno::Any& window, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XEventHandler >& handler ) throw();
61         virtual void SAL_CALL addErrorHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XEventHandler >& handler ) throw();
62         virtual void SAL_CALL removeErrorHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XEventHandler >& handler ) throw();
63         virtual ::com::sun::star::uno::Any SAL_CALL getIdentifier() throw();
64 
65     };
66 
67 }
68 
69 #endif // _VCL_XCONNECTION_HXX
70