00001 /* 00002 * Copyright (C) 2007 Pleyo. All rights reserved. 00003 * 00004 * Redistribution and use in source and binary forms, with or without 00005 * modification, are permitted provided that the following conditions 00006 * are met: 00007 * 00008 * 1. Redistributions of source code must retain the above copyright 00009 * notice, this list of conditions and the following disclaimer. 00010 * 2. Redistributions in binary form must reproduce the above copyright 00011 * notice, this list of conditions and the following disclaimer in the 00012 * documentation and/or other materials provided with the distribution. 00013 * 3. Neither the name of Pleyo nor the names of 00014 * its contributors may be used to endorse or promote products derived 00015 * from this software without specific prior written permission. 00016 * 00017 * THIS SOFTWARE IS PROVIDED BY PLEYO AND ITS CONTRIBUTORS "AS IS" AND ANY 00018 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00019 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00020 * DISCLAIMED. IN NO EVENT SHALL PLEYO OR ITS CONTRIBUTORS BE LIABLE FOR ANY 00021 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00022 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00023 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00024 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00025 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 00026 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00027 */ 00033 #ifndef BIMouseEvent_h 00034 #define BIMouseEvent_h 00035 00036 #include "IntPoint.h" 00037 #include "BIInputEvent.h" 00038 using WebCore::IntPoint; 00039 00040 namespace BAL { 00041 00050 class BIMouseEvent : public BIInputEvent { 00051 public: 00052 static const struct CurrentEventTag {} currentEvent; 00053 00057 virtual ~BIMouseEvent() {}; 00058 00062 enum MouseButton { NoButton = -1, LeftButton, MiddleButton, RightButton }; 00063 enum MouseEventType { MouseEventMoved, MouseEventPressed, MouseEventReleased, MouseEventScroll }; 00064 00068 virtual BIEvent* clone() const = 0; 00069 00073 virtual const IntPoint& pos() const = 0; 00074 virtual void shiftPos(int dx, int dy) = 0; 00078 virtual const IntPoint& globalPos() const = 0; 00082 virtual MouseButton button() const = 0; 00083 virtual MouseEventType eventType() const = 0; 00087 virtual int clickCount() const = 0; 00091 virtual double timestamp() const = 0; 00095 virtual unsigned modifierFlags() const = 0; 00096 00097 virtual BIMouseEvent* queryIsMouseEvent() { return this; } 00098 }; 00099 00100 } 00101 00102 using BAL::BIMouseEvent; 00103 00104 #endif