Public Member Functions

TextInputTarget Class Reference

An abstract base class which can be implemented by components that function as text editors. More...

Inherited by CodeEditorComponent, and TextEditor.

List of all members.

Public Member Functions

 TextInputTarget ()
virtual ~TextInputTarget ()
 Destructor.
virtual bool isTextInputActive () const =0
 Returns true if this input target is currently accepting input.
virtual const Range< int > getHighlightedRegion () const =0
 Returns the extents of the selected text region, or an empty range if nothing is selected,.
virtual void setHighlightedRegion (const Range< int > &newRange)=0
 Sets the currently-selected text region.
virtual void setTemporaryUnderlining (const Array< Range< int > > &underlinedRegions)=0
 Sets a number of temporarily underlined sections.
virtual const String getTextInRange (const Range< int > &range) const =0
 Returns a specified sub-section of the text.
virtual void insertTextAtCaret (const String &textToInsert)=0
 Inserts some text, overwriting the selected text region, if there is one.
virtual const Rectangle< int > getCaretRectangle ()=0
 Returns the position of the caret, relative to the component's origin.

Detailed Description

An abstract base class which can be implemented by components that function as text editors.

This class allows different types of text editor component to provide a uniform interface, which can be used by things like OS-specific input methods, on-screen keyboards, etc.


Constructor & Destructor Documentation

TextInputTarget::TextInputTarget (  )
virtual TextInputTarget::~TextInputTarget (  ) [virtual]

Destructor.


Member Function Documentation

virtual bool TextInputTarget::isTextInputActive (  ) const [pure virtual]

Returns true if this input target is currently accepting input.

For example, a text editor might return false if it's in read-only mode.

Implemented in CodeEditorComponent, and TextEditor.

virtual const Range<int> TextInputTarget::getHighlightedRegion (  ) const [pure virtual]

Returns the extents of the selected text region, or an empty range if nothing is selected,.

Implemented in CodeEditorComponent, and TextEditor.

virtual void TextInputTarget::setHighlightedRegion ( const Range< int > &  newRange ) [pure virtual]

Sets the currently-selected text region.

Implemented in CodeEditorComponent, and TextEditor.

virtual void TextInputTarget::setTemporaryUnderlining ( const Array< Range< int > > &  underlinedRegions ) [pure virtual]

Sets a number of temporarily underlined sections.

This is needed by MS Windows input method UI.

Implemented in CodeEditorComponent, and TextEditor.

virtual const String TextInputTarget::getTextInRange ( const Range< int > &  range ) const [pure virtual]

Returns a specified sub-section of the text.

Implemented in CodeEditorComponent, and TextEditor.

virtual void TextInputTarget::insertTextAtCaret ( const String textToInsert ) [pure virtual]

Inserts some text, overwriting the selected text region, if there is one.

Implemented in CodeEditorComponent, and TextEditor.

virtual const Rectangle<int> TextInputTarget::getCaretRectangle (  ) [pure virtual]

Returns the position of the caret, relative to the component's origin.

Implemented in CodeEditorComponent, and TextEditor.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines