Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions
nsIFrameSelection Class Reference

#include <nsIFrameSelection.h>

Inheritance diagram for nsIFrameSelection:
Inheritance graph
[legend]
Collaboration diagram for nsIFrameSelection:
Collaboration graph
[legend]

List of all members.

Public Types

enum  HINT { HINTLEFT = 0, HINTRIGHT = 1 }

Public Member Functions

NS_IMETHOD Init (nsIPresShell *aShell, nsIContent *aLimiter)=0
 Init will initialize the frame selector with the necessary pres shell to be used by most of the methods.
NS_IMETHOD SetScrollableView (nsIScrollableView *aScrollView)=0
NS_IMETHOD GetScrollableView (nsIScrollableView **aScrollView)=0
NS_IMETHOD ShutDown ()=0
 ShutDown will be called when the owner of the frame selection is shutting down this should be the time to release all member variable interfaces.
NS_IMETHOD HandleTextEvent (nsGUIEvent *aGuiEvent)=0
 HandleKeyEvent will accept an event.
NS_IMETHOD HandleKeyEvent (nsPresContext *aPresContext, nsGUIEvent *aGuiEvent)=0
 HandleKeyEvent will accept an event and a PresContext.
NS_IMETHOD HandleClick (nsIContent *aNewFocus, PRUint32 aContentOffset, PRUint32 aContentEndOffset, PRBool aContinueSelection, PRBool aMultipleSelection, PRBool aHint)=0
 HandleClick will take the focus to the new frame at the new offset and will either extend the selection from the old anchor, or replace the old anchor.
NS_IMETHOD HandleDrag (nsPresContext *aPresContext, nsIFrame *aFrame, nsPoint &aPoint)=0
 HandleDrag extends the selection to contain the frame closest to aPoint.
NS_IMETHOD HandleTableSelection (nsIContent *aParentContent, PRInt32 aContentOffset, PRInt32 aTarget, nsMouseEvent *aMouseEvent)=0
 HandleTableSelection will set selection to a table, cell, etc depending on information contained in aFlags.
NS_IMETHOD StartAutoScrollTimer (nsPresContext *aPresContext, nsIView *aFrame, nsPoint &aPoint, PRUint32 aDelay)=0
 StartAutoScrollTimer is responsible for scrolling views so that aPoint is always visible, and for selecting any frame that contains aPoint.
NS_IMETHOD StopAutoScrollTimer ()=0
 StopAutoScrollTimer stops any active auto scroll timer.
NS_IMETHOD EnableFrameNotification (PRBool aEnable)=0
 EnableFrameNotification mutch like start batching, except all dirty calls are ignored.
NS_IMETHOD LookUpSelection (nsIContent *aContent, PRInt32 aContentOffset, PRInt32 aContentLength, SelectionDetails **aReturnDetails, PRBool aSlowCheck)=0
 Lookup Selection returns in frame coordinates the selection beginning and ending with the type of selection given.
NS_IMETHOD SetMouseDownState (PRBool aState)=0
 SetMouseDownState(PRBool); sets the mouse state to aState for resons of drag state.
NS_IMETHOD GetMouseDownState (PRBool *aState)=0
 GetMouseDownState(PRBool *); gets the mouse state to aState for resons of drag state.
NS_IMETHOD GetTableCellSelection (PRBool *aState)=0
 if we are in table cell selection mode.
NS_IMETHOD GetSelection (SelectionType aSelectionType, nsISelection **aSelection)=0
 GetSelection no query interface for selection.
NS_IMETHOD ScrollSelectionIntoView (SelectionType aSelectionType, SelectionRegion aRegion, PRBool aIsSynchronous)=0
 ScrollSelectionIntoView scrolls a region of the selection, so that it is visible in the scrolled view.
NS_IMETHOD RepaintSelection (nsPresContext *aPresContext, SelectionType aSelectionType)=0
 RepaintSelection repaints the selected frames that are inside the selection specified by aSelectionType.
NS_IMETHOD GetFrameForNodeOffset (nsIContent *aNode, PRInt32 aOffset, HINT aHint, nsIFrame **aReturnFrame, PRInt32 *aReturnOffset)=0
 GetFrameForNodeOffset given a node and its child offset, return the nsIFrame and the offset into that frame.
NS_IMETHOD AdjustOffsetsFromStyle (nsIFrame *aFrame, PRBool *changeSelection, nsIContent **outContent, PRInt32 *outStartOffset, PRInt32 *outEndOffset)=0
 AdjustOffsetsFromStyle.
NS_IMETHOD GetHint (HINT *aHint)=0
NS_IMETHOD SetHint (HINT aHint)=0
NS_IMETHOD CharacterMove (PRBool aForward, PRBool aExtend)=0
 CharacterMove will generally be called from the nsiselectioncontroller implementations.
NS_IMETHOD WordMove (PRBool aForward, PRBool aExtend)=0
 WordMove will generally be called from the nsiselectioncontroller implementations.
NS_IMETHOD LineMove (PRBool aForward, PRBool aExtend)=0
 LineMove will generally be called from the nsiselectioncontroller implementations.
NS_IMETHOD IntraLineMove (PRBool aForward, PRBool aExtend)=0
 IntraLineMove will generally be called from the nsiselectioncontroller implementations.
NS_IMETHOD CommonPageMove (PRBool aForward, PRBool aExtend, nsIScrollableView *aScrollableView, nsIFrameSelection *aFrameSel)=0
 Scrolling then moving caret placement code in common to text areas and content areas should be located in the implementer This method will accept the following parameters and perform the scroll and caret movement.
NS_IMETHOD SelectAll ()=0
 Select All will generally be called from the nsiselectioncontroller implementations.
NS_IMETHOD SetDisplaySelection (PRInt16 aState)=0
 Sets/Gets The display selection enum.
NS_IMETHOD GetDisplaySelection (PRInt16 *aState)=0
NS_IMETHOD SetDelayCaretOverExistingSelection (PRBool aDelay)=0
 Allow applications to specify how we should place the caret when the user clicks over an existing selection.
NS_IMETHOD GetDelayCaretOverExistingSelection (PRBool *aDelay)=0
 Get the current delay caret setting.
NS_IMETHOD SetDelayedCaretData (nsMouseEvent *aMouseEvent)=0
 If we are delaying caret placement til MouseUp (see Set/GetDelayCaretOverExistingSelection()), this method can be used to store the data received during the MouseDown so that we can place the caret during the MouseUp event.
NS_IMETHOD GetDelayedCaretData (nsMouseEvent **aMouseEvent)=0
 Get the delayed MouseDown event data necessary to place the caret during MouseUp processing.
NS_IMETHOD GetLimiter (nsIContent **aLimiterContent)=0
 Get the content node that limits the selection When searching up a nodes for parents, as in a text edit field in an browser page, we must stop at this node else we reach into the parent page, which is very bad!
NS_IMETHOD SetMouseDoubleDown (PRBool aDoubleDown)=0
 This will tell the frame selection that a double click has been pressed so it can track abort future drags if inside the same selection has the double click down happened.
NS_IMETHOD GetMouseDoubleDown (PRBool *aDoubleDown)=0
 This will return whether the double down flag was set.
NS_IMETHOD MaintainSelection ()=0
 MaintainSelection will track the current selection as being "sticky".

Detailed Description

Definition at line 132 of file nsIFrameSelection.h.


Member Enumeration Documentation

Enumerator:
HINTLEFT 
HINTRIGHT 

Definition at line 135 of file nsIFrameSelection.h.

{ HINTLEFT = 0, HINTRIGHT = 1};  //end of this line or beginning of next

Member Function Documentation

NS_IMETHOD nsIFrameSelection::AdjustOffsetsFromStyle ( nsIFrame aFrame,
PRBool changeSelection,
nsIContent **  outContent,
PRInt32 outStartOffset,
PRInt32 outEndOffset 
) [pure virtual]

AdjustOffsetsFromStyle.

Called after detecting that a click or drag will select the frame, this function looks for user-select style on that frame or a parent frame, and adjust the content and offsets accordingly.

Parameters:
aFramethe frame that was clicked
outContentcontent node to be selected
outStartOffsetselection start offset
outEndOffsetselection end offset

Implemented in nsTextInputSelectionImpl, and nsSelection.

NS_IMETHOD nsIFrameSelection::CharacterMove ( PRBool  aForward,
PRBool  aExtend 
) [pure virtual]

CharacterMove will generally be called from the nsiselectioncontroller implementations.

the effect being the selection will move one character left or right.

Parameters:
aForwardmove forward in document.
aExtendcontinue selection

Implemented in nsTextInputSelectionImpl, and nsSelection.

NS_IMETHOD nsIFrameSelection::CommonPageMove ( PRBool  aForward,
PRBool  aExtend,
nsIScrollableView aScrollableView,
nsIFrameSelection aFrameSel 
) [pure virtual]

Scrolling then moving caret placement code in common to text areas and content areas should be located in the implementer This method will accept the following parameters and perform the scroll and caret movement.

It remains for the caller to call the final ScrollCaretIntoView if that called wants to be sure the caret is always visible.

Parameters:
aForwardif PR_TRUE, scroll forward if not scroll backward
aExtendif PR_TRUE, extend selection to the new point
aScrollableViewthe view that needs the scrolling
aFrameSelthe nsIFrameSelection of the caller.
Returns:
always NS_OK

Implemented in nsTextInputSelectionImpl, and nsSelection.

EnableFrameNotification mutch like start batching, except all dirty calls are ignored.

no notifications will go out until enableNotifications with a PR_TRUE is called

Implemented in nsTextInputSelectionImpl, and nsSelection.

Get the current delay caret setting.

If aDelay contains a return value of PR_TRUE, the caret is placed on MouseUp when clicking over an existing selection. If PR_FALSE, the selection is cleared and caret is placed immediately in all cases.

Parameters:
aDelaywill contain the return value.

Implemented in nsTextInputSelectionImpl, and nsSelection.

Get the delayed MouseDown event data necessary to place the caret during MouseUp processing.

will contain a pointer to the event received by the selection during MouseDown processing. It can be NULL if the data is no longer valid.

Implemented in nsTextInputSelectionImpl, and nsSelection.

Here is the caller graph for this function:

Implemented in nsTextInputSelectionImpl, and nsSelection.

NS_IMETHOD nsIFrameSelection::GetFrameForNodeOffset ( nsIContent aNode,
PRInt32  aOffset,
HINT  aHint,
nsIFrame **  aReturnFrame,
PRInt32 aReturnOffset 
) [pure virtual]

GetFrameForNodeOffset given a node and its child offset, return the nsIFrame and the offset into that frame.

Parameters:
aNodeinput parameter for the node to look at
aOffsetoffset into above node.
aReturnFramewill contain the return frame. MUST NOT BE NULL or will return error
aReturnOffsetwill contain offset into frame.

Implemented in nsTextInputSelectionImpl, and nsSelection.

NS_IMETHOD nsIFrameSelection::GetHint ( HINT aHint) [pure virtual]

Implemented in nsTextInputSelectionImpl, and nsSelection.

NS_IMETHOD nsIFrameSelection::GetLimiter ( nsIContent **  aLimiterContent) [pure virtual]

Get the content node that limits the selection When searching up a nodes for parents, as in a text edit field in an browser page, we must stop at this node else we reach into the parent page, which is very bad!

Implemented in nsTextInputSelectionImpl, and nsSelection.

Here is the caller graph for this function:

NS_IMETHOD nsIFrameSelection::GetMouseDoubleDown ( PRBool aDoubleDown) [pure virtual]

This will return whether the double down flag was set.

is the return boolean value

Implemented in nsTextInputSelectionImpl, and nsSelection.

GetMouseDownState(PRBool *); gets the mouse state to aState for resons of drag state.

Parameters:
aStatewill hold the state of mousedown

Implemented in nsTextInputSelectionImpl, and nsSelection.

Implemented in nsTextInputSelectionImpl, and nsSelection.

NS_IMETHOD nsIFrameSelection::GetSelection ( SelectionType  aSelectionType,
nsISelection **  aSelection 
) [pure virtual]

GetSelection no query interface for selection.

must use this method now.

Parameters:
aSelectionTypeenum value defined in nsISelection for the seleciton you want.

Implemented in nsTextInputSelectionImpl, and nsSelection.

Here is the caller graph for this function:

if we are in table cell selection mode.

aka ctrl click in table cell

Implemented in nsTextInputSelectionImpl, and nsSelection.

Here is the caller graph for this function:

NS_IMETHOD nsIFrameSelection::HandleClick ( nsIContent aNewFocus,
PRUint32  aContentOffset,
PRUint32  aContentEndOffset,
PRBool  aContinueSelection,
PRBool  aMultipleSelection,
PRBool  aHint 
) [pure virtual]

HandleClick will take the focus to the new frame at the new offset and will either extend the selection from the old anchor, or replace the old anchor.

the old anchor and focus position may also be used to deselect things

Parameters:
aNewfocusis the content that wants the focus
aContentOffsetis the content offset of the parent aNewFocus
aContentOffsetEndis the content offset of the parent aNewFocus and is specified different when you need to select to and include both start and end points
aContinueSelectionis the flag that tells the selection to keep the old anchor point or not.
aMultipleSelectionwill tell the frame selector to replace /or not the old selection. cannot coexist with aContinueSelection
aHintwill tell the selection which direction geometrically to actually show the caret on. 1 = end of this line 0 = beggining of this line

Implemented in nsTextInputSelectionImpl, and nsSelection.

Here is the caller graph for this function:

NS_IMETHOD nsIFrameSelection::HandleDrag ( nsPresContext aPresContext,
nsIFrame aFrame,
nsPoint aPoint 
) [pure virtual]

HandleDrag extends the selection to contain the frame closest to aPoint.

Parameters:
aPresContextis the context to use when figuring out what frame contains the point.
aFrameis the parent of all frames to use when searching for the closest frame to the point.
aPointis relative to aFrame's parent view.

Implemented in nsTextInputSelectionImpl, and nsSelection.

NS_IMETHOD nsIFrameSelection::HandleKeyEvent ( nsPresContext aPresContext,
nsGUIEvent aGuiEvent 
) [pure virtual]

HandleKeyEvent will accept an event and a PresContext.

DOES NOT ADDREF

Parameters:
aGuiEventis the event that should be dealt with by aFocusFrame
aFrameis the frame that MAY handle the event

Implemented in nsTextInputSelectionImpl, and nsSelection.

NS_IMETHOD nsIFrameSelection::HandleTableSelection ( nsIContent aParentContent,
PRInt32  aContentOffset,
PRInt32  aTarget,
nsMouseEvent aMouseEvent 
) [pure virtual]

HandleTableSelection will set selection to a table, cell, etc depending on information contained in aFlags.

Parameters:
aParentContentis the paretent of either a table or cell that user clicked or dragged the mouse in
aContentOffsetis the offset of the table or cell
aTargetindicates what to select (defined in nsISelectionPrivate.idl/nsISelectionPrivate.h): TABLESELECTION_CELL We should select a cell (content points to the cell) TABLESELECTION_ROW We should select a row (content points to any cell in row) TABLESELECTION_COLUMN We should select a row (content points to any cell in column) TABLESELECTION_TABLE We should select a table (content points to the table) TABLESELECTION_ALLCELLS We should select all cells (content points to any cell in table)
aMouseEventpassed in so we we can get where event occured and what keys are pressed

Implemented in nsTextInputSelectionImpl, and nsSelection.

Here is the caller graph for this function:

NS_IMETHOD nsIFrameSelection::HandleTextEvent ( nsGUIEvent aGuiEvent) [pure virtual]

HandleKeyEvent will accept an event.

DOES NOT ADDREF

Parameters:
aGuiEventis the event that should be dealt with by aFocusFrame
aFrameis the frame that MAY handle the event

Implemented in nsTextInputSelectionImpl, and nsSelection.

NS_IMETHOD nsIFrameSelection::Init ( nsIPresShell aShell,
nsIContent aLimiter 
) [pure virtual]

Init will initialize the frame selector with the necessary pres shell to be used by most of the methods.

Parameters:
aShellis the parameter to be used for most of the other calls for callbacks ect
aLimiterlimits the selection to nodes with aLimiter parents

Implemented in nsTextInputSelectionImpl, and nsSelection.

NS_IMETHOD nsIFrameSelection::IntraLineMove ( PRBool  aForward,
PRBool  aExtend 
) [pure virtual]

IntraLineMove will generally be called from the nsiselectioncontroller implementations.

the effect being the selection will move to beginning or end of line

Parameters:
aForwardmove forward in document.
aExtendcontinue selection

Implemented in nsTextInputSelectionImpl, and nsSelection.

NS_IMETHOD nsIFrameSelection::LineMove ( PRBool  aForward,
PRBool  aExtend 
) [pure virtual]

LineMove will generally be called from the nsiselectioncontroller implementations.

the effect being the selection will move one line up or down.

Parameters:
aForwardmove forward in document.
aExtendcontinue selection

Implemented in nsTextInputSelectionImpl, and nsSelection.

NS_IMETHOD nsIFrameSelection::LookUpSelection ( nsIContent aContent,
PRInt32  aContentOffset,
PRInt32  aContentLength,
SelectionDetails **  aReturnDetails,
PRBool  aSlowCheck 
) [pure virtual]

Lookup Selection returns in frame coordinates the selection beginning and ending with the type of selection given.

Parameters:
aContentis the content asking
aContentOffsetis the starting content boundary
aContentLengthis the length of the content piece asking
aReturnDetailslinkedlist of return values for the selection.
aSlowCheckwill check using slow method with no shortcuts

Implemented in nsTextInputSelectionImpl, and nsSelection.

MaintainSelection will track the current selection as being "sticky".

Dragging or extending selection will never allow for a subset (or the whole) of the maintained selection to become unselected. Primary use: double click selecting then dragging on second click

Implemented in nsTextInputSelectionImpl, and nsSelection.

NS_IMETHOD nsIFrameSelection::RepaintSelection ( nsPresContext aPresContext,
SelectionType  aSelectionType 
) [pure virtual]

RepaintSelection repaints the selected frames that are inside the selection specified by aSelectionType.

Parameters:
aSelectionTypeenum value defined in nsISelection for the seleciton you want.

Implemented in nsTextInputSelectionImpl, and nsSelection.

NS_IMETHOD nsIFrameSelection::ScrollSelectionIntoView ( SelectionType  aSelectionType,
SelectionRegion  aRegion,
PRBool  aIsSynchronous 
) [pure virtual]

ScrollSelectionIntoView scrolls a region of the selection, so that it is visible in the scrolled view.

Parameters:
aTypethe selection to scroll into view.
aRegionthe region inside the selection to scroll into view.
aIsSynchronouswhen PR_TRUE, scrolls the selection into view at some point after the method returns.request which is processed

Implemented in nsTextInputSelectionImpl, and nsSelection.

Select All will generally be called from the nsiselectioncontroller implementations.

it will select the whole doc

Implemented in nsTextInputSelectionImpl, and nsSelection.

Allow applications to specify how we should place the caret when the user clicks over an existing selection.

A aDelay value of PR_TRUE means delay clearing the selection and placing the caret until MouseUp, when the user clicks over an existing selection. This is especially usefull when applications want to support Drag & Drop of the current selection. A value of PR_FALSE means place the caret immediately. If the application never calls this method, the nsIFrameSelection implementation assumes the default value is PR_TRUE.

Parameters:
aDelayPR_TRUE if we should delay caret placement.

Implemented in nsTextInputSelectionImpl, and nsSelection.

If we are delaying caret placement til MouseUp (see Set/GetDelayCaretOverExistingSelection()), this method can be used to store the data received during the MouseDown so that we can place the caret during the MouseUp event.

the event received by the selection MouseDown handling method. A NULL value can be use to tell this method that any data is storing is no longer valid.

Implemented in nsTextInputSelectionImpl, and nsSelection.

Here is the caller graph for this function:

Sets/Gets The display selection enum.

Implemented in nsTextInputSelectionImpl, and nsSelection.

NS_IMETHOD nsIFrameSelection::SetHint ( HINT  aHint) [pure virtual]

Implemented in nsTextInputSelectionImpl, and nsSelection.

NS_IMETHOD nsIFrameSelection::SetMouseDoubleDown ( PRBool  aDoubleDown) [pure virtual]

This will tell the frame selection that a double click has been pressed so it can track abort future drags if inside the same selection has the double click down happened.

Implemented in nsTextInputSelectionImpl, and nsSelection.

SetMouseDownState(PRBool); sets the mouse state to aState for resons of drag state.

Parameters:
aStateis the new state of mousedown

Implemented in nsTextInputSelectionImpl, and nsSelection.

Here is the caller graph for this function:

Implemented in nsTextInputSelectionImpl, and nsSelection.

ShutDown will be called when the owner of the frame selection is shutting down this should be the time to release all member variable interfaces.

all methods called after ShutDown should return NS_ERROR_FAILURE

Implemented in nsTextInputSelectionImpl, and nsSelection.

NS_IMETHOD nsIFrameSelection::StartAutoScrollTimer ( nsPresContext aPresContext,
nsIView aFrame,
nsPoint aPoint,
PRUint32  aDelay 
) [pure virtual]

StartAutoScrollTimer is responsible for scrolling views so that aPoint is always visible, and for selecting any frame that contains aPoint.

The timer will also reset itself to fire again if we have not scrolled to the end of the document.

Parameters:
aPresContextis the context to use when figuring out what frame contains the point.
aViewis view to use when searching for the closest frame to the point, which is the view that is capturing the mouse
aPointis relative to the view.
aDelayis the timer's interval.

Implemented in nsTextInputSelectionImpl, and nsSelection.

StopAutoScrollTimer stops any active auto scroll timer.

Implemented in nsTextInputSelectionImpl, and nsSelection.

Here is the caller graph for this function:

NS_IMETHOD nsIFrameSelection::WordMove ( PRBool  aForward,
PRBool  aExtend 
) [pure virtual]

WordMove will generally be called from the nsiselectioncontroller implementations.

the effect being the selection will move one word left or right.

Parameters:
aForwardmove forward in document.
aExtendcontinue selection

Implemented in nsTextInputSelectionImpl, and nsSelection.


The documentation for this class was generated from the following file: