cohtml::INodeProxy
On this page
Represents a DOM element in the View - i.e. a DIV, the BODY etc.
#include <NodeProxy.h>
Inherited by cohtml::IInputProxy
Public Functions
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 GetId
virtual const char * GetId() const =0
Returns the id of the element - this is a shortcut to get the ‘id’ attribute.
function GetClassesCount
virtual unsigned GetClassesCount() const =0
Returns the classes count of the element - this is a shortcut to get the ‘class’ attribute.
function GetClass
virtual const char * GetClass(
unsigned id
) const =0
Returns the value of the class with id number from the array.
function GetAttributesCount
virtual unsigned GetAttributesCount() const =0
Returns the count of all attributes on a node.
function GetAttribute
virtual unsigned GetAttribute(
unsigned id,
char * buffer,
unsigned bufferLength
) const =0
Gives the attribute value.
Parameters:
- id the numbered id of the attribute - can be used to iterate over all attributes
- buffer the char buffer where to copy the value - can be nullptr, to just get the size of the value
- bufferLength the size of the buffer in bytes. If the buffer is too small to accomodate the value, only bufferLength bytes will be copied
Return: the size of the whole value string in bytes
function GetAttribute
virtual unsigned GetAttribute(
const char * name,
char * buffer,
unsigned bufferLength
) const =0
Gives the attribute value.
Parameters:
- name the name of the attribute
- buffer the char buffer where to copy the value - can be nullptr, to just get the size of the value
- bufferLength the size of the buffer in bytes. If the buffer is too small to accomodate the value, only bufferLength bytes will be copied
Return: the size of the whole value string in bytes
function HasAttribute
virtual bool HasAttribute(
const char * name
) const =0
Returns if an attribute with name is set on the element.
function GetTag
virtual HTMLTag GetTag() const =0
Returns the HTML tag of the element.
function HasScriptEventListeners
virtual bool HasScriptEventListeners() const =0
Returns if the element has event listeners in JavaScript.
function GetValueOfElement
virtual unsigned GetValueOfElement(
char * buffer,
unsigned bufferLength
) const =0
Gives the Value of the Element.
Parameters:
- buffer the char buffer where to copy the value - can be nullptr, to just get the size of the value
- bufferLength the size of the buffer in bytes. If the buffer is too small to accomodate the value, only bufferLength bytes will be copied
Return: the size of the whole value string in bytes
function GetBoundingRect
virtual void GetBoundingRect(
double & x,
double & y,
double & width,
double & height
) const =0
Returns position and size of the node in view coordinates.
Parameters:
- x position of the node in pixels in the space of the view
- y position of the node in pixels in the space of the view
- width of the node in pixels in the space of the view
- height of the node in pixels in the space of the view
function ~INodeProxy
inline virtual ~INodeProxy()