1*b1cdbd2cSJim Jagielski /************************************************************** 2*b1cdbd2cSJim Jagielski * 3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one 4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file 5*b1cdbd2cSJim Jagielski * distributed with this work for additional information 6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file 7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the 8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance 9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at 10*b1cdbd2cSJim Jagielski * 11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0 12*b1cdbd2cSJim Jagielski * 13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing, 14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an 15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the 17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations 18*b1cdbd2cSJim Jagielski * under the License. 19*b1cdbd2cSJim Jagielski * 20*b1cdbd2cSJim Jagielski *************************************************************/ 21*b1cdbd2cSJim Jagielski 22*b1cdbd2cSJim Jagielski 23*b1cdbd2cSJim Jagielski 24*b1cdbd2cSJim Jagielski #ifndef INCLUDED_SLIDESHOW_MOUSEEVENTHANDLER_HXX 25*b1cdbd2cSJim Jagielski #define INCLUDED_SLIDESHOW_MOUSEEVENTHANDLER_HXX 26*b1cdbd2cSJim Jagielski 27*b1cdbd2cSJim Jagielski #include <boost/shared_ptr.hpp> 28*b1cdbd2cSJim Jagielski 29*b1cdbd2cSJim Jagielski namespace com { namespace sun { namespace star { namespace awt 30*b1cdbd2cSJim Jagielski { 31*b1cdbd2cSJim Jagielski struct MouseEvent; 32*b1cdbd2cSJim Jagielski } } } } 33*b1cdbd2cSJim Jagielski 34*b1cdbd2cSJim Jagielski 35*b1cdbd2cSJim Jagielski /* Definition of MouseEventHandler interface */ 36*b1cdbd2cSJim Jagielski 37*b1cdbd2cSJim Jagielski namespace slideshow 38*b1cdbd2cSJim Jagielski { 39*b1cdbd2cSJim Jagielski namespace internal 40*b1cdbd2cSJim Jagielski { 41*b1cdbd2cSJim Jagielski 42*b1cdbd2cSJim Jagielski /** Interface for handling mouse events. 43*b1cdbd2cSJim Jagielski 44*b1cdbd2cSJim Jagielski Classes implementing this interface can be added to an 45*b1cdbd2cSJim Jagielski EventMultiplexer object, and are called from there to 46*b1cdbd2cSJim Jagielski handle mouse events. 47*b1cdbd2cSJim Jagielski */ 48*b1cdbd2cSJim Jagielski class MouseEventHandler 49*b1cdbd2cSJim Jagielski { 50*b1cdbd2cSJim Jagielski public: ~MouseEventHandler()51*b1cdbd2cSJim Jagielski virtual ~MouseEventHandler() {} 52*b1cdbd2cSJim Jagielski 53*b1cdbd2cSJim Jagielski /** Handle a mouse button pressed event. 54*b1cdbd2cSJim Jagielski 55*b1cdbd2cSJim Jagielski @param e 56*b1cdbd2cSJim Jagielski The mouse event that occurred. The x,y coordinates of 57*b1cdbd2cSJim Jagielski the event are already transformed back to user 58*b1cdbd2cSJim Jagielski coordinate space, taking the inverse transform of the 59*b1cdbd2cSJim Jagielski view in which the event occurred. 60*b1cdbd2cSJim Jagielski 61*b1cdbd2cSJim Jagielski @return true, if this handler has successfully 62*b1cdbd2cSJim Jagielski processed the mouse event. When this method returns 63*b1cdbd2cSJim Jagielski false, possibly other, less prioritized handlers can be 64*b1cdbd2cSJim Jagielski called, too. 65*b1cdbd2cSJim Jagielski */ 66*b1cdbd2cSJim Jagielski virtual bool handleMousePressed( const ::com::sun::star::awt::MouseEvent& e ) = 0; 67*b1cdbd2cSJim Jagielski 68*b1cdbd2cSJim Jagielski /** Handle a mouse button released event. 69*b1cdbd2cSJim Jagielski 70*b1cdbd2cSJim Jagielski @param e 71*b1cdbd2cSJim Jagielski The mouse event that occurred. The x,y coordinates of 72*b1cdbd2cSJim Jagielski the event are already transformed back to user 73*b1cdbd2cSJim Jagielski coordinate space, taking the inverse transform of the 74*b1cdbd2cSJim Jagielski view in which the event occurred. 75*b1cdbd2cSJim Jagielski 76*b1cdbd2cSJim Jagielski @return true, if this handler has successfully 77*b1cdbd2cSJim Jagielski processed the pause event. When this method returns 78*b1cdbd2cSJim Jagielski false, possibly other, less prioritized handlers are 79*b1cdbd2cSJim Jagielski called, too. 80*b1cdbd2cSJim Jagielski */ 81*b1cdbd2cSJim Jagielski virtual bool handleMouseReleased( const ::com::sun::star::awt::MouseEvent& e ) = 0; 82*b1cdbd2cSJim Jagielski 83*b1cdbd2cSJim Jagielski /** Handle a mouse entered the view event. 84*b1cdbd2cSJim Jagielski 85*b1cdbd2cSJim Jagielski @param e 86*b1cdbd2cSJim Jagielski The mouse event that occurred. The x,y coordinates of 87*b1cdbd2cSJim Jagielski the event are already transformed back to user 88*b1cdbd2cSJim Jagielski coordinate space, taking the inverse transform of the 89*b1cdbd2cSJim Jagielski view in which the event occurred. 90*b1cdbd2cSJim Jagielski 91*b1cdbd2cSJim Jagielski @return true, if this handler has successfully 92*b1cdbd2cSJim Jagielski processed the pause event. When this method returns 93*b1cdbd2cSJim Jagielski false, possibly other, less prioritized handlers are 94*b1cdbd2cSJim Jagielski called, too. 95*b1cdbd2cSJim Jagielski */ 96*b1cdbd2cSJim Jagielski virtual bool handleMouseEntered( const ::com::sun::star::awt::MouseEvent& e ) = 0; 97*b1cdbd2cSJim Jagielski 98*b1cdbd2cSJim Jagielski /** Handle a mouse exited the view event. 99*b1cdbd2cSJim Jagielski 100*b1cdbd2cSJim Jagielski @param e 101*b1cdbd2cSJim Jagielski The mouse event that occurred. The x,y coordinates of 102*b1cdbd2cSJim Jagielski the event are already transformed back to user 103*b1cdbd2cSJim Jagielski coordinate space, taking the inverse transform of the 104*b1cdbd2cSJim Jagielski view in which the event occurred. 105*b1cdbd2cSJim Jagielski 106*b1cdbd2cSJim Jagielski @return true, if this handler has successfully 107*b1cdbd2cSJim Jagielski processed the pause event. When this method returns 108*b1cdbd2cSJim Jagielski false, possibly other, less prioritized handlers are 109*b1cdbd2cSJim Jagielski called, too. 110*b1cdbd2cSJim Jagielski */ 111*b1cdbd2cSJim Jagielski virtual bool handleMouseExited( const ::com::sun::star::awt::MouseEvent& e ) = 0; 112*b1cdbd2cSJim Jagielski 113*b1cdbd2cSJim Jagielski /** Handle a mouse was moved with a pressed button event. 114*b1cdbd2cSJim Jagielski 115*b1cdbd2cSJim Jagielski @param e 116*b1cdbd2cSJim Jagielski The mouse event that occurred. The x,y coordinates of 117*b1cdbd2cSJim Jagielski the event are already transformed back to user 118*b1cdbd2cSJim Jagielski coordinate space, taking the inverse transform of the 119*b1cdbd2cSJim Jagielski view in which the event occurred. 120*b1cdbd2cSJim Jagielski 121*b1cdbd2cSJim Jagielski @return true, if this handler has successfully 122*b1cdbd2cSJim Jagielski processed the pause event. When this method returns 123*b1cdbd2cSJim Jagielski false, possibly other, less prioritized handlers are 124*b1cdbd2cSJim Jagielski called, too. 125*b1cdbd2cSJim Jagielski */ 126*b1cdbd2cSJim Jagielski virtual bool handleMouseDragged( const ::com::sun::star::awt::MouseEvent& e ) = 0; 127*b1cdbd2cSJim Jagielski 128*b1cdbd2cSJim Jagielski /** Handle a mouse was moved event. 129*b1cdbd2cSJim Jagielski 130*b1cdbd2cSJim Jagielski @param e 131*b1cdbd2cSJim Jagielski The mouse event that occurred. The x,y coordinates of 132*b1cdbd2cSJim Jagielski the event are already transformed back to user 133*b1cdbd2cSJim Jagielski coordinate space, taking the inverse transform of the 134*b1cdbd2cSJim Jagielski view in which the event occurred. 135*b1cdbd2cSJim Jagielski 136*b1cdbd2cSJim Jagielski @return true, if this handler has successfully 137*b1cdbd2cSJim Jagielski processed the pause event. When this method returns 138*b1cdbd2cSJim Jagielski false, possibly other, less prioritized handlers are 139*b1cdbd2cSJim Jagielski called, too. 140*b1cdbd2cSJim Jagielski */ 141*b1cdbd2cSJim Jagielski virtual bool handleMouseMoved( const ::com::sun::star::awt::MouseEvent& e ) = 0; 142*b1cdbd2cSJim Jagielski }; 143*b1cdbd2cSJim Jagielski 144*b1cdbd2cSJim Jagielski typedef ::boost::shared_ptr< MouseEventHandler > MouseEventHandlerSharedPtr; 145*b1cdbd2cSJim Jagielski 146*b1cdbd2cSJim Jagielski } 147*b1cdbd2cSJim Jagielski } 148*b1cdbd2cSJim Jagielski 149*b1cdbd2cSJim Jagielski #endif /* INCLUDED_SLIDESHOW_MOUSEEVENTHANDLER_HXX */ 150