ScrollingTreeNode.h [plain text]
#ifndef ScrollingTreeNode_h
#define ScrollingTreeNode_h
#if ENABLE(THREADED_SCROLLING)
#include "IntRect.h"
#include "ScrollTypes.h"
#include "ScrollingCoordinator.h"
#include <wtf/PassOwnPtr.h>
namespace WebCore {
class ScrollingStateFixedNode;
class ScrollingStateNode;
class ScrollingStateScrollingNode;
class ScrollingTreeNode {
public:
explicit ScrollingTreeNode(ScrollingTree*, ScrollingNodeID);
virtual ~ScrollingTreeNode();
virtual void updateBeforeChildren(ScrollingStateNode*) = 0;
virtual void updateAfterChildren(ScrollingStateNode*) { }
virtual void parentScrollPositionDidChange(const IntRect& viewportRect, const FloatSize& cumulativeDelta) = 0;
ScrollingNodeID scrollingNodeID() const { return m_nodeID; }
ScrollingTreeNode* parent() const { return m_parent; }
void setParent(ScrollingTreeNode* parent) { m_parent = parent; }
void appendChild(PassOwnPtr<ScrollingTreeNode>);
void removeChild(ScrollingTreeNode*);
protected:
ScrollingTree* scrollingTree() const { return m_scrollingTree; }
typedef Vector<OwnPtr<ScrollingTreeNode> > ScrollingTreeChildrenVector;
OwnPtr<ScrollingTreeChildrenVector> m_children;
private:
ScrollingTree* m_scrollingTree;
ScrollingNodeID m_nodeID;
ScrollingTreeNode* m_parent;
};
}
#endif // ENABLE(THREADED_SCROLLING)
#endif // ScrollingTreeNode_h