|
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 PlatformScrollbar; |
|
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 PlatformScrollbar* scrollbar() const { return m_scrollbar.get(); } |
|
52 |
|
53 void setToNonShadowAncestor(); |
|
54 |
|
55 void setInnerNode(Node*); |
|
56 void setInnerNonSharedNode(Node*); |
|
57 void setPoint(const IntPoint& p) { m_point = p; } |
|
58 void setLocalPoint(const IntPoint& p) { m_localPoint = p; } |
|
59 void setURLElement(Element*); |
|
60 void setScrollbar(PlatformScrollbar*); |
|
61 |
|
62 Frame* targetFrame() const; |
|
63 IntRect boundingBox() const; |
|
64 bool isSelected() const; |
|
65 String spellingToolTip() const; |
|
66 String title() const; |
|
67 String altDisplayString() const; |
|
68 String titleDisplayString() const; |
|
69 Image* image() const; |
|
70 IntRect imageRect() const; |
|
71 KURL absoluteImageURL() const; |
|
72 KURL absoluteLinkURL() const; |
|
73 String textContent() const; |
|
74 bool isLiveLink() const; |
|
75 bool isContentEditable() const; |
|
76 |
|
77 private: |
|
78 RefPtr<Node> m_innerNode; |
|
79 RefPtr<Node> m_innerNonSharedNode; |
|
80 IntPoint m_point; |
|
81 IntPoint m_localPoint; // A point in the local coordinate space of m_innerNonSharedNode's renderer. Allows us to efficiently |
|
82 // determine where inside the renderer we hit on subsequent operations. |
|
83 RefPtr<Element> m_innerURLElement; |
|
84 RefPtr<PlatformScrollbar> m_scrollbar; |
|
85 }; |
|
86 |
|
87 String displayString(const String&, const Node*); |
|
88 |
|
89 } // namespace WebCore |
|
90 |
|
91 #endif // HitTestResult_h |