1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef _AVMEDIA_MEDIAEVENT_IMPL_HXX 29 #define _AVMEDIA_MEDIAEVENT_IMPL_HXX 30 31 #include <avmedia/mediawindow.hxx> 32 #include <cppuhelper/compbase4.hxx> 33 #include <com/sun/star/awt/XKeyListener.hpp> 34 #include <com/sun/star/awt/XMouseListener.hpp> 35 #include <com/sun/star/awt/XMouseMotionListener.hpp> 36 #include <com/sun/star/awt/XFocusListener.hpp> 37 38 namespace avmedia 39 { 40 namespace priv 41 { 42 // --------------------------- 43 // - MediaEventListenersImpl - 44 // --------------------------- 45 46 class MediaWindowImpl; 47 48 class MediaEventListenersImpl : public ::cppu::WeakImplHelper4< ::com::sun::star::awt::XKeyListener, 49 ::com::sun::star::awt::XMouseListener, 50 ::com::sun::star::awt::XMouseMotionListener, 51 ::com::sun::star::awt::XFocusListener > 52 { 53 public: 54 55 MediaEventListenersImpl( Window& rNotifyWindow ); 56 ~MediaEventListenersImpl(); 57 58 void cleanUp(); 59 60 protected: 61 62 // XKeyListener 63 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); 64 virtual void SAL_CALL keyPressed( const ::com::sun::star::awt::KeyEvent& e ) throw (::com::sun::star::uno::RuntimeException); 65 virtual void SAL_CALL keyReleased( const ::com::sun::star::awt::KeyEvent& e ) throw (::com::sun::star::uno::RuntimeException); 66 67 // XMouseListener 68 virtual void SAL_CALL mousePressed( const ::com::sun::star::awt::MouseEvent& e ) throw (::com::sun::star::uno::RuntimeException); 69 virtual void SAL_CALL mouseReleased( const ::com::sun::star::awt::MouseEvent& e ) throw (::com::sun::star::uno::RuntimeException); 70 virtual void SAL_CALL mouseEntered( const ::com::sun::star::awt::MouseEvent& e ) throw (::com::sun::star::uno::RuntimeException); 71 virtual void SAL_CALL mouseExited( const ::com::sun::star::awt::MouseEvent& e ) throw (::com::sun::star::uno::RuntimeException); 72 73 // XMouseMotionListener 74 virtual void SAL_CALL mouseDragged( const ::com::sun::star::awt::MouseEvent& e ) throw (::com::sun::star::uno::RuntimeException); 75 virtual void SAL_CALL mouseMoved( const ::com::sun::star::awt::MouseEvent& e ) throw (::com::sun::star::uno::RuntimeException); 76 77 // XFocusListener 78 virtual void SAL_CALL focusGained( const ::com::sun::star::awt::FocusEvent& e ) throw (::com::sun::star::uno::RuntimeException); 79 virtual void SAL_CALL focusLost( const ::com::sun::star::awt::FocusEvent& e ) throw (::com::sun::star::uno::RuntimeException); 80 81 private: 82 83 Window* mpNotifyWindow; 84 mutable ::osl::Mutex maMutex; 85 }; 86 } 87 } 88 89 #endif 90