00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef nsContainerFrame_h___
00038 #define nsContainerFrame_h___
00039
00040 #include "nsSplittableFrame.h"
00041 #include "nsFrameList.h"
00042
00043
00044
00045 #define NS_FRAME_NO_MOVE_VIEW 0x0001
00046 #define NS_FRAME_NO_MOVE_FRAME (0x0002 | NS_FRAME_NO_MOVE_VIEW)
00047 #define NS_FRAME_NO_SIZE_VIEW 0x0004
00048 #define NS_FRAME_NO_VISIBILITY 0x0008
00049
00053 class nsContainerFrame : public nsSplittableFrame
00054 {
00055 public:
00056
00057 NS_IMETHOD Init(nsIPresContext* aPresContext,
00058 nsIContent* aContent,
00059 nsIFrame* aParent,
00060 nsStyleContext* aContext,
00061 nsIFrame* aPrevInFlow);
00062 NS_IMETHOD SetInitialChildList(nsIPresContext* aPresContext,
00063 nsIAtom* aListName,
00064 nsIFrame* aChildList);
00065 NS_IMETHOD FirstChild(nsIPresContext* aPresContext,
00066 nsIAtom* aListName,
00067 nsIFrame** aFirstChild) const;
00068 NS_IMETHOD GetAdditionalChildListName(PRInt32 aIndex,
00069 nsIAtom** aListName) const;
00070 NS_IMETHOD Destroy(nsIPresContext* aPresContext);
00071 NS_IMETHOD Paint(nsIPresContext* aPresContext,
00072 nsIRenderingContext& aRenderingContext,
00073 const nsRect& aDirtyRect,
00074 nsFramePaintLayer aWhichLayer,
00075 PRUint32 aFlags = 0);
00076 NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext,
00077 const nsPoint& aPoint,
00078 nsFramePaintLayer aWhichLayer,
00079 nsIFrame** aFrame);
00080 NS_IMETHOD ReplaceFrame(nsIPresContext* aPresContext,
00081 nsIPresShell& aPresShell,
00082 nsIAtom* aListName,
00083 nsIFrame* aOldFrame,
00084 nsIFrame* aNewFrame);
00085 NS_IMETHOD ReflowDirtyChild(nsIPresShell* aPresShell, nsIFrame* aChild);
00086
00087 #ifdef DEBUG
00088 NS_IMETHOD List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) const;
00089 #endif
00090
00091
00092 virtual void DeleteNextInFlowChild(nsIPresContext* aPresContext,
00093 nsIFrame* aNextInFlow);
00094
00095 static PRInt32 LengthOf(nsIFrame* aFrameList) {
00096 nsFrameList tmp(aFrameList);
00097 return tmp.GetLength();
00098 }
00099
00100
00101 static void PositionFrameView(nsIPresContext* aPresContext,
00102 nsIFrame* aKidFrame);
00103
00104
00105
00106
00107
00108
00109
00110 static void SyncFrameViewAfterReflow(nsIPresContext* aPresContext,
00111 nsIFrame* aFrame,
00112 nsIView* aView,
00113 const nsRect* aCombinedArea,
00114 PRUint32 aFlags = 0);
00115
00116
00117
00118
00119
00120 static void SyncFrameViewAfterSizeChange(nsIPresContext* aPresContext,
00121 nsIFrame* aFrame,
00122 nsStyleContext* aStyleContext,
00123 nsIView* aView,
00124 PRUint32 aFlags = 0);
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134 static void SyncFrameViewProperties(nsIPresContext* aPresContext,
00135 nsIFrame* aFrame,
00136 nsStyleContext* aStyleContext,
00137 nsIView* aView,
00138 PRUint32 aFlags = 0);
00139
00140
00141 static PRBool FrameNeedsView(nsIPresContext* aPresContext,
00142 nsIFrame* aFrame, nsStyleContext* aStyleContext);
00143
00155 nsresult ReflowChild(nsIFrame* aKidFrame,
00156 nsIPresContext* aPresContext,
00157 nsHTMLReflowMetrics& aDesiredSize,
00158 const nsHTMLReflowState& aReflowState,
00159 nscoord aX,
00160 nscoord aY,
00161 PRUint32 aFlags,
00162 nsReflowStatus& aStatus);
00163
00181 static nsresult FinishReflowChild(nsIFrame* aKidFrame,
00182 nsIPresContext* aPresContext,
00183 const nsHTMLReflowState* aReflowState,
00184 nsHTMLReflowMetrics& aDesiredSize,
00185 nscoord aX,
00186 nscoord aY,
00187 PRUint32 aFlags);
00188
00189
00190 static void PositionChildViews(nsIPresContext* aPresContext,
00191 nsIFrame* aFrame);
00192
00193 protected:
00194 nsContainerFrame();
00195 ~nsContainerFrame();
00196
00197 nsresult GetFrameForPointUsing(nsIPresContext* aPresContext,
00198 const nsPoint& aPoint,
00199 nsIAtom* aList,
00200 nsFramePaintLayer aWhichLayer,
00201 PRBool aConsiderSelf,
00202 nsIFrame** aFrame);
00203
00204 virtual void PaintChildren(nsIPresContext* aPresContext,
00205 nsIRenderingContext& aRenderingContext,
00206 const nsRect& aDirtyRect,
00207 nsFramePaintLayer aWhichLayer,
00208 PRUint32 aFlags = 0);
00209
00210 virtual void PaintChild(nsIPresContext* aPresContext,
00211 nsIRenderingContext& aRenderingContext,
00212 const nsRect& aDirtyRect,
00213 nsIFrame* aFrame,
00214 nsFramePaintLayer aWhichLayer,
00215 PRUint32 aFlags = 0);
00216
00220 nsIFrame* GetOverflowFrames(nsIPresContext* aPresContext,
00221 PRBool aRemoveProperty) const;
00222
00226 nsresult SetOverflowFrames(nsIPresContext* aPresContext,
00227 nsIFrame* aOverflowFrames);
00228
00238 PRBool MoveOverflowToChildList(nsIPresContext* aPresContext);
00239
00254 void PushChildren(nsIPresContext* aPresContext,
00255 nsIFrame* aFromChild,
00256 nsIFrame* aPrevSibling);
00257
00258 nsFrameList mFrames;
00259 };
00260
00261 #endif