MouseEventWithHitTestResults.h 1.68 KB
Newer Older
1
/* 
darin's avatar
darin committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
   Copyright (C) 2000 Simon Hausmann <hausmann@kde.org>
   Copyright (C) 2006 Apple Computer, Inc.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public License
   along with this library; see the file COPYING.LIB.  If not, write to
ddkilzer's avatar
ddkilzer committed
17 18
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, USA.
darin's avatar
darin committed
19 20 21 22 23
*/

#ifndef MouseEventWithHitTestResults_h
#define MouseEventWithHitTestResults_h

24
#include "HitTestResult.h"
darin's avatar
darin committed
25
#include "PlatformMouseEvent.h"
darin's avatar
darin committed
26 27 28

namespace WebCore {

hyatt@apple.com's avatar
hyatt@apple.com committed
29
class Scrollbar;
30

darin's avatar
darin committed
31 32
class MouseEventWithHitTestResults {
public:
33
    MouseEventWithHitTestResults(const PlatformMouseEvent&, const HitTestResult&);
darin's avatar
darin committed
34

darin's avatar
darin committed
35
    const PlatformMouseEvent& event() const { return m_event; }
36
    const HitTestResult& hitTestResult() const { return m_hitTestResult; }
37 38
    LayoutPoint localPoint() const { return m_hitTestResult.localPoint(); }
    Scrollbar* scrollbar() const { return m_hitTestResult.scrollbar(); }
39
    bool isOverLink() const;
40
    bool isOverWidget() const { return m_hitTestResult.isOverWidget(); }
darin's avatar
darin committed
41 42

private:
darin's avatar
darin committed
43
    PlatformMouseEvent m_event;
44
    HitTestResult m_hitTestResult;
darin's avatar
darin committed
45 46
};

47
} // namespace WebCore
darin's avatar
darin committed
48

49
#endif // MouseEventWithHitTestResults_h