Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions
nsITextWidget Class Reference

Single line text editor. More...

#include <nsITextWidget.h>

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

List of all members.

Public Member Functions

NS_IMETHOD GetText (nsString &aTextBuffer, PRUint32 aBufferSize, PRUint32 &aActualSize)=0
 Get the text of this component.
NS_IMETHOD SetText (const nsString &aText, PRUint32 &aActualSize)=0
 Set the text of this component.
NS_IMETHOD InsertText (const nsString &aText, PRUint32 aStartPos, PRUint32 aEndPos, PRUint32 &aActualSize)=0
 Insert text into this component.
NS_IMETHOD RemoveText (void)=0
 Remove any content from this text widget.
NS_IMETHOD SetPassword (PRBool aIsPassword)=0
 Indicates a password will be entered.
NS_IMETHOD SetMaxTextLength (PRUint32 aChars)=0
 Sets the maximum number of characters the widget can hold.
NS_IMETHOD SetReadOnly (PRBool aNewReadOnlyFlag, PRBool &aOldReadOnlyFlag)=0
 Set the text widget to be read-only.
NS_IMETHOD SelectAll ()=0
 Select all of the contents.
NS_IMETHOD SetSelection (PRUint32 aStartSel, PRUint32 aEndSel)=0
 Set the selection in this text component.
NS_IMETHOD GetSelection (PRUint32 *aStartSel, PRUint32 *aEndSel)=0
 Get the selection in this text component.
NS_IMETHOD SetCaretPosition (PRUint32 aPosition)=0
 Set the caret position.
NS_IMETHOD GetCaretPosition (PRUint32 &aPosition)=0
 Get the caret position.
NS_IMETHOD GetText (nsString &aTextBuffer, PRUint32 aBufferSize, PRUint32 &aActualSize)=0
 Get the text of this component.
NS_IMETHOD SetText (const nsString &aText, PRUint32 &aActualSize)=0
 Set the text of this component.
NS_IMETHOD InsertText (const nsString &aText, PRUint32 aStartPos, PRUint32 aEndPos, PRUint32 &aActualSize)=0
 Insert text into this component.
NS_IMETHOD RemoveText (void)=0
 Remove any content from this text widget.
NS_IMETHOD SetPassword (PRBool aIsPassword)=0
 Indicates a password will be entered.
NS_IMETHOD SetMaxTextLength (PRUint32 aChars)=0
 Sets the maximum number of characters the widget can hold.
NS_IMETHOD SetReadOnly (PRBool aNewReadOnlyFlag, PRBool &aOldReadOnlyFlag)=0
 Set the text widget to be read-only.
NS_IMETHOD SelectAll ()=0
 Select all of the contents.
NS_IMETHOD SetSelection (PRUint32 aStartSel, PRUint32 aEndSel)=0
 Set the selection in this text component.
NS_IMETHOD GetSelection (PRUint32 *aStartSel, PRUint32 *aEndSel)=0
 Get the selection in this text component.
NS_IMETHOD SetCaretPosition (PRUint32 aPosition)=0
 Set the caret position.
NS_IMETHOD GetCaretPosition (PRUint32 &aPosition)=0
 Get the caret position.

Detailed Description

Single line text editor.

Unlike a nsIWidget, The text editor must automatically clear itself to the background color when paint messages are generated.

Definition at line 68 of file nsITextWidget.h.


Member Function Documentation

NS_IMETHOD nsITextWidget::GetCaretPosition ( PRUint32 aPosition) [pure virtual]

Get the caret position.

Returns:
caret position in characters
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

NS_IMETHOD nsITextWidget::GetCaretPosition ( PRUint32 aPosition) [pure virtual]

Get the caret position.

Returns:
caret position in characters
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

NS_IMETHOD nsITextWidget::GetSelection ( PRUint32 aStartSel,
PRUint32 aEndSel 
) [pure virtual]

Get the selection in this text component.

Parameters:
aStartSelstarting selection position in characters
aEndSelending selection position in characters
Returns:
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

NS_IMETHOD nsITextWidget::GetSelection ( PRUint32 aStartSel,
PRUint32 aEndSel 
) [pure virtual]

Get the selection in this text component.

Parameters:
aStartSelstarting selection position in characters
aEndSelending selection position in characters
Returns:
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

NS_IMETHOD nsITextWidget::GetText ( nsString aTextBuffer,
PRUint32  aBufferSize,
PRUint32 aActualSize 
) [pure virtual]

Get the text of this component.

Parameters:
aTextBufferon return contains the text of this component
aBufferSizethe size of the buffer passed in
aActualSizethe number of char copied
Returns:
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

Here is the caller graph for this function:

NS_IMETHOD nsITextWidget::GetText ( nsString aTextBuffer,
PRUint32  aBufferSize,
PRUint32 aActualSize 
) [pure virtual]

Get the text of this component.

Parameters:
aTextBufferon return contains the text of this component
aBufferSizethe size of the buffer passed in
aActualSizethe number of char copied
Returns:
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

NS_IMETHOD nsITextWidget::InsertText ( const nsString aText,
PRUint32  aStartPos,
PRUint32  aEndPos,
PRUint32 aActualSize 
) [pure virtual]

Insert text into this component.

When aStartPos and aEndPos are a valid range this function performs a replace. When aStartPos and aEndPos are equal this function performs an insert. When aStartPos and aEndPos are both -1 (0xFFFFFFFF) this function performs an append. If aStartPos and aEndPos are out of range they are rounded to the closest end.

Parameters:
aTextthe text to set
aStartPosstarting position for inserting text
aEndPosending position for inserting text
Returns:
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

NS_IMETHOD nsITextWidget::InsertText ( const nsString aText,
PRUint32  aStartPos,
PRUint32  aEndPos,
PRUint32 aActualSize 
) [pure virtual]

Insert text into this component.

When aStartPos and aEndPos are a valid range this function performs a replace. When aStartPos and aEndPos are equal this function performs an insert. When aStartPos and aEndPos are both -1 (0xFFFFFFFF) this function performs an append. If aStartPos and aEndPos are out of range they are rounded to the closest end.

Parameters:
aTextthe text to set
aStartPosstarting position for inserting text
aEndPosending position for inserting text
Returns:
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

Remove any content from this text widget.

Returns:
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

Remove any content from this text widget.

Returns:
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

Select all of the contents.

Returns:
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

Select all of the contents.

Returns:
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

NS_IMETHOD nsITextWidget::SetCaretPosition ( PRUint32  aPosition) [pure virtual]

Set the caret position.

Parameters:
aPositioncaret position in characters
Returns:
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

NS_IMETHOD nsITextWidget::SetCaretPosition ( PRUint32  aPosition) [pure virtual]

Set the caret position.

Parameters:
aPositioncaret position in characters
Returns:
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

Sets the maximum number of characters the widget can hold.

Parameters:
aCharsmaximum number of characters for this widget. if 0 then there isn't any limit
Returns:
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

Sets the maximum number of characters the widget can hold.

Parameters:
aCharsmaximum number of characters for this widget. if 0 then there isn't any limit
Returns:
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

Here is the caller graph for this function:

NS_IMETHOD nsITextWidget::SetPassword ( PRBool  aIsPassword) [pure virtual]

Indicates a password will be entered.

Parameters:
aIsPasswordPR_TRUE shows contents as asterisks. PR_FALSE shows contents as normal text.
Returns:
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

NS_IMETHOD nsITextWidget::SetPassword ( PRBool  aIsPassword) [pure virtual]

Indicates a password will be entered.

Parameters:
aIsPasswordPR_TRUE shows contents as asterisks. PR_FALSE shows contents as normal text.
Returns:
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

NS_IMETHOD nsITextWidget::SetReadOnly ( PRBool  aNewReadOnlyFlag,
PRBool aOldReadOnlyFlag 
) [pure virtual]

Set the text widget to be read-only.

Parameters:
aReadOnlyFlagPR_TRUE the widget is read-only, PR_FALSE indicates the widget is writable.
PR_TRUEif it was read only. PR_FALSE if it was writable
Returns:
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

NS_IMETHOD nsITextWidget::SetReadOnly ( PRBool  aNewReadOnlyFlag,
PRBool aOldReadOnlyFlag 
) [pure virtual]

Set the text widget to be read-only.

Parameters:
aReadOnlyFlagPR_TRUE the widget is read-only, PR_FALSE indicates the widget is writable.
PR_TRUEif it was read only. PR_FALSE if it was writable
Returns:
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

NS_IMETHOD nsITextWidget::SetSelection ( PRUint32  aStartSel,
PRUint32  aEndSel 
) [pure virtual]

Set the selection in this text component.

Parameters:
aStartSelstarting selection position in characters
aEndSelending selection position in characters
Returns:
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

NS_IMETHOD nsITextWidget::SetSelection ( PRUint32  aStartSel,
PRUint32  aEndSel 
) [pure virtual]

Set the selection in this text component.

Parameters:
aStartSelstarting selection position in characters
aEndSelending selection position in characters
Returns:
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

NS_IMETHOD nsITextWidget::SetText ( const nsString aText,
PRUint32 aActualSize 
) [pure virtual]

Set the text of this component.

Parameters:
aText-- an object containing a copy of the text
Returns:
the number of chars in the text string
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.

Here is the caller graph for this function:

NS_IMETHOD nsITextWidget::SetText ( const nsString aText,
PRUint32 aActualSize 
) [pure virtual]

Set the text of this component.

Parameters:
aText-- an object containing a copy of the text
Returns:
the number of chars in the text string
NS_Ok if no errors

Implemented in nsTextHelper, nsTextHelper, nsTextHelper, and nsTextHelper.


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