#ifndef HitTestResult_h
#define HitTestResult_h
#include "core/rendering/HitTestLocation.h"
#include "core/rendering/HitTestRequest.h"
#include "platform/geometry/FloatQuad.h"
#include "platform/geometry/FloatRect.h"
#include "platform/geometry/LayoutRect.h"
#include "platform/text/TextDirection.h"
#include "wtf/Forward.h"
#include "wtf/ListHashSet.h"
#include "wtf/OwnPtr.h"
#include "wtf/RefPtr.h"
namespace WebCore {
class Element;
class LocalFrame;
class HTMLMediaElement;
class Image;
class KURL;
class Node;
class RenderObject;
class Scrollbar;
class HitTestResult {
public:
typedef ListHashSet<RefPtr<Node> > NodeSet;
HitTestResult();
HitTestResult(const LayoutPoint&);
HitTestResult(const LayoutPoint& centerPoint, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding);
HitTestResult(const HitTestLocation&);
HitTestResult(const HitTestResult&);
~HitTestResult();
HitTestResult& operator=(const HitTestResult&);
Node* innerNode() const { return m_innerNode.get(); }
Node* innerPossiblyPseudoNode() const { return m_innerPossiblyPseudoNode.get(); }
Element* innerElement() const;
Node* innerNonSharedNode() const { return m_innerNonSharedNode.get(); }
Element* URLElement() const { return m_innerURLElement.get(); }
Scrollbar* scrollbar() const { return m_scrollbar.get(); }
bool isOverWidget() const { return m_isOverWidget; }
bool isRectBasedTest() const { return m_hitTestLocation.isRectBasedTest(); }
const LayoutPoint& pointInMainFrame() const { return m_hitTestLocation.point(); }
IntPoint roundedPointInMainFrame() const { return roundedIntPoint(pointInMainFrame()); }
const LayoutPoint& pointInInnerNodeFrame() const { return m_pointInInnerNodeFrame; }
IntPoint roundedPointInInnerNodeFrame() const { return roundedIntPoint(pointInInnerNodeFrame()); }
LocalFrame* innerNodeFrame() const;
const LayoutPoint& localPoint() const { return m_localPoint; }
void setLocalPoint(const LayoutPoint& p) { m_localPoint = p; }
RenderObject* renderer() const;
void setToNodesInDocumentTreeScope();
void setToShadowHostIfInUserAgentShadowRoot();
const HitTestLocation& hitTestLocation() const { return m_hitTestLocation; }
void setInnerNode(Node*);
void setInnerNonSharedNode(Node*);
void setURLElement(Element*);
void setScrollbar(Scrollbar*);
void setIsFirstLetter(bool b) { m_isFirstLetter = b; }
void setIsOverWidget(bool b) { m_isOverWidget = b; }
bool isSelected() const;
String spellingToolTip(TextDirection&) const;
String title(TextDirection&) const;
const AtomicString& altDisplayString() const;
String titleDisplayString() const;
Image* image() const;
IntRect imageRect() const;
KURL absoluteImageURL() const;
KURL absoluteMediaURL() const;
KURL absoluteLinkURL() const;
String textContent() const;
bool isLiveLink() const;
bool isMisspelled() const;
bool isContentEditable() const;
bool isOverLink() const;
bool addNodeToRectBasedTestResult(Node*, const HitTestRequest&, const HitTestLocation& pointInContainer, const LayoutRect& = LayoutRect());
bool addNodeToRectBasedTestResult(Node*, const HitTestRequest&, const HitTestLocation& pointInContainer, const FloatRect&);
void append(const HitTestResult&);
const NodeSet& rectBasedTestResult() const;
Node* targetNode() const;
private:
NodeSet& mutableRectBasedTestResult();
HTMLMediaElement* mediaElement() const;
HitTestLocation m_hitTestLocation;
RefPtr<Node> m_innerNode;
RefPtr<Node> m_innerPossiblyPseudoNode;
RefPtr<Node> m_innerNonSharedNode;
LayoutPoint m_pointInInnerNodeFrame;
LayoutPoint m_localPoint;
RefPtr<Element> m_innerURLElement;
RefPtr<Scrollbar> m_scrollbar;
bool m_isOverWidget;
bool m_isFirstLetter;
mutable OwnPtr<NodeSet> m_rectBasedTestResult;
};
}
#endif