JUCE
|
An abstract base class which can be implemented by components that function as text editors. More...
Public Types | |
enum | VirtualKeyboardType { textKeyboard = 0, numericKeyboard, decimalKeyboard, urlKeyboard, emailAddressKeyboard, phoneNumberKeyboard } |
A set of possible on-screen keyboard types, for use in the getKeyboardType() method. More... | |
Public Member Functions | |
TextInputTarget ()=default | |
virtual | ~TextInputTarget ()=default |
Destructor. More... | |
virtual bool | isTextInputActive () const =0 |
Returns true if this input target is currently accepting input. More... | |
virtual Range< int > | getHighlightedRegion () const =0 |
Returns the extents of the selected text region, or an empty range if nothing is selected,. More... | |
virtual void | setHighlightedRegion (const Range< int > &newRange)=0 |
Sets the currently-selected text region. More... | |
virtual void | setTemporaryUnderlining (const Array< Range< int >> &underlinedRegions)=0 |
Sets a number of temporarily underlined sections. More... | |
virtual String | getTextInRange (const Range< int > &range) const =0 |
Returns a specified sub-section of the text. More... | |
virtual void | insertTextAtCaret (const String &textToInsert)=0 |
Inserts some text, overwriting the selected text region, if there is one. More... | |
virtual Rectangle< int > | getCaretRectangle ()=0 |
Returns the position of the caret, relative to the component's origin. More... | |
virtual VirtualKeyboardType | getKeyboardType () |
Returns the target's preference for the type of keyboard that would be most appropriate. More... | |
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.
A set of possible on-screen keyboard types, for use in the getKeyboardType() method.
Enumerator | |
---|---|
textKeyboard | |
numericKeyboard | |
decimalKeyboard | |
urlKeyboard | |
emailAddressKeyboard | |
phoneNumberKeyboard |
|
default |
|
virtualdefault |
Destructor.
|
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 TextEditor, and CodeEditorComponent.
Returns the extents of the selected text region, or an empty range if nothing is selected,.
Implemented in TextEditor, and CodeEditorComponent.
Referenced by CodeEditorComponent::getSelectionEnd().
Sets the currently-selected text region.
Implemented in TextEditor, and CodeEditorComponent.
Referenced by CodeEditorComponent::getSelectionEnd().
|
pure virtual |
Sets a number of temporarily underlined sections.
This is needed by MS Windows input method UI.
Implemented in TextEditor, and CodeEditorComponent.
Returns a specified sub-section of the text.
Implemented in TextEditor, and CodeEditorComponent.
Referenced by CodeEditorComponent::getSelectionEnd().
|
pure virtual |
Inserts some text, overwriting the selected text region, if there is one.
Implemented in TextEditor, and CodeEditorComponent.
Referenced by CodeEditorComponent::getSelectionEnd().
Returns the position of the caret, relative to the component's origin.
Implemented in TextEditor, and CodeEditorComponent.
Referenced by CodeEditorComponent::getCaretPos().
|
virtual |
Returns the target's preference for the type of keyboard that would be most appropriate.
This may be ignored, depending on the capabilities of the OS.
Reimplemented in TextEditor.