#ifndef RenderFlow_h
#define RenderFlow_h
#include "RenderContainer.h"
namespace WebCore {
enum LineCount
{
NOT_SET = 0, NO_LINE = 1, ONE_LINE = 2, MULTI_LINE = 3
};
class RenderFlow : public RenderContainer {
public:
RenderFlow(Node* node)
: RenderContainer(node)
, m_continuation(0)
, m_firstLineBox(0)
, m_lastLineBox(0)
, m_lineHeight(-1)
, m_childrenInline(true)
, m_firstLine(false)
, m_clearStatus(CNONE)
, m_topMarginQuirk(false)
, m_bottomMarginQuirk(false)
, m_hasMarkupTruncation(false)
, m_selectionState(SelectionNone)
, m_hasColumns(false)
, m_lineCountForTextAutosizing(NOT_SET)
, m_isContinuation(false)
{
}
#ifndef NDEBUG
virtual ~RenderFlow();
#endif
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*, RenderStyle*);
void extractLineBox(InlineFlowBox*);
void attachLineBox(InlineFlowBox*);
void removeLineBox(InlineFlowBox*);
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&, int tx, int ty);
bool hitTestLines(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
virtual IntRect absoluteClippedOverflowRect();
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 = UPSTREAM, int* extraWidthToEndOfLine = 0);
virtual void addFocusRingRects(GraphicsContext*, int tx, int ty);
void paintOutlineForLine(GraphicsContext*, int tx, int ty, const IntRect& prevLine, const IntRect& thisLine, const IntRect& nextLine);
void paintOutline(GraphicsContext*, int tx, int ty);
virtual bool hasColumns() const { return m_hasColumns; }
virtual bool isWordBreak() const { ASSERT(isInlineFlow()); return false; }
void checkConsistency() const;
private:
RenderFlow* m_continuation;
protected:
InlineFlowBox* m_firstLineBox;
InlineFlowBox* m_lastLineBox;
mutable short m_lineHeight;
bool m_childrenInline : 1;
bool m_firstLine : 1;
unsigned m_clearStatus : 2; bool m_topMarginQuirk : 1;
bool m_bottomMarginQuirk : 1;
bool m_hasMarkupTruncation : 1;
unsigned m_selectionState : 3; bool m_hasColumns : 1;
unsigned m_lineCountForTextAutosizing : 2;
bool m_isContinuation : 1; };
#ifdef NDEBUG
inline void RenderFlow::checkConsistency() const
{
}
#endif
}
#endif // RenderFlow_h