Public Member Functions | Static Public Member Functions | Protected Member Functions

nsHyperTextAccessible Class Reference

Special Accessible that knows how contain both text and embedded objects. More...

#include <nsHyperTextAccessible.h>

Inheritance diagram for nsHyperTextAccessible:
Collaboration diagram for nsHyperTextAccessible:

List of all members.

Public Member Functions

 nsHyperTextAccessible (nsIDOMNode *aNode, nsIWeakReference *aShell)
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIACCESSIBLETEXT
NS_DECL_NSIACCESSIBLEHYPERTEXT
virtual
NS_DECL_NSIACCESSIBLEEDITABLETEXT
PRInt32 
GetLevelInternal ()
virtual nsresult GetAttributesInternal (nsIPersistentProperties *aAttributes)
virtual nsresult GetRoleInternal (PRUint32 *aRole)
virtual nsresult GetStateInternal (PRUint32 *aState, PRUint32 *aExtraState)
nsresult DOMPointToHypertextOffset (nsIDOMNode *aNode, PRInt32 aNodeOffset, PRInt32 *aHypertextOffset, nsIAccessible **aFinalAccessible=0, PRBool aIsEndOffset=0)
 Turn a DOM Node and offset into a character offset into this hypertext.
nsresult HypertextOffsetToDOMPoint (PRInt32 aHTOffset, nsIDOMNode **aNode, PRInt32 *aOffset)
 Turn a hypertext offsets into DOM point.
nsresult HypertextOffsetsToDOMRange (PRInt32 aStartHTOffset, PRInt32 aEndHTOffset, nsIDOMNode **aStartNode, PRInt32 *aStartOffset, nsIDOMNode **aEndNode, PRInt32 *aEndOffset)
 Turn a start and end hypertext offsets into DOM range.

Static Public Member Functions

static nsresult ContentToRenderedOffset (nsIFrame *aFrame, PRInt32 aContentOffset, PRUint32 *aRenderedOffset)
static nsresult RenderedToContentOffset (nsIFrame *aFrame, PRUint32 aRenderedOffset, PRInt32 *aContentOffset)

Protected Member Functions

virtual void CacheChildren ()
nsresult GetTextHelper (EGetTextType aType, nsAccessibleTextBoundary aBoundaryType, PRInt32 aOffset, PRInt32 *aStartOffset, PRInt32 *aEndOffset, nsAString &aText)
PRInt32 GetRelativeOffset (nsIPresShell *aPresShell, nsIFrame *aFromFrame, PRInt32 aFromOffset, nsIAccessible *aFromAccessible, nsSelectionAmount aAmount, nsDirection aDirection, PRBool aNeedsStart)
 Used by GetTextHelper() to move backward/forward from a given point by word/line/etc.
nsIFrame * GetPosAndText (PRInt32 &aStartOffset, PRInt32 &aEndOffset, nsAString *aText=0, nsIFrame **aEndFrame=0, nsIntRect *aBoundsRect=0, nsIAccessible **aStartAcc=0, nsIAccessible **aEndAcc=0)
 Provides information for substring that is defined by the given start and end offsets for this hyper text.
nsIntRect GetBoundsForString (nsIFrame *aFrame, PRUint32 aStartRenderedOffset, PRUint32 aEndRenderedOffset)
nsresult GetSelections (PRInt16 aType, nsISelectionController **aSelCon, nsISelection **aDomSel=0, nsCOMArray< nsIDOMRange > *aRanges=0)
 Get the relevant selection interfaces and ranges for the current hyper text.
nsresult SetSelectionRange (PRInt32 aStartPos, PRInt32 aEndPos)
PRInt32 GetCaretLineNumber ()
 Provide the line number for the caret, relative to the current DOM node.
nsresult GetDOMPointByFrameOffset (nsIFrame *aFrame, PRInt32 aOffset, nsIAccessible *aAccessible, nsIDOMNode **aNode, PRInt32 *aNodeOffset)
nsresult DOMRangeBoundToHypertextOffset (nsIDOMRange *aRange, PRBool aIsStartBound, PRBool aIsStartOffset, PRInt32 *aHTOffset)
 Return hyper text offset for the specified bound of the given DOM range.
nsresult GetSpellTextAttribute (nsIDOMNode *aNode, PRInt32 aNodeOffset, PRInt32 *aStartOffset, PRInt32 *aEndOffset, nsIPersistentProperties *aAttributes)
 Set 'misspelled' text attribute and return range offsets where the attibute is stretched.

Detailed Description

Special Accessible that knows how contain both text and embedded objects.


Constructor & Destructor Documentation

nsHyperTextAccessible::nsHyperTextAccessible ( nsIDOMNode aNode,
nsIWeakReference aShell 
)

Member Function Documentation

virtual void nsHyperTextAccessible::CacheChildren (  )  [protected, virtual]
static nsresult nsHyperTextAccessible::ContentToRenderedOffset ( nsIFrame *  aFrame,
PRInt32  aContentOffset,
PRUint32 *  aRenderedOffset 
) [static]
nsresult nsHyperTextAccessible::DOMPointToHypertextOffset ( nsIDOMNode aNode,
PRInt32  aNodeOffset,
PRInt32 *  aHypertextOffset,
nsIAccessible **  aFinalAccessible = 0,
PRBool  aIsEndOffset = 0 
)

Turn a DOM Node and offset into a character offset into this hypertext.

Will look for closest match when the DOM node does not have an accessible object associated with it. Will return an offset for the end of the string if the node is not found.

Parameters:
aNode - the node to look for
aNodeOffset - the offset to look for if -1 just look directly for the node if >=0 and aNode is text, this represents a char offset if >=0 and aNode is not text, this represents a child node offset
aResultOffset - the character offset into the current nsHyperTextAccessible
aFinalAccessible [optional] - returns the accessible child which contained the offset, if it is within the current nsHyperTextAccessible, otherwise it is set to nsnull.
aIsEndOffset - if PR_TRUE, then then this offset is not inclusive. The character indicated by the offset returned is at [offset - 1]. This means if the passed-in offset is really in a descendant, then the offset returned will come just after the relevant embedded object characer. If PR_FALSE, then the offset is inclusive. The character indicated by the offset returned is at [offset]. If the passed-in offset in inside a descendant, then the returned offset will be on the relevant embedded object char.
nsresult nsHyperTextAccessible::DOMRangeBoundToHypertextOffset ( nsIDOMRange aRange,
PRBool  aIsStartBound,
PRBool  aIsStartOffset,
PRInt32 *  aHTOffset 
) [protected]

Return hyper text offset for the specified bound of the given DOM range.

If the bound is outside of the hyper text then offset value is either 0 or number of characters of hyper text, it depends on type of requested offset. The method is a wrapper for DOMPointToHypertextOffset.

Parameters:
aRange [in] the given range
aIsStartBound [in] specifies whether the required range bound is start bound
aIsStartOffset [in] the offset type, used when the range bound is outside of hyper text
aHTOffset [out] the result offset
virtual nsresult nsHyperTextAccessible::GetAttributesInternal ( nsIPersistentProperties aAttributes  )  [virtual]
nsIntRect nsHyperTextAccessible::GetBoundsForString ( nsIFrame *  aFrame,
PRUint32  aStartRenderedOffset,
PRUint32  aEndRenderedOffset 
) [protected]
PRInt32 nsHyperTextAccessible::GetCaretLineNumber (  )  [protected]

Provide the line number for the caret, relative to the current DOM node.

Returns:
1-based index for the line number with the caret
nsresult nsHyperTextAccessible::GetDOMPointByFrameOffset ( nsIFrame *  aFrame,
PRInt32  aOffset,
nsIAccessible aAccessible,
nsIDOMNode **  aNode,
PRInt32 *  aNodeOffset 
) [protected]
NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIACCESSIBLETEXT NS_DECL_NSIACCESSIBLEHYPERTEXT virtual NS_DECL_NSIACCESSIBLEEDITABLETEXT PRInt32 nsHyperTextAccessible::GetLevelInternal (  )  [virtual]
nsIFrame* nsHyperTextAccessible::GetPosAndText ( PRInt32 &  aStartOffset,
PRInt32 &  aEndOffset,
nsAString aText = 0,
nsIFrame **  aEndFrame = 0,
nsIntRect aBoundsRect = 0,
nsIAccessible **  aStartAcc = 0,
nsIAccessible **  aEndAcc = 0 
) [protected]

Provides information for substring that is defined by the given start and end offsets for this hyper text.

Parameters:
aStartOffset [inout] the start offset into the hyper text. This is also an out parameter used to return the offset into the start frame's rendered text content (start frame is the
Returns:
)
Parameters:
aEndOffset [inout] the end offset into the hyper text. This is also an out parameter used to return the offset into the end frame's rendered text content.
aText [out, optional] return the substring's text
aEndFrame [out, optional] return the end frame for this substring
aBoundsRect [out, optional] return the bounds rectangle for this substring
aStartAcc [out, optional] return the start accessible for this substring
aEndAcc [out, optional] return the end accessible for this substring
Returns:
the start frame for this substring
PRInt32 nsHyperTextAccessible::GetRelativeOffset ( nsIPresShell *  aPresShell,
nsIFrame *  aFromFrame,
PRInt32  aFromOffset,
nsIAccessible aFromAccessible,
nsSelectionAmount  aAmount,
nsDirection  aDirection,
PRBool  aNeedsStart 
) [protected]

Used by GetTextHelper() to move backward/forward from a given point by word/line/etc.

Parameters:
aPresShell the current presshell we're moving in
aFromFrame the starting frame we're moving from
aFromOffset the starting offset we're moving from
aFromAccessible the starting accessible we're moving from
aAmount how much are we moving (word/line/etc.) ?
aDirection forward or backward?
aNeedsStart for word and line cases, are we basing this on the start or end?
Returns:
the resulting offset into this hypertext
virtual nsresult nsHyperTextAccessible::GetRoleInternal ( PRUint32 *  aRole  )  [virtual]
nsresult nsHyperTextAccessible::GetSelections ( PRInt16  aType,
nsISelectionController **  aSelCon,
nsISelection **  aDomSel = 0,
nsCOMArray< nsIDOMRange > *  aRanges = 0 
) [protected]

Get the relevant selection interfaces and ranges for the current hyper text.

Parameters:
aType [in] the selection type
aSelCon [out, optional] the selection controller for the current hyper text
aDomSel [out, optional] the selection interface for the current hyper text
aRanges [out, optional] the selected ranges within the current subtree
nsresult nsHyperTextAccessible::GetSpellTextAttribute ( nsIDOMNode aNode,
PRInt32  aNodeOffset,
PRInt32 *  aStartOffset,
PRInt32 *  aEndOffset,
nsIPersistentProperties aAttributes 
) [protected]

Set 'misspelled' text attribute and return range offsets where the attibute is stretched.

If the text is not misspelled at the given offset then we expose only range offsets where text is not misspelled. The method is used by GetTextAttributes() method.

Parameters:
aIncludeDefAttrs [in] points whether text attributes having default values of attributes should be included
aSourceNode [in] the node we start to traverse from
aStartOffset [in, out] the start offset
aEndOffset [in, out] the end offset
aAttributes [out, optional] result attributes
virtual nsresult nsHyperTextAccessible::GetStateInternal ( PRUint32 *  aState,
PRUint32 *  aExtraState 
) [virtual]
nsresult nsHyperTextAccessible::GetTextHelper ( EGetTextType  aType,
nsAccessibleTextBoundary  aBoundaryType,
PRInt32  aOffset,
PRInt32 *  aStartOffset,
PRInt32 *  aEndOffset,
nsAString aText 
) [protected]
nsresult nsHyperTextAccessible::HypertextOffsetsToDOMRange ( PRInt32  aStartHTOffset,
PRInt32  aEndHTOffset,
nsIDOMNode **  aStartNode,
PRInt32 *  aStartOffset,
nsIDOMNode **  aEndNode,
PRInt32 *  aEndOffset 
)

Turn a start and end hypertext offsets into DOM range.

Parameters:
aStartHTOffset [in] the given start hypertext offset
aEndHTOffset [in] the given end hypertext offset
aStartNode [out] start node of the range
aStartOffset [out] start offset of the range
aEndNode [out] end node of the range
aEndOffset [out] end offset of the range
nsresult nsHyperTextAccessible::HypertextOffsetToDOMPoint ( PRInt32  aHTOffset,
nsIDOMNode **  aNode,
PRInt32 *  aOffset 
)

Turn a hypertext offsets into DOM point.

Parameters:
aHTOffset [in] the given start hypertext offset
aNode [out] start node
aOffset [out] offset inside the start node
static nsresult nsHyperTextAccessible::RenderedToContentOffset ( nsIFrame *  aFrame,
PRUint32  aRenderedOffset,
PRInt32 *  aContentOffset 
) [static]
nsresult nsHyperTextAccessible::SetSelectionRange ( PRInt32  aStartPos,
PRInt32  aEndPos 
) [protected]

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