1.6.1.1
Gameface
cohtml::IInputProxy Class Referenceabstract

Represents an INPUT or TEXTAREA element in the View. More...

+ Inheritance diagram for cohtml::IInputProxy:

Public Member Functions

virtual const char * GetText (unsigned startIndex) const =0
 Gets the text in an input field. More...
 
virtual const TextInput::RectangleGetTextPositions (unsigned startIndex, unsigned endIndex, unsigned &lineCount)=0
 Gets the coordinates of the text in the input field. More...
 
virtual bool SetText (const char *buffer, unsigned length, TextInput::Range range)=0
 Sets the text in the input field. More...
 
virtual TextInput::Selection GetSelection () const =0
 Gets the current text selection. More...
 
virtual bool SetSelection (TextInput::Selection selection)=0
 Sets the current text selection. More...
 
- Public Member Functions inherited from cohtml::INodeProxy
virtual const char * GetId () const =0
 Returns the id of the element - this is a shortcut to get the 'id' attribute. More...
 
virtual unsigned GetClassesCount () const =0
 Returns the classes count of the element - this is a shortcut to get the 'class' attribute. More...
 
virtual const char * GetClass (unsigned id) const =0
 Returns the value of the class with id number from the array. More...
 
virtual unsigned GetAttributesCount () const =0
 Returns the count of all attributes on a node. More...
 
virtual unsigned GetAttribute (unsigned id, char *buffer, unsigned bufferLength) const =0
 Gives the attribute value. More...
 
virtual unsigned GetAttribute (const char *name, char *buffer, unsigned bufferLength) const =0
 Gives the attribute value. More...
 
virtual bool HasAttribute (const char *name) const =0
 Returns if an attribute with name is set on the element. More...
 
virtual HTMLTag GetTag () const =0
 Returns the HTML tag of the element. More...
 
virtual bool HasScriptEventListeners () const =0
 Returns if the element has event listeners in JavaScript. More...
 
virtual unsigned GetValueOfElement (char *buffer, unsigned bufferLength) const =0
 Gives the Value of the Element. More...
 
virtual ~INodeProxy ()
 

Detailed Description

Represents an INPUT or TEXTAREA element in the View.

Member Function Documentation

◆ GetSelection()

virtual TextInput::Selection cohtml::IInputProxy::GetSelection ( ) const
pure virtual

Gets the current text selection.

◆ GetText()

virtual const char* cohtml::IInputProxy::GetText ( unsigned  startIndex) const
pure virtual

Gets the text in an input field.

Parameters
startIndexthe starting index from which to return the text

◆ GetTextPositions()

virtual const TextInput::Rectangle* cohtml::IInputProxy::GetTextPositions ( unsigned  startIndex,
unsigned  endIndex,
unsigned &  lineCount 
)
pure virtual

Gets the coordinates of the text in the input field.

Parameters
startIndexthe starting text index
endIndexthe last text position
lineCountnumber of text lines in the input field
Returns
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

◆ SetSelection()

virtual bool cohtml::IInputProxy::SetSelection ( TextInput::Selection  selection)
pure virtual

Sets the current text selection.

Parameters
selectionthe new text selection to set
Returns
whether setting the selection was successful

◆ SetText()

virtual bool cohtml::IInputProxy::SetText ( const char *  buffer,
unsigned  length,
TextInput::Range  range 
)
pure virtual

Sets the text in the input field.

Parameters
bufferthe char buffer from which to set the text
lengththe length of the text
rangethe range of the text to replace
Returns
whether the text was succesfully set