render_flow.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef RENDER_FLOW_H
00025 #define RENDER_FLOW_H
00026
00027 #include <qsortedlist.h>
00028
00029 #include "render_box.h"
00030 #include "bidi.h"
00031
00032 namespace khtml {
00033
00043 class RenderFlow : public RenderBox
00044 {
00045
00046 public:
00047 RenderFlow(DOM::NodeImpl* node);
00048
00049 virtual ~RenderFlow();
00050
00051 virtual const char *renderName() const { return "RenderFlow"; }
00052
00053 virtual void setStyle(RenderStyle *style);
00054
00055 virtual bool isFlow() const { return true; }
00056 virtual bool childrenInline() const { return m_childrenInline; }
00057 virtual bool isRendered() const { return true; }
00058 void makeChildrenNonInline(RenderObject *box2Start = 0);
00059
00060
00061
00062 virtual void paint( QPainter *, int x, int y, int w, int h,
00063 int tx, int ty);
00064 virtual void paintObject( QPainter *, int x, int y, int w, int h,
00065 int tx, int ty);
00066 void paintSpecialObjects( QPainter *, int x, int y, int w, int h,
00067 int tx, int ty);
00068
00069 virtual void layout( );
00070
00071 virtual void close();
00072
00073 virtual void addChild(RenderObject *newChild, RenderObject *beforeChild = 0);
00074
00075 virtual short lineWidth(int y) const;
00076
00077 virtual int lowestPosition() const;
00078 virtual int rightmostPosition() const;
00079
00080 int rightOffset() const;
00081 int rightRelOffset(int y, int fixedOffset, int *heightRemaining = 0) const;
00082 int rightOffset(int y) const { return rightRelOffset(y, rightOffset()); }
00083
00084 int leftOffset() const;
00085 int leftRelOffset(int y, int fixedOffset, int *heightRemaining = 0) const;
00086 int leftOffset(int y) const { return leftRelOffset(y, leftOffset()); }
00087
00088 #ifndef NDEBUG
00089 virtual void printTree(int indent=0) const;
00090 virtual void dump(QTextStream *stream, QString ind = "") const;
00091 #endif
00092
00093 virtual FindSelectionResult checkSelectionPoint( int _x, int _y, int _tx, int _ty,
00094 DOM::NodeImpl*&, int & offset );
00095
00096 virtual bool nodeAtPoint(NodeInfo& info, int x, int y, int tx, int ty);
00097
00098 protected:
00099
00100 virtual void newLine();
00101
00102 void layoutBlockChildren( bool relayoutChildren );
00103 void layoutInlineChildren( bool relayoutChildren );
00104 void layoutSpecialObjects( bool relayoutChildren );
00105
00106 public:
00107 int floatBottom() const;
00108 inline int leftBottom();
00109 inline int rightBottom();
00110 bool checkClear(RenderObject *child);
00111
00112 void insertSpecialObject(RenderObject *o);
00113 void removeSpecialObject(RenderObject *o);
00114
00115 void positionNewFloats();
00116 void clearFloats();
00117 virtual void calcMinMaxWidth();
00118
00119 virtual bool containsSpecial() { return specialObjects!=0; }
00120 virtual bool hasOverhangingFloats() { return floatBottom() > m_height; }
00121
00122 void addOverHangingFloats( RenderFlow *flow, int xoffset, int yoffset, bool child = false );
00123
00124
00125 void bidiReorderLine(const BidiIterator &start, const BidiIterator &end);
00126 BidiIterator findNextLineBreak(BidiIterator &start);
00127
00128 protected:
00129
00130 struct SpecialObject {
00131 enum Type {
00132 FloatLeft,
00133 FloatRight,
00134 Positioned
00135 };
00136
00137 SpecialObject(Type _type) {
00138 node = 0;
00139 startY = 0;
00140 endY = 0;
00141 type = _type;
00142 left = 0;
00143 width = 0;
00144 count = 0;
00145 noPaint = false;
00146
00147 }
00148 RenderObject* node;
00149 int startY;
00150 int endY;
00151 short left;
00152 short width;
00153 short count;
00154 Type type : 2;
00155 bool noPaint : 1;
00156
00157 bool operator==(const SpecialObject& ) const
00158 {
00159 return false;
00160 }
00161 bool operator<(const SpecialObject& o) const;
00162 };
00163
00164 QSortedList<SpecialObject>* specialObjects;
00165
00166 private:
00167 bool m_childrenInline : 1;
00168 bool m_pre : 1;
00169 bool firstLine : 1;
00170 EClear m_clearStatus : 2;
00171 };
00172
00173
00174 };
00175
00176 #endif
This file is part of the documentation for kdelibs Version 3.1.0.