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 INCLUDED_SLIDESHOW_MOUSEEVENTHANDLER_HXX 29 #define INCLUDED_SLIDESHOW_MOUSEEVENTHANDLER_HXX 30 31 #include <boost/shared_ptr.hpp> 32 33 namespace com { namespace sun { namespace star { namespace awt 34 { 35 struct MouseEvent; 36 } } } } 37 38 39 /* Definition of MouseEventHandler interface */ 40 41 namespace slideshow 42 { 43 namespace internal 44 { 45 46 /** Interface for handling mouse events. 47 48 Classes implementing this interface can be added to an 49 EventMultiplexer object, and are called from there to 50 handle mouse events. 51 */ 52 class MouseEventHandler 53 { 54 public: 55 virtual ~MouseEventHandler() {} 56 57 /** Handle a mouse button pressed event. 58 59 @param e 60 The mouse event that occurred. The x,y coordinates of 61 the event are already transformed back to user 62 coordinate space, taking the inverse transform of the 63 view in which the event occurred. 64 65 @return true, if this handler has successfully 66 processed the mouse event. When this method returns 67 false, possibly other, less prioritized handlers can be 68 called, too. 69 */ 70 virtual bool handleMousePressed( const ::com::sun::star::awt::MouseEvent& e ) = 0; 71 72 /** Handle a mouse button released event. 73 74 @param e 75 The mouse event that occurred. The x,y coordinates of 76 the event are already transformed back to user 77 coordinate space, taking the inverse transform of the 78 view in which the event occurred. 79 80 @return true, if this handler has successfully 81 processed the pause event. When this method returns 82 false, possibly other, less prioritized handlers are 83 called, too. 84 */ 85 virtual bool handleMouseReleased( const ::com::sun::star::awt::MouseEvent& e ) = 0; 86 87 /** Handle a mouse entered the view event. 88 89 @param e 90 The mouse event that occurred. The x,y coordinates of 91 the event are already transformed back to user 92 coordinate space, taking the inverse transform of the 93 view in which the event occurred. 94 95 @return true, if this handler has successfully 96 processed the pause event. When this method returns 97 false, possibly other, less prioritized handlers are 98 called, too. 99 */ 100 virtual bool handleMouseEntered( const ::com::sun::star::awt::MouseEvent& e ) = 0; 101 102 /** Handle a mouse exited the view event. 103 104 @param e 105 The mouse event that occurred. The x,y coordinates of 106 the event are already transformed back to user 107 coordinate space, taking the inverse transform of the 108 view in which the event occurred. 109 110 @return true, if this handler has successfully 111 processed the pause event. When this method returns 112 false, possibly other, less prioritized handlers are 113 called, too. 114 */ 115 virtual bool handleMouseExited( const ::com::sun::star::awt::MouseEvent& e ) = 0; 116 117 /** Handle a mouse was moved with a pressed button event. 118 119 @param e 120 The mouse event that occurred. The x,y coordinates of 121 the event are already transformed back to user 122 coordinate space, taking the inverse transform of the 123 view in which the event occurred. 124 125 @return true, if this handler has successfully 126 processed the pause event. When this method returns 127 false, possibly other, less prioritized handlers are 128 called, too. 129 */ 130 virtual bool handleMouseDragged( const ::com::sun::star::awt::MouseEvent& e ) = 0; 131 132 /** Handle a mouse was moved event. 133 134 @param e 135 The mouse event that occurred. The x,y coordinates of 136 the event are already transformed back to user 137 coordinate space, taking the inverse transform of the 138 view in which the event occurred. 139 140 @return true, if this handler has successfully 141 processed the pause event. When this method returns 142 false, possibly other, less prioritized handlers are 143 called, too. 144 */ 145 virtual bool handleMouseMoved( const ::com::sun::star::awt::MouseEvent& e ) = 0; 146 }; 147 148 typedef ::boost::shared_ptr< MouseEventHandler > MouseEventHandlerSharedPtr; 149 150 } 151 } 152 153 #endif /* INCLUDED_SLIDESHOW_MOUSEEVENTHANDLER_HXX */ 154