1*161f4cd1SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*161f4cd1SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*161f4cd1SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*161f4cd1SAndrew Rist * distributed with this work for additional information 6*161f4cd1SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*161f4cd1SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*161f4cd1SAndrew Rist * "License"); you may not use this file except in compliance 9*161f4cd1SAndrew Rist * with the License. You may obtain a copy of the License at 10*161f4cd1SAndrew Rist * 11*161f4cd1SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*161f4cd1SAndrew Rist * 13*161f4cd1SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*161f4cd1SAndrew Rist * software distributed under the License is distributed on an 15*161f4cd1SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*161f4cd1SAndrew Rist * KIND, either express or implied. See the License for the 17*161f4cd1SAndrew Rist * specific language governing permissions and limitations 18*161f4cd1SAndrew Rist * under the License. 19*161f4cd1SAndrew Rist * 20*161f4cd1SAndrew Rist *************************************************************/ 21*161f4cd1SAndrew Rist 22*161f4cd1SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _VCL_XCONNECTION_HXX 25cdf0e10cSrcweir #define _VCL_XCONNECTION_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <osl/mutex.hxx> 28cdf0e10cSrcweir #include <rtl/ref.hxx> 29cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx> 30cdf0e10cSrcweir 31cdf0e10cSrcweir #include "vcl/displayconnectiondispatch.hxx" 32cdf0e10cSrcweir 33cdf0e10cSrcweir #ifndef _STLP_LIST 34cdf0e10cSrcweir #include <list> 35cdf0e10cSrcweir #endif 36cdf0e10cSrcweir 37cdf0e10cSrcweir namespace vcl { 38cdf0e10cSrcweir 39cdf0e10cSrcweir class DisplayConnection : 40cdf0e10cSrcweir public DisplayConnectionDispatch 41cdf0e10cSrcweir { 42cdf0e10cSrcweir ::osl::Mutex m_aMutex; 43cdf0e10cSrcweir ::std::list< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XEventHandler > > 44cdf0e10cSrcweir m_aHandlers; 45cdf0e10cSrcweir ::std::list< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XEventHandler > > 46cdf0e10cSrcweir m_aErrorHandlers; 47cdf0e10cSrcweir ::com::sun::star::uno::Any m_aAny; 48cdf0e10cSrcweir public: 49cdf0e10cSrcweir DisplayConnection(); 50cdf0e10cSrcweir virtual ~DisplayConnection(); 51cdf0e10cSrcweir 52cdf0e10cSrcweir void start(); 53cdf0e10cSrcweir void terminate(); 54cdf0e10cSrcweir 55cdf0e10cSrcweir virtual bool dispatchEvent( void* pData, int nBytes ); 56cdf0e10cSrcweir virtual bool dispatchErrorEvent( void* pData, int nBytes ); 57cdf0e10cSrcweir 58cdf0e10cSrcweir // XDisplayConnection 59cdf0e10cSrcweir 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(); 60cdf0e10cSrcweir 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(); 61cdf0e10cSrcweir virtual void SAL_CALL addErrorHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XEventHandler >& handler ) throw(); 62cdf0e10cSrcweir virtual void SAL_CALL removeErrorHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XEventHandler >& handler ) throw(); 63cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getIdentifier() throw(); 64cdf0e10cSrcweir 65cdf0e10cSrcweir }; 66cdf0e10cSrcweir 67cdf0e10cSrcweir } 68cdf0e10cSrcweir 69cdf0e10cSrcweir #endif // _VCL_XCONNECTION_HXX 70