2 * Copyright (C) 2006 Apple Computer, Inc.
3 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
4 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
23 #ifndef HitTestRequest_h
24 #define HitTestRequest_h
28 class HitTestRequest {
35 IgnoreClipping = 1 << 5,
36 SVGClipContent = 1 << 6,
40 typedef unsigned HitTestRequestType;
42 HitTestRequest(HitTestRequestType requestType)
43 : m_requestType(requestType)
47 bool readOnly() const { return m_requestType & ReadOnly; }
48 bool active() const { return m_requestType & Active; }
49 bool move() const { return m_requestType & Move; }
50 bool release() const { return m_requestType & Release; }
51 bool ignoreClipping() const { return m_requestType & IgnoreClipping; }
52 bool svgClipContent() const { return m_requestType & SVGClipContent; }
53 bool touchEvent() const { return m_requestType & TouchEvent; }
54 bool mouseEvent() const { return !touchEvent(); }
56 // Convenience functions
57 bool touchMove() const { return move() && touchEvent(); }
58 bool touchRelease() const { return release() && touchEvent(); }
60 HitTestRequestType type() const { return m_requestType; }
63 HitTestRequestType m_requestType;
66 } // namespace WebCore
68 #endif // HitTestRequest_h