]>
Commit | Line | Data |
---|---|---|
a90939db JF |
1 | /* |
2 | * This file is part of the HTML rendering engine for KDE. | |
3 | * | |
4 | * Copyright (C) 2006 Apple Computer, Inc. | |
5 | * | |
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. | |
10 | * | |
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. | |
15 | * | |
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. | |
20 | * | |
21 | */ | |
22 | #ifndef HitTestResult_h | |
23 | #define HitTestResult_h | |
24 | ||
25 | #include "IntPoint.h" | |
26 | #include <wtf/RefPtr.h> | |
27 | ||
28 | namespace WebCore { | |
29 | ||
30 | class Element; | |
31 | class Frame; | |
32 | class Image; | |
33 | class KURL; | |
34 | class IntRect; | |
35 | class Node; | |
36 | class Scrollbar; | |
37 | class String; | |
38 | ||
39 | class HitTestResult { | |
40 | public: | |
41 | HitTestResult(const IntPoint&); | |
42 | HitTestResult(const HitTestResult&); | |
43 | ~HitTestResult(); | |
44 | HitTestResult& operator=(const HitTestResult&); | |
45 | ||
46 | Node* innerNode() const { return m_innerNode.get(); } | |
47 | Node* innerNonSharedNode() const { return m_innerNonSharedNode.get(); } | |
48 | IntPoint point() const { return m_point; } | |
49 | IntPoint localPoint() const { return m_localPoint; } | |
50 | Element* URLElement() const { return m_innerURLElement.get(); } | |
51 | Scrollbar* scrollbar() const { return m_scrollbar.get(); } | |
52 | bool isOverWidget() const { return m_isOverWidget; } | |
53 | ||
54 | void setToNonShadowAncestor(); | |
55 | ||
56 | void setInnerNode(Node*); | |
57 | void setInnerNonSharedNode(Node*); | |
58 | void setPoint(const IntPoint& p) { m_point = p; } | |
59 | void setLocalPoint(const IntPoint& p) { m_localPoint = p; } | |
60 | void setURLElement(Element*); | |
61 | void setScrollbar(Scrollbar*); | |
62 | void setIsOverWidget(bool b) { m_isOverWidget = b; } | |
63 | ||
64 | Frame* targetFrame() const; | |
65 | IntRect boundingBox() const; | |
66 | bool isSelected() const; | |
67 | String spellingToolTip() const; | |
68 | String title() const; | |
69 | String altDisplayString() const; | |
70 | String titleDisplayString() const; | |
71 | Image* image() const; | |
72 | IntRect imageRect() const; | |
73 | KURL absoluteImageURL() const; | |
74 | KURL absoluteLinkURL() const; | |
75 | String textContent() const; | |
76 | bool isLiveLink() const; | |
77 | bool isContentEditable() const; | |
78 | ||
79 | private: | |
80 | RefPtr<Node> m_innerNode; | |
81 | RefPtr<Node> m_innerNonSharedNode; | |
82 | IntPoint m_point; | |
83 | IntPoint m_localPoint; // A point in the local coordinate space of m_innerNonSharedNode's renderer. Allows us to efficiently | |
84 | // determine where inside the renderer we hit on subsequent operations. | |
85 | RefPtr<Element> m_innerURLElement; | |
86 | RefPtr<Scrollbar> m_scrollbar; | |
87 | bool m_isOverWidget; // Returns true if we are over a widget (and not in the border/padding area of a RenderWidget for example). | |
88 | }; | |
89 | ||
90 | String displayString(const String&, const Node*); | |
91 | ||
92 | } // namespace WebCore | |
93 | ||
94 | #endif // HitTestResult_h |