cohtml::IInputProxy
Represents an INPUT or TEXTAREA element in the View.
#include <InputProxy.h>
Inherits from cohtml::INodeProxy
Public Functions
Name | |
---|---|
virtual const char * | GetText(unsigned startIndex) const =0 Gets the text in an input field. |
virtual const TextInput::Rectangle * | GetTextPositions(unsigned startIndex, unsigned endIndex, unsigned & lineCount) =0 Gets the coordinates of the text in the input field. |
virtual bool | SetText(const char * buffer, unsigned length, TextInput::Range range) =0 Sets the text in the input field. |
virtual TextInput::Selection | GetSelection() const =0 Gets the current text selection. |
virtual bool | SetSelection(TextInput::Selection selection) =0 Sets the current text selection. |
Additional inherited members
Public Functions inherited from cohtml::INodeProxy
Name | |
---|---|
virtual const char * | GetId() const =0 Returns the id of the element - this is a shortcut to get the ‘id’ attribute. |
virtual unsigned | GetClassesCount() const =0 Returns the classes count of the element - this is a shortcut to get the ‘class’ attribute. |
virtual const char * | GetClass(unsigned id) const =0 Returns the value of the class with id number from the array. |
virtual unsigned | GetAttributesCount() const =0 Returns the count of all attributes on a node. |
virtual unsigned | GetAttribute(unsigned id, char * buffer, unsigned bufferLength) const =0 Gives the attribute value. |
virtual unsigned | GetAttribute(const char * name, char * buffer, unsigned bufferLength) const =0 Gives the attribute value. |
virtual bool | HasAttribute(const char * name) const =0 Returns if an attribute with name is set on the element. |
virtual HTMLTag | GetTag() const =0 Returns the HTML tag of the element. |
virtual bool | HasScriptEventListeners() const =0 Returns if the element has event listeners in JavaScript. |
virtual unsigned | GetValueOfElement(char * buffer, unsigned bufferLength) const =0 Gives the Value of the Element. |
virtual void | GetBoundingRect(double & x, double & y, double & width, double & height) const =0 Returns position and size of the node in view coordinates. |
virtual | ~INodeProxy() |
Public Functions Documentation
function GetText
virtual const char * GetText(
unsigned startIndex
) const =0
Gets the text in an input field.
Parameters:
- startIndex the starting index from which to return the text
function GetTextPositions
virtual const TextInput::Rectangle * GetTextPositions(
unsigned startIndex,
unsigned endIndex,
unsigned & lineCount
) =0
Gets the coordinates of the text in the input field.
Parameters:
- startIndex the starting text index
- endIndex the last text position
- lineCount number of text lines in the input field between startIndex and endIndex
Return: a pointer to an array of rectangles, each representing the area covered by text in the corresponding text line
Note: the pointer will be valid until the next call of GetTextPositions
function SetText
virtual bool SetText(
const char * buffer,
unsigned length,
TextInput::Range range
) =0
Sets the text in the input field.
Parameters:
- buffer the char buffer from which to set the text
- length the length of the text
- range the range of the text to replace
Return: whether the text was succesfully set
function GetSelection
virtual TextInput::Selection GetSelection() const =0
Gets the current text selection.
function SetSelection
virtual bool SetSelection(
TextInput::Selection selection
) =0
Sets the current text selection.
Parameters:
- selection the new text selection to set
Return: whether setting the selection was successful