#ifndef RENDER_FLOW_H
#define RENDER_FLOW_H
#include "RenderContainer.h"
namespace WebCore {
class RenderFlow : public RenderContainer
{
public:
RenderFlow(Node* node)
: RenderContainer(node), m_lineHeight(-1)
{ m_continuation = 0; m_firstLineBox = 0; m_lastLineBox = 0;}
virtual RenderFlow* continuation() const { return m_continuation; }
void setContinuation(RenderFlow* c) { m_continuation = c; }
RenderFlow* continuationBefore(RenderObject* beforeChild);
void addChildWithContinuation(RenderObject* newChild, RenderObject* beforeChild);
virtual void addChildToFlow(RenderObject* newChild, RenderObject* beforeChild) = 0;
virtual void addChild(RenderObject *newChild, RenderObject *beforeChild = 0);
static RenderFlow* createAnonymousFlow(Document* doc, RenderStyle* style);
void extractLineBox(InlineFlowBox* lineBox);
void attachLineBox(InlineFlowBox* lineBox);
void removeLineBox(InlineFlowBox* lineBox);
void deleteLineBoxes();
virtual void destroy();
virtual void dirtyLinesFromChangedChild(RenderObject* child);
virtual short lineHeight(bool firstLine, bool isRootLineBox=false) const;
InlineFlowBox* firstLineBox() const { return m_firstLineBox; }
InlineFlowBox* lastLineBox() const { return m_lastLineBox; }
virtual InlineBox* createInlineBox(bool makePlaceHolderBox, bool isRootLineBox, bool isOnlyRun=false);
virtual void dirtyLineBoxes(bool fullLayout, bool isRootLineBox = false);
void paintLines(PaintInfo& i, int _tx, int _ty);
bool hitTestLines(NodeInfo& i, int x, int y, int tx, int ty, HitTestAction hitTestAction);
virtual IntRect getAbsoluteRepaintRect();
virtual int lowestPosition(bool includeOverflowInterior=true, bool includeSelf=true) const;
virtual int rightmostPosition(bool includeOverflowInterior=true, bool includeSelf=true) const;
virtual int leftmostPosition(bool includeOverflowInterior=true, bool includeSelf=true) const;
virtual IntRect caretRect(int offset, EAffinity affinity = UPSTREAM, int *extraWidthToEndOfLine = 0);
virtual void addFocusRingRects(GraphicsContext*, int _tx, int _ty);
void paintFocusRing(GraphicsContext*, int tx, int ty);
void paintOutlineForLine(GraphicsContext*, int tx, int ty, const IntRect &prevLine, const IntRect &thisLine, const IntRect &nextLine);
void paintOutlines(GraphicsContext*, int tx, int ty);
protected:
RenderFlow* m_continuation;
InlineFlowBox* m_firstLineBox;
InlineFlowBox* m_lastLineBox;
mutable short m_lineHeight;
};
};
#endif