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 _AVMEDIA_MEDIAEVENT_IMPL_HXX 25 #define _AVMEDIA_MEDIAEVENT_IMPL_HXX 26 27 #include <avmedia/mediawindow.hxx> 28 #include <cppuhelper/compbase4.hxx> 29 #include <com/sun/star/awt/XKeyListener.hpp> 30 #include <com/sun/star/awt/XMouseListener.hpp> 31 #include <com/sun/star/awt/XMouseMotionListener.hpp> 32 #include <com/sun/star/awt/XFocusListener.hpp> 33 34 namespace avmedia 35 { 36 namespace priv 37 { 38 // --------------------------- 39 // - MediaEventListenersImpl - 40 // --------------------------- 41 42 class MediaWindowImpl; 43 44 class MediaEventListenersImpl : public ::cppu::WeakImplHelper4< ::com::sun::star::awt::XKeyListener, 45 ::com::sun::star::awt::XMouseListener, 46 ::com::sun::star::awt::XMouseMotionListener, 47 ::com::sun::star::awt::XFocusListener > 48 { 49 public: 50 51 MediaEventListenersImpl( Window& rNotifyWindow ); 52 ~MediaEventListenersImpl(); 53 54 void cleanUp(); 55 56 protected: 57 58 // XKeyListener 59 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); 60 virtual void SAL_CALL keyPressed( const ::com::sun::star::awt::KeyEvent& e ) throw (::com::sun::star::uno::RuntimeException); 61 virtual void SAL_CALL keyReleased( const ::com::sun::star::awt::KeyEvent& e ) throw (::com::sun::star::uno::RuntimeException); 62 63 // XMouseListener 64 virtual void SAL_CALL mousePressed( const ::com::sun::star::awt::MouseEvent& e ) throw (::com::sun::star::uno::RuntimeException); 65 virtual void SAL_CALL mouseReleased( const ::com::sun::star::awt::MouseEvent& e ) throw (::com::sun::star::uno::RuntimeException); 66 virtual void SAL_CALL mouseEntered( const ::com::sun::star::awt::MouseEvent& e ) throw (::com::sun::star::uno::RuntimeException); 67 virtual void SAL_CALL mouseExited( const ::com::sun::star::awt::MouseEvent& e ) throw (::com::sun::star::uno::RuntimeException); 68 69 // XMouseMotionListener 70 virtual void SAL_CALL mouseDragged( const ::com::sun::star::awt::MouseEvent& e ) throw (::com::sun::star::uno::RuntimeException); 71 virtual void SAL_CALL mouseMoved( const ::com::sun::star::awt::MouseEvent& e ) throw (::com::sun::star::uno::RuntimeException); 72 73 // XFocusListener 74 virtual void SAL_CALL focusGained( const ::com::sun::star::awt::FocusEvent& e ) throw (::com::sun::star::uno::RuntimeException); 75 virtual void SAL_CALL focusLost( const ::com::sun::star::awt::FocusEvent& e ) throw (::com::sun::star::uno::RuntimeException); 76 77 private: 78 79 Window* mpNotifyWindow; 80 mutable ::osl::Mutex maMutex; 81 }; 82 } 83 } 84 85 #endif 86