Skip to content
SiteEmail

cohtml::INodeProxy

Represents a DOM element in the View - i.e. a DIV, the BODY etc.

#include <NodeProxy.h>

Inherited by cohtml::IInputProxy

Name
virtual const char *GetId() const =0
Returns the id of the element - this is a shortcut to get the ‘id’ attribute.
virtual unsignedGetClassesCount() 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 unsignedGetAttributesCount() const =0
Returns the count of all attributes on a node.
virtual unsignedGetAttribute(unsigned id, char * buffer, unsigned bufferLength) const =0
Gives the attribute value.
virtual unsignedGetAttribute(const char * name, char * buffer, unsigned bufferLength) const =0
Gives the attribute value.
virtual boolHasAttribute(const char * name) const =0
Returns if an attribute with name is set on the element.
virtual HTMLTagGetTag() const =0
Returns the HTML tag of the element.
virtual boolHasScriptEventListeners() const =0
Returns if the element has event listeners in JavaScript.
virtual unsignedGetValueOfElement(char * buffer, unsigned bufferLength) const =0
Gives the Value of the Element.
virtual voidGetBoundingRect(double & x, double & y, double & width, double & height) const =0
Returns position and size of the node in view coordinates.
virtual~INodeProxy()
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.

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 accommodate the value, only bufferLength bytes will be copied

Return: the size of the whole value string in bytes

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 accommodate the value, only bufferLength bytes will be copied

Return: the size of the whole value string in bytes

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.

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 accommodate the value, only bufferLength bytes will be copied

Return: the size of the whole value string in bytes

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
inline virtual ~INodeProxy()