nsIFrame Class Reference
#include <nsIFrame.h>
Inheritance diagram for nsIFrame:
[legend]Collaboration diagram for nsIFrame:
[legend]List of all members.
Detailed Description
A frame in the layout model. This interface is supported by all frame objects.
Frames can have multiple child lists: the default unnamed child list (referred to as the principal child list, and additional named child lists. There is an ordering of frames within a child list, but there is no order defined between frames in different child lists of the same parent frame.
Frames are NOT reference counted. Use the Destroy() member function to destroy a frame. The lifetime of the frame hierarchy is bounded by the lifetime of the presentation shell which owns the frames.
nsIFrame is a private Gecko interface. If you are not Gecko then you should not use it. If you're not in layout, then you won't be able to link to many of the functions defined here. Too bad.
If you're not in layout but you must call functions in here, at least restrict yourself to calling virtual methods, which won't hurt you as badly.
Definition at line 402 of file nsIFrame.h.
Public Member Functions
- nsIPresContext * GetPresContext () const
- virtual nsresult Init (nsIPresContext *aPresContext, nsIContent *aContent, nsIFrame *aParent, nsStyleContext *aContext, nsIFrame *aPrevInFlow)=0
- virtual nsresult Destroy (nsIPresContext *aPresContext)=0
- virtual void RemovedAsPrimaryFrame (nsIPresContext *aPresContext)
- virtual nsresult SetInitialChildList (nsIPresContext *aPresContext, nsIAtom *aListName, nsIFrame *aChildList)=0
- virtual nsresult AppendFrames (nsIPresContext *aPresContext, nsIPresShell &aPresShell, nsIAtom *aListName, nsIFrame *aFrameList)=0
- virtual nsresult InsertFrames (nsIPresContext *aPresContext, nsIPresShell &aPresShell, nsIAtom *aListName, nsIFrame *aPrevFrame, nsIFrame *aFrameList)=0
- virtual nsresult RemoveFrame (nsIPresContext *aPresContext, nsIPresShell &aPresShell, nsIAtom *aListName, nsIFrame *aOldFrame)=0
- virtual nsresult ReplaceFrame (nsIPresContext *aPresContext, nsIPresShell &aPresShell, nsIAtom *aListName, nsIFrame *aOldFrame, nsIFrame *aNewFrame)=0
- nsIContent * GetContent () const
- virtual nsresult GetOffsets (PRInt32 &start, PRInt32 &end) const=0
- virtual void AdjustOffsetsForBidi (PRInt32 aStart, PRInt32 aEnd)
- nsStyleContext * GetStyleContext () const
- void SetStyleContext (nsIPresContext *aPresContext, nsStyleContext *aContext)
- virtual nsresult DidSetStyleContext (nsIPresContext *aPresContext)=0
- virtual const nsStyleStruct * GetStyleDataExternal (nsStyleStructID aSID) const=0
- const nsStyleStruct * GetStyleData (nsStyleStructID aSID) const
- virtual nsresult CalcBorderPadding (nsMargin &aBorderPadding) const=0
- virtual nsStyleContext * GetAdditionalStyleContext (PRInt32 aIndex) const=0
- virtual void SetAdditionalStyleContext (PRInt32 aIndex, nsStyleContext *aStyleContext)=0
- nsIFrame * GetParent () const
- virtual nsresult SetParent (const nsIFrame *aParent)
- nsRect GetRect () const
- nsPoint GetPosition () const
- nsSize GetSize () const
- void SetRect (const nsRect &aRect)
- void SetPosition (const nsPoint &aPt)
- void SetSize (const nsSize &aSize)
- virtual nsresult GetAdditionalChildListName (PRInt32 aIndex, nsIAtom **aListName) const=0
- virtual nsresult FirstChild (nsIPresContext *aPresContext, nsIAtom *aListName, nsIFrame **aFirstChild) const=0
- nsIFrame * GetNextSibling () const
- void SetNextSibling (nsIFrame *aNextSibling)
- virtual nsresult Paint (nsIPresContext *aPresContext, nsIRenderingContext &aRenderingContext, const nsRect &aDirtyRect, nsFramePaintLayer aWhichLayer, PRUint32 aFlags=0)=0
- virtual PRBool CanPaintBackground ()
- virtual nsresult HandleEvent (nsIPresContext *aPresContext, nsGUIEvent *aEvent, nsEventStatus *aEventStatus)=0
- virtual nsresult GetContentForEvent (nsIPresContext *aPresContext, nsEvent *aEvent, nsIContent **aContent)=0
- virtual nsresult GetContentAndOffsetsFromPoint (nsIPresContext *aCX, const nsPoint &aPoint, nsIContent **aNewContent, PRInt32 &aContentOffset, PRInt32 &aContentOffsetEnd, PRBool &aBeginFrameContent)=0
- virtual nsresult GetCursor (nsIPresContext *aPresContext, nsPoint &aPoint, PRInt32 &aCursor)=0
- virtual nsresult GetFrameForPoint (nsIPresContext *aPresContext, const nsPoint &aPoint, nsFramePaintLayer aWhichLayer, nsIFrame **aFrame)=0
- virtual nsresult GetPointFromOffset (nsIPresContext *inPresContext, nsIRenderingContext *inRendContext, PRInt32 inOffset, nsPoint *outPoint)=0
- virtual nsresult GetChildFrameContainingOffset (PRInt32 inContentOffset, PRBool inHint, PRInt32 *outFrameContentOffset, nsIFrame **outChildFrame)=0
- nsFrameState GetStateBits () const
- void AddStateBits (nsFrameState aBits)
- void RemoveStateBits (nsFrameState aBits)
- virtual nsresult ContentChanged (nsIPresContext *aPresContext, nsIContent *aChild, nsISupports *aSubContent)=0
- virtual nsresult AttributeChanged (nsIPresContext *aPresContext, nsIContent *aChild, PRInt32 aNameSpaceID, nsIAtom *aAttribute, PRInt32 aModType)=0
- virtual nsresult IsSplittable (nsSplittableType &aIsSplittable) const=0
- virtual nsresult GetPrevInFlow (nsIFrame **aPrevInFlow) const=0
- virtual nsresult SetPrevInFlow (nsIFrame *)=0
- virtual nsresult GetNextInFlow (nsIFrame **aNextInFlow) const=0
- virtual nsresult SetNextInFlow (nsIFrame *)=0
- virtual nsIFrame * GetFirstInFlow () const
- virtual nsIFrame * GetLastInFlow () const
- virtual nsresult WillReflow (nsIPresContext *aPresContext)=0
- virtual nsresult Reflow (nsIPresContext *aPresContext, nsHTMLReflowMetrics &aReflowMetrics, const nsHTMLReflowState &aReflowState, nsReflowStatus &aStatus)=0
- virtual nsresult DidReflow (nsIPresContext *aPresContext, const nsHTMLReflowState *aReflowState, nsDidReflowStatus aStatus)=0
- virtual nsresult CanContinueTextRun (PRBool &aContinueTextRun) const=0
- virtual nsresult AdjustFrameSize (nscoord aExtraSpace, nscoord &aUsedSpace)=0
- virtual nsresult TrimTrailingWhiteSpace (nsIPresContext *aPresContext, nsIRenderingContext &aRC, nscoord &aDeltaWidth)=0
- PRBool HasView () const
- nsIView * GetView () const
- virtual nsIView * GetViewExternal () const
- nsresult SetView (nsIView *aView)
- nsIView * GetClosestView () const
- nsIFrame * GetAncestorWithView () const
- virtual nsIFrame * GetAncestorWithViewExternal () const
- virtual nsresult GetOffsetFromView (nsIPresContext *aPresContext, nsPoint &aOffset, nsIView **aView) const=0
- virtual nsresult GetOriginToViewOffset (nsIPresContext *aPresContext, nsPoint &aOffset, nsIView **aView) const=0
- virtual PRBool AreAncestorViewsVisible () const
- virtual nsIWidget * GetWindow () const
- virtual nsresult GetFrameType (nsIAtom **aType) const=0
- virtual nsresult IsPercentageBase (PRBool &aBase) const=0
- virtual nsresult SetSelected (nsIPresContext *aPresContext, nsIDOMRange *aRange, PRBool aSelected, nsSpread aSpread)=0
- virtual nsresult GetSelected (PRBool *aSelected) const=0
- virtual nsresult IsSelectable (PRBool *aIsSelectable, PRUint8 *aSelectStyle) const=0
- virtual nsresult GetSelectionController (nsIPresContext *aPresContext, nsISelectionController **aSelCon)=0
- virtual nsresult CaptureMouse (nsIPresContext *aPresContext, PRBool aGrabMouseEvents)=0
- virtual nsresult PeekOffset (nsIPresContext *aPresContext, nsPeekOffsetStruct *aPos)=0
- virtual nsresult CheckVisibility (nsIPresContext *aContext, PRInt32 aStartIndex, PRInt32 aEndIndex, PRBool aRecurse, PRBool *aFinished, PRBool *_retval)=0
- virtual nsresult ReflowDirtyChild (nsIPresShell *aPresShell, nsIFrame *aChild)=0
- virtual nsresult GetParentStyleContextFrame (nsIPresContext *aPresContext, nsIFrame **aProviderFrame, PRBool *aIsChild)=0
- virtual nsresult IsVisibleForPainting (nsIPresContext *aPresContext, nsIRenderingContext &aRenderingContext, PRBool aCheckVis, PRBool *aIsVisible)=0
- virtual nsresult IsEmpty (nsCompatibility aCompatMode, PRBool aIsPre, PRBool *aResult)=0
- PRBool IsGeneratedContentFrame ()
- PRBool IsPseudoFrame (nsIContent *aParentContent)
- virtual void * GetProperty (nsIPresContext *aPresContext, nsIAtom *aPropertyName, PRBool aRemoveProperty) const=0
- virtual nsresult SetProperty (nsIPresContext *aPresContext, nsIAtom *aPropertyName, void *aPropertyValue, NSFramePropertyDtorFunc aPropDtorFunc)=0
- virtual nsRect * GetOverflowAreaProperty (nsIPresContext *aPresContext, PRBool aCreateIfNecessary=0)=0
- virtual PRBool SupportsVisibilityHidden ()
- nsresult GetContent (nsIContent **aContent) const
- nsresult GetParent (nsIFrame **aParent) const
- nsresult GetRect (nsRect &aRect) const
- nsresult GetOrigin (nsPoint &aPoint) const
- nsresult GetSize (nsSize &aSize) const
- nsresult SetRect (nsIPresContext *aPresContext, const nsRect &aRect)
- nsresult MoveTo (nsIPresContext *aPresContext, nscoord aX, nscoord aY)
- nsresult SizeTo (nsIPresContext *aPresContext, nscoord aWidth, nscoord aHeight)
- nsresult GetNextSibling (nsIFrame **aNextSibling) const
- nsresult GetFrameState (nsFrameState *aResult)
- nsresult SetFrameState (nsFrameState aState)
- nsIView * GetView (nsIPresContext *aPresContext) const
- nsIView * GetViewExternal (nsIPresContext *aPresContext) const
- nsresult SetView (nsIPresContext *aPresContext, nsIView *aView)
- nsIView * GetClosestView (nsIPresContext *aPresContext) const
- nsresult GetParentWithView (nsIPresContext *aPresContext, nsIFrame **aParent) const
- PRBool AreAncestorViewsVisible (nsIPresContext *aPresContext) const
Protected Attributes
Member Function Documentation
| nsIPresContext* nsIFrame::GetPresContext |
( |
|
) |
const [inline] |
|
| virtual nsresult nsIFrame::Init |
( |
nsIPresContext * |
aPresContext, |
|
|
nsIContent * |
aContent, |
|
|
nsIFrame * |
aParent, |
|
|
nsStyleContext * |
aContext, |
|
|
nsIFrame * |
aPrevInFlow |
|
) |
[pure virtual] |
|
|
|
Called to initialize the frame. This is called immediately after creating the frame.
If the frame is a continuing frame, then aPrevInFlow indicates the previous frame (the frame that was split). You should connect the continuing frame to its prev-in-flow, e.g. by using the AppendToFlow() function
If you want a view associated with your frame, you should create the view now.
- Parameters:
-
| aContent | the content object associated with the frame |
| aGeometricParent | the geometric parent frame |
| aContentParent | the content parent frame |
| aContext | the style context associated with the frame |
| aPrevInFlow | the prev-in-flow frame |
- See also:
- #AppendToFlow()
Implemented in nsSVGGlyphFrame, nsSVGPathGeometryFrame, and nsFrame. |
| virtual nsresult nsIFrame::Destroy |
( |
nsIPresContext * |
aPresContext |
) |
[pure virtual] |
|
|
|
Destroys this frame and each of its child frames (recursively calls Destroy() for each child)
Implemented in nsFrame. |
| virtual void nsIFrame::RemovedAsPrimaryFrame |
( |
nsIPresContext * |
aPresContext |
) |
[inline, virtual] |
|
| virtual nsresult nsIFrame::SetInitialChildList |
( |
nsIPresContext * |
aPresContext, |
|
|
nsIAtom * |
aListName, |
|
|
nsIFrame * |
aChildList |
|
) |
[pure virtual] |
|
|
|
Called to set the initial list of frames. This happens after the frame has been initialized.
This is only called once for a given child list, and won't be called at all for child lists with no initial list of frames.
- Parameters:
-
| aListName | the name of the child list. A NULL pointer for the atom name means the unnamed principal child list |
| aChildList | list of child frames. Each of the frames has its NS_FRAME_IS_DIRTY bit set |
- Returns:
- NS_ERROR_INVALID_ARG if there is no child list with the specified name, NS_ERROR_UNEXPECTED if the frame is an atomic frame or if the initial list of frames has already been set for that child list, NS_OK otherwise
- See also:
- Init()
Implemented in nsFrame. |
| virtual nsresult nsIFrame::AppendFrames |
( |
nsIPresContext * |
aPresContext, |
|
|
nsIPresShell & |
aPresShell, |
|
|
nsIAtom * |
aListName, |
|
|
nsIFrame * |
aFrameList |
|
) |
[pure virtual] |
|
|
|
This method is responsible for appending frames to the frame list. The implementation should append the frames to the specified child list and then generate a reflow command.
- Parameters:
-
| aListName | the name of the child list. A NULL pointer for the atom name means the unnamed principal child list |
| aFrameList | list of child frames to append. Each of the frames has its NS_FRAME_IS_DIRTY bit set |
- Returns:
- NS_ERROR_INVALID_ARG if there is no child list with the specified name, NS_ERROR_UNEXPECTED if the frame is an atomic frame, NS_OK otherwise
Implemented in nsFrame. |
| virtual nsresult nsIFrame::InsertFrames |
( |
nsIPresContext * |
aPresContext, |
|
|
nsIPresShell & |
aPresShell, |
|
|
nsIAtom * |
aListName, |
|
|
nsIFrame * |
aPrevFrame, |
|
|
nsIFrame * |
aFrameList |
|
) |
[pure virtual] |
|
|
|
This method is responsible for inserting frames into the frame list. The implementation should insert the new frames into the specified child list and then generate a reflow command.
- Parameters:
-
| aListName | the name of the child list. A NULL pointer for the atom name means the unnamed principal child list |
| aPrevFrame | the frame to insert frames after |
| aFrameList | list of child frames to insert after aPrevFrame. Each of the frames has its NS_FRAME_IS_DIRTY bit set |
- Returns:
- NS_ERROR_INVALID_ARG if there is no child list with the specified name, NS_ERROR_UNEXPECTED if the frame is an atomic frame, NS_OK otherwise
Implemented in nsFrame. |
| virtual nsresult nsIFrame::RemoveFrame |
( |
nsIPresContext * |
aPresContext, |
|
|
nsIPresShell & |
aPresShell, |
|
|
nsIAtom * |
aListName, |
|
|
nsIFrame * |
aOldFrame |
|
) |
[pure virtual] |
|
|
|
This method is responsible for removing a frame in the frame list. The implementation should do something with the removed frame and then generate a reflow command. The implementation is responsible for destroying aOldFrame (the caller mustn't destroy aOldFrame).
- Parameters:
-
| aListName | the name of the child list. A NULL pointer for the atom name means the unnamed principal child list |
| aOldFrame | the frame to remove |
- Returns:
- NS_ERROR_INVALID_ARG if there is no child list with the specified name, NS_ERROR_FAILURE if the child frame is not in the specified child list, NS_ERROR_UNEXPECTED if the frame is an atomic frame, NS_OK otherwise
Implemented in nsFrame. |
| virtual nsresult nsIFrame::ReplaceFrame |
( |
nsIPresContext * |
aPresContext, |
|
|
nsIPresShell & |
aPresShell, |
|
|
nsIAtom * |
aListName, |
|
|
nsIFrame * |
aOldFrame, |
|
|
nsIFrame * |
aNewFrame |
|
) |
[pure virtual] |
|
|
|
This method is responsible for replacing the old frame with the new frame. The old frame should be destroyed and the new frame inserted in its place in the specified child list.
- Parameters:
-
| aListName | the name of the child list. A NULL pointer for the atom name means the unnamed principal child list |
| aOldFrame | the frame to remove |
| aNewFrame | the frame to replace it with. The new frame has its NS_FRAME_IS_DIRTY bit set |
- Returns:
- NS_ERROR_INVALID_ARG if there is no child list with the specified name, NS_ERROR_FAILURE if the old child frame is not in the specified child list, NS_ERROR_UNEXPECTED if the frame is an atomic frame, NS_OK otherwise
Implemented in nsFrame. |
| nsIContent* nsIFrame::GetContent |
( |
|
) |
const [inline] |
|
|
|
Get the content object associated with this frame. Does not add a reference.
Definition at line 555 of file nsIFrame.h.
References mContent. |
| virtual nsresult nsIFrame::GetOffsets |
( |
PRInt32 & |
start, |
|
|
PRInt32 & |
end |
|
) |
const [pure virtual] |
|
|
|
Get the offsets of the frame. most will be 0,0
Implemented in nsFrame. |
| virtual void nsIFrame::AdjustOffsetsForBidi |
( |
PRInt32 |
aStart, |
|
|
PRInt32 |
aEnd |
|
) |
[inline, virtual] |
|
|
|
Reset the offsets when splitting frames during Bidi reordering
Definition at line 567 of file nsIFrame.h. |
| nsStyleContext* nsIFrame::GetStyleContext |
( |
|
) |
const [inline] |
|
| void nsIFrame::SetStyleContext |
( |
nsIPresContext * |
aPresContext, |
|
|
nsStyleContext * |
aContext |
|
) |
[inline] |
|
| virtual nsresult nsIFrame::DidSetStyleContext |
( |
nsIPresContext * |
aPresContext |
) |
[pure virtual] |
|
| virtual const nsStyleStruct* nsIFrame::GetStyleDataExternal |
( |
nsStyleStructID |
aSID |
) |
const [pure virtual] |
|
|
|
Get the style data associated with this frame. This returns a const style struct pointer that should never be modified. See |nsIStyleContext::GetStyleData| for more information.
The use of the typesafe functions below is preferred to direct use of this function.
Implemented in nsFrame.
Referenced by GetStyleData(). |
| const nsStyleStruct* nsIFrame::GetStyleData |
( |
nsStyleStructID |
aSID |
) |
const [inline] |
|
| virtual nsresult nsIFrame::CalcBorderPadding |
( |
nsMargin & |
aBorderPadding |
) |
const [pure virtual] |
|
| virtual nsStyleContext* nsIFrame::GetAdditionalStyleContext |
( |
PRInt32 |
aIndex |
) |
const [pure virtual] |
|
|
|
These methods are to access any additional style contexts that the frame may be holding. These are contexts that are children of the frame's primary context and are NOT used as style contexts for any child frames. These contexts also MUST NOT have any child contexts whatsoever. If you need to insert style contexts into the style tree, then you should create pseudo element frames to own them The indicies must be consecutive and implementations MUST return an NS_ERROR_INVALID_ARG if asked for an index that is out of range.
Implemented in nsFrame. |
| virtual void nsIFrame::SetAdditionalStyleContext |
( |
PRInt32 |
aIndex, |
|
|
nsStyleContext * |
aStyleContext |
|
) |
[pure virtual] |
|
| nsIFrame* nsIFrame::GetParent |
( |
|
) |
const [inline] |
|
|
|
Accessor functions for geometric parent
Definition at line 647 of file nsIFrame.h.
References mParent. |
| virtual nsresult nsIFrame::SetParent |
( |
const nsIFrame * |
aParent |
) |
[inline, virtual] |
|
| nsRect nsIFrame::GetRect |
( |
|
) |
const [inline] |
|
|
|
Bounding rect of the frame. The values are in twips, and the origin is relative to the upper-left of the geometric parent. The size includes the content area, borders, and padding.
Note: moving or sizing the frame does not affect the view's size or position.
Definition at line 658 of file nsIFrame.h.
References mRect. |
| nsPoint nsIFrame::GetPosition |
( |
|
) |
const [inline] |
|
| nsSize nsIFrame::GetSize |
( |
|
) |
const [inline] |
|
| void nsIFrame::SetRect |
( |
const nsRect & |
aRect |
) |
[inline] |
|
| void nsIFrame::SetPosition |
( |
const nsPoint & |
aPt |
) |
[inline] |
|
| void nsIFrame::SetSize |
( |
const nsSize & |
aSize |
) |
[inline] |
|
| virtual nsresult nsIFrame::GetAdditionalChildListName |
( |
PRInt32 |
aIndex, |
|
|
nsIAtom ** |
aListName |
|
) |
const [pure virtual] |
|
|
|
Used to iterate the list of additional child list names. Returns the atom name for the additional child list at the specified 0-based index, or a NULL pointer if there are no more named child lists.
Note that the list is only the additional named child lists and does not include the unnamed principal child list.
- Returns:
- NS_ERROR_INVALID_ARG if the index is < 0 and NS_OK otherwise
Implemented in nsFrame. |
| virtual nsresult nsIFrame::FirstChild |
( |
nsIPresContext * |
aPresContext, |
|
|
nsIAtom * |
aListName, |
|
|
nsIFrame ** |
aFirstChild |
|
) |
const [pure virtual] |
|
|
|
Get the first child frame from the specified child list.
- Parameters:
-
| aListName | the name of the child list. A NULL pointer for the atom name means the unnamed principal child list |
- Returns:
- NS_ERROR_INVALID_ARG if there is no child list with the specified name
- See also:
- #GetAdditionalListName()
Implemented in nsFrame. |
| nsIFrame* nsIFrame::GetNextSibling |
( |
|
) |
const [inline] |
|
| void nsIFrame::SetNextSibling |
( |
nsIFrame * |
aNextSibling |
) |
[inline] |
|
| virtual nsresult nsIFrame::Paint |
( |
nsIPresContext * |
aPresContext, |
|
|
nsIRenderingContext & |
aRenderingContext, |
|
|
const nsRect & |
aDirtyRect, |
|
|
nsFramePaintLayer |
aWhichLayer, |
|
|
PRUint32 |
aFlags = 0 |
|
) |
[pure virtual] |
|
|
|
Paint is responsible for painting the frame. The aWhichLayer argument indicates which layer of painting should be done during the call.
Implemented in nsFrame. |
| virtual PRBool nsIFrame::CanPaintBackground |
( |
|
) |
[inline, virtual] |
|
| virtual nsresult nsIFrame::HandleEvent |
( |
nsIPresContext * |
aPresContext, |
|
|
nsGUIEvent * |
aEvent, |
|
|
nsEventStatus * |
aEventStatus |
|
) |
[pure virtual] |
|
|
|
Event handling of GUI events.
- Parameters:
-
| aEvent | event structure describing the type of event and rge widget where the event originated |
| aEventStatus | a return value indicating whether the event was handled and whether default processing should be done |
XXX From a frame's perspective it's unclear what the effect of the event status is. Does it cause the event to continue propagating through the frame hierarchy or is it just returned to the widgets?
- See also:
- nsGUIEvent
nsEventStatus
Implemented in nsFrame. |
| virtual nsresult nsIFrame::GetContentForEvent |
( |
nsIPresContext * |
aPresContext, |
|
|
nsEvent * |
aEvent, |
|
|
nsIContent ** |
aContent |
|
) |
[pure virtual] |
|
| virtual nsresult nsIFrame::GetContentAndOffsetsFromPoint |
( |
nsIPresContext * |
aCX, |
|
|
const nsPoint & |
aPoint, |
|
|
nsIContent ** |
aNewContent, |
|
|
PRInt32 & |
aContentOffset, |
|
|
PRInt32 & |
aContentOffsetEnd, |
|
|
PRBool & |
aBeginFrameContent |
|
) |
[pure virtual] |
|
| virtual nsresult nsIFrame::GetCursor |
( |
nsIPresContext * |
aPresContext, |
|
|
nsPoint & |
aPoint, |
|
|
PRInt32 & |
aCursor |
|
) |
[pure virtual] |
|
|
|
Get the cursor for a given frame.
Implemented in nsFrame. |
| virtual nsresult nsIFrame::GetFrameForPoint |
( |
nsIPresContext * |
aPresContext, |
|
|
const nsPoint & |
aPoint, |
|
|
nsFramePaintLayer |
aWhichLayer, |
|
|
nsIFrame ** |
aFrame |
|
) |
[pure virtual] |
|
|
|
Get the frame that should receive events for a given point in the coordinate space of this frame's parent, if the frame is painted in the given paint layer. A frame should return itself if it should recieve the events. A successful return value indicates that a point was found.
Implemented in nsFrame. |
| virtual nsresult nsIFrame::GetPointFromOffset |
( |
nsIPresContext * |
inPresContext, |
|
|
nsIRenderingContext * |
inRendContext, |
|
|
PRInt32 |
inOffset, |
|
|
nsPoint * |
outPoint |
|
) |
[pure virtual] |
|
|
|
Get a point (in the frame's coordinate space) given an offset into the content. This point should be on the baseline of text with the correct horizontal offset
Implemented in nsFrame. |
| virtual nsresult nsIFrame::GetChildFrameContainingOffset |
( |
PRInt32 |
inContentOffset, |
|
|
PRBool |
inHint, |
|
|
PRInt32 * |
outFrameContentOffset, |
|
|
nsIFrame ** |
outChildFrame |
|
) |
[pure virtual] |
|
|
|
Get the child frame of this frame which contains the given content offset. outChildFrame may be this frame, or nsnull on return. outContentOffset returns the content offset relative to the start of the returned node. You can also pass a hint which tells the method to stick to the end of the first found frame or the beginning of the next in case the offset falls on a boundary.
Implemented in nsFrame. |
|
|
Get the current frame-state value for this frame. aResult is filled in with the state bits.
Definition at line 791 of file nsIFrame.h.
References mState, and nsFrameState. |
|
|
Update the current frame-state value for this frame.
Definition at line 796 of file nsIFrame.h.
References mState. |
| void nsIFrame::RemoveStateBits |
( |
nsFrameState |
aBits |
) |
[inline] |
|
| virtual nsresult nsIFrame::ContentChanged |
( |
nsIPresContext * |
aPresContext, |
|
|
nsIContent * |
aChild, |
|
|
nsISupports * |
aSubContent |
|
) |
[pure virtual] |
|
|
|
This call is invoked when content is changed in the content tree. The first frame that maps that content is asked to deal with the change by generating an incremental reflow command.
- Parameters:
-
| aPresContext | the presentation context |
| aContent | the content node that was changed |
| aSubContent | a hint to the frame about the change |
Implemented in nsSVGGlyphFrame, and nsFrame. |
| virtual nsresult nsIFrame::AttributeChanged |
( |
nsIPresContext * |
aPresContext, |
|
|
nsIContent * |
aChild, |
|
|
PRInt32 |
aNameSpaceID, |
|
|
nsIAtom * |
aAttribute, |
|
|
PRInt32 |
aModType |
|
) |
[pure virtual] |
|
|
|
This call is invoked when the value of a content objects's attribute is changed. The first frame that maps that content is asked to deal with the change by doing whatever is appropriate.
- Parameters:
-
| aChild | the content object |
| aAttribute | the attribute whose value changed |
| aHint | the level of change that has already been dealt with |
Implemented in nsFrame. |
| virtual nsresult nsIFrame::IsSplittable |
( |
nsSplittableType & |
aIsSplittable |
) |
const [pure virtual] |
|
|
|
Return how your frame can be split.
Implemented in nsFrame. |
| virtual nsresult nsIFrame::GetPrevInFlow |
( |
nsIFrame ** |
aPrevInFlow |
) |
const [pure virtual] |
|
|
|
Flow member functions
Implemented in nsFrame. |
| virtual nsresult nsIFrame::SetPrevInFlow |
( |
nsIFrame * |
|
) |
[pure virtual] |
|
| virtual nsresult nsIFrame::GetNextInFlow |
( |
nsIFrame ** |
aNextInFlow |
) |
const [pure virtual] |
|
| virtual nsresult nsIFrame::SetNextInFlow |
( |
nsIFrame * |
|
) |
[pure virtual] |
|
| virtual nsIFrame* nsIFrame::GetFirstInFlow |
( |
|
) |
const [inline, virtual] |
|
|
|
Return the first frame in our current flow.
Definition at line 844 of file nsIFrame.h. |
| virtual nsIFrame* nsIFrame::GetLastInFlow |
( |
|
) |
const [inline, virtual] |
|
|
|
Return the last frame in our current flow.
Definition at line 851 of file nsIFrame.h. |
| virtual nsresult nsIFrame::WillReflow |
( |
nsIPresContext * |
aPresContext |
) |
[pure virtual] |
|
|
|
Pre-reflow hook. Before a frame is reflowed this method will be called. This call will always be invoked at least once before a subsequent Reflow and DidReflow call. It may be called more than once, In general you will receive on WillReflow notification before each Reflow request.
XXX Is this really the semantics we want? Because we have the NS_FRAME_IN_REFLOW bit we can ensure we don't call it more than once...
Implemented in nsFrame. |
| virtual nsresult nsIFrame::Reflow |
( |
nsIPresContext * |
aPresContext, |
|
|
nsHTMLReflowMetrics & |
aReflowMetrics, |
|
|
const nsHTMLReflowState & |
aReflowState, |
|
|
nsReflowStatus & |
aStatus |
|
) |
[pure virtual] |
|
|
|
The frame is given a maximum size and asked for its desired size. This is the frame's opportunity to reflow its children.
- Parameters:
-
| aDesiredSize | out parameter where you should return the desired size and ascent/descent info. You should include any space you want for border/padding in the desired size you return. |
It's okay to return a desired size that exceeds the max size if that's the smallest you can be, i.e. it's your minimum size.
maxElementSize is an optional parameter for returning your maximum element size. If may be null in which case you don't have to compute a maximum element size. The maximum element size must be less than or equal to your desired size.
For an incremental reflow you are responsible for invalidating any area within your frame that needs repainting (including borders). If your new desired size is different than your current size, then your parent frame is responsible for making sure that the difference between the two rects is repainted
- Parameters:
-
| aReflowState | information about your reflow including the reason for the reflow and the available space in which to lay out. Each dimension of the available space can either be constrained or unconstrained (a value of NS_UNCONSTRAINEDSIZE). If constrained you should choose a value that's less than or equal to the constrained size. If unconstrained you can choose as large a value as you like. |
Note that the available space can be negative. In this case you still must return an accurate desired size. If you're a container you must always reflow at least one frame regardless of the available space
- Parameters:
-
| aStatus | a return value indicating whether the frame is complete and whether the next-in-flow is dirty and needs to be reflowed |
Implemented in nsFrame. |
| virtual nsresult nsIFrame::DidReflow |
( |
nsIPresContext * |
aPresContext, |
|
|
const nsHTMLReflowState * |
aReflowState, |
|
|
nsDidReflowStatus |
aStatus |
|
) |
[pure virtual] |
|
|
|
Post-reflow hook. After a frame is reflowed this method will be called informing the frame that this reflow process is complete, and telling the frame the status returned by the Reflow member function.
This call may be invoked many times, while NS_FRAME_IN_REFLOW is set, before it is finally called once with a NS_FRAME_REFLOW_COMPLETE value. When called with a NS_FRAME_REFLOW_COMPLETE value the NS_FRAME_IN_REFLOW bit in the frame state will be cleared.
XXX This doesn't make sense. If the frame is reflowed but not complete, then the status should be NS_FRAME_NOT_COMPLETE and not NS_FRAME_COMPLETE XXX Don't we want the semantics to dictate that we only call this once for a given reflow?
Implemented in nsFrame. |
| virtual nsresult nsIFrame::CanContinueTextRun |
( |
PRBool & |
aContinueTextRun |
) |
const [pure virtual] |
|
|
|
Helper method used by block reflow to identify runs of text so that proper word-breaking can be done.
- Parameters:
-
| aContinueTextRun | A frame should set aContinueTextRun to PR_TRUE if we can continue a "text run" through the frame. A text run is text that should be treated contiguously for line and word breaking. |
- Returns:
- The return value is irrelevant.
Implemented in nsFrame. |
| virtual nsresult nsIFrame::AdjustFrameSize |
( |
nscoord |
aExtraSpace, |
|
|
nscoord & |
aUsedSpace |
|
) |
[pure virtual] |
|
| virtual nsresult nsIFrame::TrimTrailingWhiteSpace |
( |
nsIPresContext * |
aPresContext, |
|
|
nsIRenderingContext & |
aRC, |
|
|
nscoord & |
aDeltaWidth |
|
) |
[pure virtual] |
|
| PRBool nsIFrame::HasView |
( |
|
) |
const [inline] |
|
|
|
Accessor functions to get/set the associated view object
GetView returns non-null if and only if |HasView| returns true.
Definition at line 961 of file nsIFrame.h.
References mState, and NS_FRAME_HAS_VIEW. |
| nsIView* nsIFrame::GetView |
( |
|
) |
const |
|
| virtual nsIView* nsIFrame::GetViewExternal |
( |
|
) |
const [virtual] |
|
| nsresult nsIFrame::SetView |
( |
nsIView * |
aView |
) |
|
|
| nsIView* nsIFrame::GetClosestView |
( |
|
) |
const |
|
|
|
Find the closest view (on |this| or an ancestor).
Referenced by GetClosestView(). |
| nsIFrame* nsIFrame::GetAncestorWithView |
( |
|
) |
const |
|
|
|
Find the closest ancestor (excluding |this| !) that has a view |
| virtual nsIFrame* nsIFrame::GetAncestorWithViewExternal |
( |
|
) |
const [virtual] |
|
| virtual nsresult nsIFrame::GetOffsetFromView |
( |
nsIPresContext * |
aPresContext, |
|
|
nsPoint & |
aOffset, |
|
|
nsIView ** |
aView |
|
) |
const [pure virtual] |
|
|
|
Returns the offset from this frame to the closest geometric parent that has a view. Also returns the containing view or null in case of error
Implemented in nsFrame. |
| virtual nsresult nsIFrame::GetOriginToViewOffset |
( |
nsIPresContext * |
aPresContext, |
|
|
nsPoint & |
aOffset, |
|
|
nsIView ** |
aView |
|
) |
const [pure virtual] |
|
|
|
Returns the offset from this frame's upper left corner to the upper left corner of the view returned by a call to GetView(). aOffset will contain the offset to the view or (0,0) if the frame has no view. aView will contain a pointer to the view returned by GetView(). aView is optional, that is, you may pass null if you are not interested in getting a pointer to the view.
Implemented in nsFrame. |
| virtual PRBool nsIFrame::AreAncestorViewsVisible |
( |
|
) |
const [virtual] |
|
|
|
Returns true if and only if all views, from |GetClosestView| up to the top of the view hierarchy are visible.
Referenced by AreAncestorViewsVisible(). |
| virtual nsIWidget* nsIFrame::GetWindow |
( |
|
) |
const [virtual] |
|
|
|
Returns the window that contains this frame. If this frame has a view and the view has a window, then this frames window is returned, otherwise this frame's geometric parent is checked recursively upwards. |
| virtual nsresult nsIFrame::GetFrameType |
( |
nsIAtom ** |
aType |
) |
const [pure virtual] |
|
|
|
Get the "type" of the frame. May return a NULL atom pointer
- See also:
- nsLayoutAtoms
Implemented in nsFrame. |
| virtual nsresult nsIFrame::IsPercentageBase |
( |
PRBool & |
aBase |
) |
const [pure virtual] |
|
|
|
Is this frame a "containing block"?
Implemented in nsFrame. |
| virtual nsresult nsIFrame::SetSelected |
( |
nsIPresContext * |
aPresContext, |
|
|
nsIDOMRange * |
aRange, |
|
|
PRBool |
aSelected, |
|
|
nsSpread |
aSpread |
|
) |
[pure virtual] |
|
|
|
Called to set the selection of the frame based on frame offsets. you can FORCE the frame to redraw event if aSelected == the frame selection with the last parameter. data in struct may be changed when passed in. - Parameters:
-
| aRange | is the range that will dictate if the frames need to be redrawn null means the whole content needs to be redrawn |
| aSelected | is it selected? |
| aSpread | should it spread the selection to flow elements around it? or go down to its children? |
Implemented in nsSVGGlyphFrame, and nsFrame. |
| virtual nsresult nsIFrame::GetSelected |
( |
PRBool * |
aSelected |
) |
const [pure virtual] |
|
| virtual nsresult nsIFrame::IsSelectable |
( |
PRBool * |
aIsSelectable, |
|
|
PRUint8 * |
aSelectStyle |
|
) |
const [pure virtual] |
|
|
|
called to discover where this frame, or a parent frame has user-select style applied, which affects that way that it is selected.
- Parameters:
-
| aIsSelectable | out param. Set to true if the frame can be selected (i.e. is not affected by user-select: none) |
| aSelectStyle | out param. Returns the type of selection style found (using values defined in nsStyleConsts.h). |
Implemented in nsFrame. |
| virtual nsresult nsIFrame::GetSelectionController |
( |
nsIPresContext * |
aPresContext, |
|
|
nsISelectionController ** |
aSelCon |
|
) |
[pure virtual] |
|
|
|
Called to retrieve the SelectionController associated with the frame. - Parameters:
-
| aSelCon | will contain the selection controller associated with the frame. |
Implemented in nsFrame. |
| virtual nsresult nsIFrame::CaptureMouse |
( |
nsIPresContext * |
aPresContext, |
|
|
PRBool |
aGrabMouseEvents |
|
) |
[pure virtual] |
|
|
|
Call to turn on/off mouseCapture at the view level. Needed by the ESM so it must be in the public interface. - Parameters:
-
| aPresContext | presContext associated with the frame |
| aGrabMouseEvents | PR_TRUE to enable capture, PR_FALSE to disable |
Implemented in nsFrame. |
| virtual nsresult nsIFrame::PeekOffset |
( |
nsIPresContext * |
aPresContext, |
|
|
nsPeekOffsetStruct * |
aPos |
|
) |
[pure virtual] |
|
|
|
called to find the previous/next character, word, or line returns the actual nsIFrame and the frame offset. THIS DOES NOT CHANGE SELECTION STATE uses frame's begin selection state to start. if no selection on this frame will return NS_ERROR_FAILURE - Parameters:
-
| aPOS | is defined in nsIFrameSelection |
Implemented in nsFrame. |
| virtual nsresult nsIFrame::CheckVisibility |
( |
nsIPresContext * |
aContext, |
|
|
PRInt32 |
aStartIndex, |
|
|
PRInt32 |
aEndIndex, |
|
|
PRBool |
aRecurse, |
|
|
PRBool * |
aFinished, |
|
|
PRBool * |
_retval |
|
) |
[pure virtual] |
|
|
|
called to see if the children of the frame are visible from indexstart to index end. this does not change any state. returns PR_TRUE only if the indexes are valid and any of the children are visible. for textframes this index is the character index. if aStart = aEnd result will be PR_FALSE - Parameters:
-
| aStart | start index of first child from 0-N (number of children) |
| aEnd | end index of last child from 0-N |
| aRecurse | should this frame talk to siblings to get to the contents other children? |
| aFinished | did this frame have the aEndIndex? or is there more work to do |
| _retval | return value true or false. false = range is not rendered. |
Implemented in nsFrame. |
| virtual nsresult nsIFrame::ReflowDirtyChild |
( |
nsIPresShell * |
aPresShell, |
|
|
nsIFrame * |
aChild |
|
) |
[pure virtual] |
|
|
|
Called by a child frame on a parent frame to tell the parent frame that the child needs to be reflowed. The parent should either propagate the request to its parent frame or handle the request by generating a eReflowType_ReflowDirtyChildren reflow command.
Implemented in nsFrame. |
| virtual nsresult nsIFrame::GetParentStyleContextFrame |
( |
nsIPresContext * |
aPresContext, |
|
|
nsIFrame ** |
aProviderFrame, |
|
|
PRBool * |
aIsChild |
|
) |
[pure virtual] |
|
|
|
Get the frame whose style context should be the parent of this frame's style context (i.e., provide the parent style context). This frame must either be an ancestor of this frame or a child. If this frame returns a child frame, then the child frame must be sure to return a grandparent or higher!
- Parameters:
-
| aPresContext: | PresContext |
| aProviderFrame: | The frame whose style context should be the parent of this frame's style context. Null is permitted, and means that this frame's style context should be the root of the style context tree. < |
|