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
00038 #ifndef nsIFrame_h___
00039 #define nsIFrame_h___
00040
00041
00042
00043
00044
00045
00046 #include <stdio.h>
00047 #include "nsISupports.h"
00048 #include "nsEvent.h"
00049 #include "nsStyleStruct.h"
00050 #include "nsStyleContext.h"
00051 #include "nsIContent.h"
00052
00070 struct nsHTMLReflowState;
00071 class nsHTMLReflowCommand;
00072 struct nsHTMLReflowMetrics;
00073
00074 class nsIAtom;
00075 class nsIPresContext;
00076 class nsIPresShell;
00077 class nsIRenderingContext;
00078 class nsIView;
00079 class nsIWidget;
00080 class nsIDOMRange;
00081 class nsISelectionController;
00082 #ifdef ACCESSIBILITY
00083 class nsIAccessible;
00084 #endif
00085
00086 struct nsPeekOffsetStruct;
00087 struct nsPoint;
00088 struct nsRect;
00089 struct nsSize;
00090 struct nsMargin;
00091
00092
00093 typedef void
00094 (*NSFramePropertyDtorFunc)(nsIPresContext* aPresContext,
00095 nsIFrame* aFrame,
00096 nsIAtom* aPropertyName,
00097 void* aPropertyValue);
00098
00099
00100
00101 #define NS_IFRAME_IID \
00102 { 0xa6cf9050, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
00103
00117 typedef PRUint32 nsSplittableType;
00118
00119 #define NS_FRAME_NOT_SPLITTABLE 0 // Note: not a bit!
00120 #define NS_FRAME_SPLITTABLE 0x1
00121 #define NS_FRAME_SPLITTABLE_NON_RECTANGULAR 0x3
00122
00123 #define NS_FRAME_IS_SPLITTABLE(type)\
00124 (0 != ((type) & NS_FRAME_SPLITTABLE))
00125
00126 #define NS_FRAME_IS_NOT_SPLITTABLE(type)\
00127 (0 == ((type) & NS_FRAME_SPLITTABLE))
00128
00129
00130
00135 typedef PRUint32 nsFrameState;
00136
00137 #define NS_FRAME_IN_REFLOW 0x00000001
00138
00139
00140
00141
00142 #define NS_FRAME_FIRST_REFLOW 0x00000002
00143
00144
00145
00146
00147
00148 #define NS_FRAME_SYNC_FRAME_AND_VIEW 0x00000004
00149
00150
00151
00152
00153
00154
00155 #define NS_FRAME_OUTSIDE_CHILDREN 0x00000008
00156
00157
00158
00159
00160 #define NS_FRAME_EXTERNAL_REFERENCE 0x00000010
00161
00162
00163
00164 #define NS_FRAME_REPLACED_ELEMENT 0x00000020
00165
00166
00167 #define NS_FRAME_GENERATED_CONTENT 0x00000040
00168
00169
00170
00171
00172 #define NS_FRAME_HAS_LOADED_IMAGES 0x00000080
00173
00174
00175
00176 #define NS_FRAME_OUT_OF_FLOW 0x00000100
00177
00178
00179 #define NS_FRAME_SELECTED_CONTENT 0x00000200
00180
00181
00182
00183 #define NS_FRAME_IS_DIRTY 0x00000400
00184
00185
00186 #define NS_FRAME_IS_UNFLOWABLE 0x00000800
00187
00188
00189 #define NS_FRAME_HAS_DIRTY_CHILDREN 0x00001000
00190
00191
00192 #define NS_FRAME_HAS_VIEW 0x00002000
00193
00194
00195 #define NS_FRAME_INDEPENDENT_SELECTION 0x00004000
00196
00197
00198
00199
00200 #define NS_FRAME_IS_SPECIAL 0x00008000
00201
00202
00203
00204
00205
00206
00207 #define NS_FRAME_EXCLUDE_IGNORABLE_WHITESPACE 0x00010000
00208
00209 #ifdef IBMBIDI
00210
00211
00212 #define NS_FRAME_IS_BIDI 0x00020000
00213 #endif
00214
00215
00216 #define NS_FRAME_HAS_CHILD_WITH_VIEW 0x00040000
00217
00218
00219
00220 #define NS_FRAME_REFLOW_ROOT 0x00080000
00221
00222
00223 #define NS_FRAME_RESERVED 0x000FFFFF
00224
00225
00226
00227 #define NS_FRAME_IMPL_RESERVED 0xFFF00000
00228
00229
00230
00231 enum nsFramePaintLayer {
00232 eFramePaintLayer_Underlay = 0,
00233 eFramePaintLayer_Content = 1,
00234 eFramePaintLayer_Overlay = 2
00235 };
00236
00237 enum nsSelectionAmount {
00238 eSelectCharacter = 0,
00239 eSelectWord = 1,
00240 eSelectLine = 2,
00241 eSelectBeginLine = 3,
00242 eSelectEndLine = 4,
00243 eSelectNoAmount = 5,
00244 eSelectDir = 6,
00245 eSelectParagraph = 7
00246 };
00247
00248 enum nsDirection {
00249 eDirNext = 0,
00250 eDirPrevious= 1
00251 };
00252
00253 enum nsSpread {
00254 eSpreadNone = 0,
00255 eSpreadAcross = 1,
00256 eSpreadDown = 2
00257 };
00258
00259
00260 #define NS_CARRIED_TOP_MARGIN_IS_AUTO 0x1
00261 #define NS_CARRIED_BOTTOM_MARGIN_IS_AUTO 0x2
00262
00263
00264
00265
00266
00267 #define NS_FRAME_PAINT_LAYER_BACKGROUND eFramePaintLayer_Underlay
00268 #define NS_FRAME_PAINT_LAYER_FLOATERS eFramePaintLayer_Content
00269 #define NS_FRAME_PAINT_LAYER_FOREGROUND eFramePaintLayer_Overlay
00270 #define NS_FRAME_PAINT_LAYER_DEBUG eFramePaintLayer_Overlay
00271
00291 typedef PRUint32 nsReflowStatus;
00292
00293 #define NS_FRAME_COMPLETE 0 // Note: not a bit!
00294 #define NS_FRAME_NOT_COMPLETE 0x1
00295 #define NS_FRAME_REFLOW_NEXTINFLOW 0x2
00296
00297 #define NS_FRAME_IS_COMPLETE(status) \
00298 (0 == ((status) & NS_FRAME_NOT_COMPLETE))
00299
00300 #define NS_FRAME_IS_NOT_COMPLETE(status) \
00301 (0 != ((status) & NS_FRAME_NOT_COMPLETE))
00302
00303
00304
00305 #define NS_IS_REFLOW_ERROR(_status) (PRInt32(_status) < 0)
00306
00311
00312
00313 #define NS_INLINE_BREAK 0x0100
00314
00315
00316
00317
00318 #define NS_INLINE_BREAK_BEFORE 0x0000
00319 #define NS_INLINE_BREAK_AFTER 0x0200
00320
00321
00322 #define NS_INLINE_BREAK_TYPE_MASK 0xF000
00323
00324
00325
00326
00327 #define NS_INLINE_IS_BREAK(_status) \
00328 (0 != ((_status) & NS_INLINE_BREAK))
00329
00330 #define NS_INLINE_IS_BREAK_AFTER(_status) \
00331 (0 != ((_status) & NS_INLINE_BREAK_AFTER))
00332
00333 #define NS_INLINE_IS_BREAK_BEFORE(_status) \
00334 (NS_INLINE_BREAK == ((_status) & (NS_INLINE_BREAK|NS_INLINE_BREAK_AFTER)))
00335
00336 #define NS_INLINE_GET_BREAK_TYPE(_status) (((_status) >> 12) & 0xF)
00337
00338 #define NS_INLINE_MAKE_BREAK_TYPE(_type) ((_type) << 12)
00339
00340
00341
00342
00343
00344 #define NS_INLINE_LINE_BREAK_BEFORE() \
00345 (NS_INLINE_BREAK | NS_INLINE_BREAK_BEFORE | \
00346 NS_INLINE_MAKE_BREAK_TYPE(NS_STYLE_CLEAR_LINE))
00347
00348
00349
00350
00351
00352 #define NS_INLINE_LINE_BREAK_AFTER(_completionStatus) \
00353 ((_completionStatus) | NS_INLINE_BREAK | NS_INLINE_BREAK_AFTER | \
00354 NS_INLINE_MAKE_BREAK_TYPE(NS_STYLE_CLEAR_LINE))
00355
00356
00357
00358
00359 #define NS_FRAME_TRUNCATED 0x0010
00360 #define NS_FRAME_IS_TRUNCATED(status) \
00361 (0 != ((status) & NS_FRAME_TRUNCATED))
00362 #define NS_FRAME_SET_TRUNCATION(status, aReflowState, aMetrics) \
00363 if (!aReflowState.mFlags.mIsTopOfPage && \
00364 aReflowState.availableHeight < aMetrics.height) \
00365 status |= NS_FRAME_TRUNCATED; \
00366 else \
00367 status &= ~NS_FRAME_TRUNCATED;
00368
00369
00370
00374 typedef PRBool nsDidReflowStatus;
00375
00376 #define NS_FRAME_REFLOW_NOT_FINISHED PR_FALSE
00377 #define NS_FRAME_REFLOW_FINISHED PR_TRUE
00378
00379
00380
00402 class nsIFrame : public nsISupports
00403 {
00404 public:
00405 NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFRAME_IID)
00406
00407 nsIPresContext* GetPresContext() const {
00408 return GetStyleContext()->GetRuleNode()->GetPresContext();
00409 }
00410
00429 NS_IMETHOD Init(nsIPresContext* aPresContext,
00430 nsIContent* aContent,
00431 nsIFrame* aParent,
00432 nsStyleContext* aContext,
00433 nsIFrame* aPrevInFlow) = 0;
00434
00439 NS_IMETHOD Destroy(nsIPresContext* aPresContext) = 0;
00440
00441
00442
00443
00444 virtual void RemovedAsPrimaryFrame(nsIPresContext* aPresContext) {}
00445
00464 NS_IMETHOD SetInitialChildList(nsIPresContext* aPresContext,
00465 nsIAtom* aListName,
00466 nsIFrame* aChildList) = 0;
00467
00482 NS_IMETHOD AppendFrames(nsIPresContext* aPresContext,
00483 nsIPresShell& aPresShell,
00484 nsIAtom* aListName,
00485 nsIFrame* aFrameList) = 0;
00486
00502 NS_IMETHOD InsertFrames(nsIPresContext* aPresContext,
00503 nsIPresShell& aPresShell,
00504 nsIAtom* aListName,
00505 nsIFrame* aPrevFrame,
00506 nsIFrame* aFrameList) = 0;
00507
00524 NS_IMETHOD RemoveFrame(nsIPresContext* aPresContext,
00525 nsIPresShell& aPresShell,
00526 nsIAtom* aListName,
00527 nsIFrame* aOldFrame) = 0;
00528
00546 NS_IMETHOD ReplaceFrame(nsIPresContext* aPresContext,
00547 nsIPresShell& aPresShell,
00548 nsIAtom* aListName,
00549 nsIFrame* aOldFrame,
00550 nsIFrame* aNewFrame) = 0;
00551
00555 nsIContent* GetContent() const { return mContent; }
00556
00561 NS_IMETHOD GetOffsets(PRInt32 &start, PRInt32 &end) const = 0;
00562
00567 virtual void AdjustOffsetsForBidi(PRInt32 aStart, PRInt32 aEnd) {}
00568
00573 nsStyleContext* GetStyleContext() const { return mStyleContext; }
00574 void SetStyleContext(nsIPresContext* aPresContext, nsStyleContext* aContext)
00575 {
00576 if (aContext != mStyleContext) {
00577 if (mStyleContext)
00578 mStyleContext->Release();
00579 mStyleContext = aContext;
00580 if (aContext) {
00581 aContext->AddRef();
00582 DidSetStyleContext(aPresContext);
00583 }
00584 }
00585 }
00586
00587
00588 NS_IMETHOD DidSetStyleContext(nsIPresContext* aPresContext) = 0;
00589
00598 virtual const nsStyleStruct* GetStyleDataExternal(nsStyleStructID aSID) const = 0;
00599
00600 const nsStyleStruct* GetStyleData(nsStyleStructID aSID) const {
00601 #ifdef _IMPL_NS_LAYOUT
00602 NS_ASSERTION(mStyleContext, "No style context found!");
00603 return mStyleContext->GetStyleData(aSID);
00604 #else
00605 return GetStyleDataExternal(aSID);
00606 #endif
00607 }
00608
00617 #define STYLE_STRUCT(name_, checkdata_cb_, ctor_args_) \
00618 const nsStyle##name_ * GetStyle##name_() const { \
00619 return NS_STATIC_CAST(const nsStyle##name_*, \
00620 GetStyleData(eStyleStruct_##name_)); \
00621 }
00622 #include "nsStyleStructList.h"
00623 #undef STYLE_STRUCT
00624
00625
00626
00627 NS_IMETHOD CalcBorderPadding(nsMargin& aBorderPadding) const = 0;
00628
00639 virtual nsStyleContext* GetAdditionalStyleContext(PRInt32 aIndex) const = 0;
00640
00641 virtual void SetAdditionalStyleContext(PRInt32 aIndex,
00642 nsStyleContext* aStyleContext) = 0;
00643
00647 nsIFrame* GetParent() const { return mParent; }
00648 NS_IMETHOD SetParent(const nsIFrame* aParent) { mParent = (nsIFrame*)aParent; return NS_OK; }
00649
00658 nsRect GetRect() const { return mRect; }
00659 nsPoint GetPosition() const { return nsPoint(mRect.x, mRect.y); }
00660 nsSize GetSize() const { return nsSize(mRect.width, mRect.height); }
00661 void SetRect(const nsRect& aRect) { mRect = aRect; }
00662 void SetPosition(const nsPoint& aPt) { mRect.MoveTo(aPt); }
00663 void SetSize(const nsSize& aSize) { mRect.SizeTo(aSize); }
00664
00675 NS_IMETHOD GetAdditionalChildListName(PRInt32 aIndex,
00676 nsIAtom** aListName) const = 0;
00677
00686 NS_IMETHOD FirstChild(nsIPresContext* aPresContext,
00687 nsIAtom* aListName,
00688 nsIFrame** aFirstChild) const = 0;
00689
00693 nsIFrame* GetNextSibling() const { return mNextSibling; }
00694 void SetNextSibling(nsIFrame* aNextSibling) { mNextSibling = aNextSibling; }
00695
00701 NS_IMETHOD Paint(nsIPresContext* aPresContext,
00702 nsIRenderingContext& aRenderingContext,
00703 const nsRect& aDirtyRect,
00704 nsFramePaintLayer aWhichLayer,
00705 PRUint32 aFlags = 0) = 0;
00706
00707
00708
00709
00710
00711 virtual PRBool CanPaintBackground() { return PR_TRUE; }
00712
00728 NS_IMETHOD HandleEvent(nsIPresContext* aPresContext,
00729 nsGUIEvent* aEvent,
00730 nsEventStatus* aEventStatus) = 0;
00731
00732 NS_IMETHOD GetContentForEvent(nsIPresContext* aPresContext,
00733 nsEvent* aEvent,
00734 nsIContent** aContent) = 0;
00735
00736 NS_IMETHOD GetContentAndOffsetsFromPoint(nsIPresContext* aCX,
00737 const nsPoint& aPoint,
00738 nsIContent ** aNewContent,
00739 PRInt32& aContentOffset,
00740 PRInt32& aContentOffsetEnd,
00741 PRBool& aBeginFrameContent) = 0;
00742
00743
00747 NS_IMETHOD GetCursor(nsIPresContext* aPresContext,
00748 nsPoint& aPoint,
00749 PRInt32& aCursor) = 0;
00750
00758 NS_IMETHOD GetFrameForPoint(nsIPresContext* aPresContext,
00759 const nsPoint& aPoint,
00760 nsFramePaintLayer aWhichLayer,
00761 nsIFrame** aFrame) = 0;
00762
00763
00769 NS_IMETHOD GetPointFromOffset(nsIPresContext* inPresContext,
00770 nsIRenderingContext* inRendContext,
00771 PRInt32 inOffset,
00772 nsPoint* outPoint) = 0;
00773
00782 NS_IMETHOD GetChildFrameContainingOffset(PRInt32 inContentOffset,
00783 PRBool inHint,
00784 PRInt32* outFrameContentOffset,
00785 nsIFrame* *outChildFrame) = 0;
00786
00791 nsFrameState GetStateBits() const { return mState; }
00792
00796 void AddStateBits(nsFrameState aBits) { mState |= aBits; }
00797 void RemoveStateBits(nsFrameState aBits) { mState &= ~aBits; }
00798
00808 NS_IMETHOD ContentChanged(nsIPresContext* aPresContext,
00809 nsIContent* aChild,
00810 nsISupports* aSubContent) = 0;
00811
00822 NS_IMETHOD AttributeChanged(nsIPresContext* aPresContext,
00823 nsIContent* aChild,
00824 PRInt32 aNameSpaceID,
00825 nsIAtom* aAttribute,
00826 PRInt32 aModType) = 0;
00827
00831 NS_IMETHOD IsSplittable(nsSplittableType& aIsSplittable) const = 0;
00832
00836 NS_IMETHOD GetPrevInFlow(nsIFrame** aPrevInFlow) const = 0;
00837 NS_IMETHOD SetPrevInFlow(nsIFrame*) = 0;
00838 NS_IMETHOD GetNextInFlow(nsIFrame** aNextInFlow) const = 0;
00839 NS_IMETHOD SetNextInFlow(nsIFrame*) = 0;
00840
00844 virtual nsIFrame* GetFirstInFlow() const {
00845 return NS_CONST_CAST(nsIFrame*, this);
00846 }
00847
00851 virtual nsIFrame* GetLastInFlow() const {
00852 return NS_CONST_CAST(nsIFrame*, this);
00853 }
00854
00864 NS_IMETHOD WillReflow(nsIPresContext* aPresContext) = 0;
00865
00906 NS_IMETHOD Reflow(nsIPresContext* aPresContext,
00907 nsHTMLReflowMetrics& aReflowMetrics,
00908 const nsHTMLReflowState& aReflowState,
00909 nsReflowStatus& aStatus) = 0;
00910
00926 NS_IMETHOD DidReflow(nsIPresContext* aPresContext,
00927 const nsHTMLReflowState* aReflowState,
00928 nsDidReflowStatus aStatus) = 0;
00929
00930
00931
00943 NS_IMETHOD CanContinueTextRun(PRBool& aContinueTextRun) const = 0;
00944
00945
00946
00947
00948 NS_IMETHOD AdjustFrameSize(nscoord aExtraSpace, nscoord& aUsedSpace) = 0;
00949
00950
00951
00952 NS_IMETHOD TrimTrailingWhiteSpace(nsIPresContext* aPresContext,
00953 nsIRenderingContext& aRC,
00954 nscoord& aDeltaWidth) = 0;
00955
00961 PRBool HasView() const { return mState & NS_FRAME_HAS_VIEW; }
00962 nsIView* GetView() const;
00963 virtual nsIView* GetViewExternal() const;
00964 nsresult SetView(nsIView* aView);
00965
00969 nsIView* GetClosestView() const;
00970
00974 nsIFrame* GetAncestorWithView() const;
00975 virtual nsIFrame* GetAncestorWithViewExternal() const;
00976
00981 NS_IMETHOD GetOffsetFromView(nsIPresContext* aPresContext,
00982 nsPoint& aOffset,
00983 nsIView** aView) const = 0;
00984
00993 NS_IMETHOD GetOriginToViewOffset(nsIPresContext* aPresContext,
00994 nsPoint& aOffset,
00995 nsIView** aView) const = 0;
00996
01001 virtual PRBool AreAncestorViewsVisible() const;
01002
01009 virtual nsIWidget* GetWindow() const;
01010
01016 NS_IMETHOD GetFrameType(nsIAtom** aType) const = 0;
01017
01021 NS_IMETHOD IsPercentageBase(PRBool& aBase) const = 0;
01022
01033 NS_IMETHOD SetSelected(nsIPresContext* aPresContext,
01034 nsIDOMRange* aRange,
01035 PRBool aSelected,
01036 nsSpread aSpread) = 0;
01037
01038 NS_IMETHOD GetSelected(PRBool *aSelected) const = 0;
01039
01049 NS_IMETHOD IsSelectable(PRBool* aIsSelectable, PRUint8* aSelectStyle) const = 0;
01050
01056 NS_IMETHOD GetSelectionController(nsIPresContext *aPresContext, nsISelectionController **aSelCon) = 0;
01057
01067 NS_IMETHOD CaptureMouse(nsIPresContext* aPresContext, PRBool aGrabMouseEvents) = 0;
01068
01076 NS_IMETHOD PeekOffset(nsIPresContext* aPresContext, nsPeekOffsetStruct *aPos) = 0;
01077
01089 NS_IMETHOD CheckVisibility(nsIPresContext* aContext, PRInt32 aStartIndex, PRInt32 aEndIndex, PRBool aRecurse, PRBool *aFinished, PRBool *_retval)=0;
01090
01097 NS_IMETHOD ReflowDirtyChild(nsIPresShell* aPresShell, nsIFrame* aChild) = 0;
01098
01106 #ifdef ACCESSIBILITY
01107 NS_IMETHOD GetAccessible(nsIAccessible** aAccessible) = 0;
01108 #endif
01109
01127 NS_IMETHOD GetParentStyleContextFrame(nsIPresContext* aPresContext,
01128 nsIFrame** aProviderFrame,
01129 PRBool* aIsChild) = 0;
01130
01140 NS_IMETHOD IsVisibleForPainting(nsIPresContext * aPresContext,
01141 nsIRenderingContext& aRenderingContext,
01142 PRBool aCheckVis,
01143 PRBool* aIsVisible) = 0;
01144
01155 NS_IMETHOD IsEmpty(nsCompatibility aCompatMode,
01156 PRBool aIsPre,
01157 PRBool* aResult) = 0;
01158
01165 PRBool IsGeneratedContentFrame() {
01166 return (mState & NS_FRAME_GENERATED_CONTENT) != 0;
01167 }
01168
01177 PRBool IsPseudoFrame(nsIContent* aParentContent) {
01178 return mContent == aParentContent;
01179 }
01180
01181
01182
01183 virtual void* GetProperty(nsIPresContext* aPresContext,
01184 nsIAtom* aPropertyName,
01185 PRBool aRemoveProperty) const = 0;
01186
01187 virtual nsresult SetProperty(nsIPresContext* aPresContext,
01188 nsIAtom* aPropertyName,
01189 void* aPropertyValue,
01190 NSFramePropertyDtorFunc aPropDtorFunc) = 0;
01191 #ifdef IBMBIDI
01192
01196 NS_IMETHOD GetBidiProperty(nsIPresContext* aPresContext,
01197 nsIAtom* aPropertyName,
01198 void** aPropertyValue,
01199 size_t aSize ) const = 0;
01200 NS_IMETHOD SetBidiProperty(nsIPresContext* aPresContext,
01201 nsIAtom* aPropertyName,
01202 void* aPropertyValue) = 0;
01203 #endif // IBMBIDI
01204
01211 virtual nsRect* GetOverflowAreaProperty(nsIPresContext* aPresContext,
01212 PRBool aCreateIfNecessary = PR_FALSE) = 0;
01213
01219 virtual PRBool SupportsVisibilityHidden() { return PR_TRUE; }
01220
01221
01222 nsresult GetContent(nsIContent** aContent) const { *aContent = mContent; NS_IF_ADDREF(*aContent); return NS_OK; }
01223 nsresult GetParent(nsIFrame** aParent) const { *aParent = mParent; return NS_OK; }
01224 nsresult GetRect(nsRect& aRect) const {
01225 aRect = mRect;
01226 return NS_OK;
01227 }
01228 nsresult GetOrigin(nsPoint& aPoint) const {
01229 aPoint.x = mRect.x;
01230 aPoint.y = mRect.y;
01231 return NS_OK;
01232 }
01233 nsresult GetSize(nsSize& aSize) const {
01234 aSize.width = mRect.width;
01235 aSize.height = mRect.height;
01236 return NS_OK;
01237 }
01238 nsresult SetRect(nsIPresContext* aPresContext,
01239 const nsRect& aRect) {
01240 MoveTo(aPresContext, aRect.x, aRect.y);
01241 SizeTo(aPresContext, aRect.width, aRect.height);
01242 return NS_OK;
01243 }
01244 nsresult MoveTo(nsIPresContext* aPresContext,
01245 nscoord aX,
01246 nscoord aY) {
01247 mRect.x = aX;
01248 mRect.y = aY;
01249 return NS_OK;
01250 }
01251 nsresult SizeTo(nsIPresContext* aPresContext,
01252 nscoord aWidth,
01253 nscoord aHeight) {
01254 mRect.width = aWidth;
01255 mRect.height = aHeight;
01256 return NS_OK;
01257 }
01258 nsresult GetNextSibling(nsIFrame** aNextSibling) const {
01259 *aNextSibling = mNextSibling;
01260 return NS_OK;
01261 }
01262 nsresult GetFrameState(nsFrameState* aResult) {
01263 *aResult = mState;
01264 return NS_OK;
01265 }
01266 nsresult SetFrameState(nsFrameState aState) {
01267 mState = aState;
01268 return NS_OK;
01269 }
01270 nsIView* GetView(nsIPresContext* aPresContext) const { return GetView(); }
01271 nsIView* GetViewExternal(nsIPresContext* aPresContext) const { return GetViewExternal(); }
01272 nsresult SetView(nsIPresContext* aPresContext, nsIView* aView) { return SetView(aView); }
01273 nsIView* GetClosestView(nsIPresContext* aPresContext) const { return GetClosestView(); }
01274 nsresult GetParentWithView(nsIPresContext* aPresContext, nsIFrame** aParent) const {
01275 *aParent = GetAncestorWithViewExternal();
01276 return NS_OK;
01277 }
01278 PRBool AreAncestorViewsVisible(nsIPresContext* aPresContext) const {
01279 return AreAncestorViewsVisible();
01280 }
01281
01282 protected:
01283
01284 nsRect mRect;
01285 nsIContent* mContent;
01286 nsStyleContext* mStyleContext;
01287 nsIFrame* mParent;
01288 nsIFrame* mNextSibling;
01289 nsFrameState mState;
01290
01291 private:
01292 NS_IMETHOD_(nsrefcnt) AddRef(void) = 0;
01293 NS_IMETHOD_(nsrefcnt) Release(void) = 0;
01294 };
01295
01296 #endif