EmbAJAX
Simplistic framework for creating and handling displays and controls on a web page served by an embeddable device (Arduino or other microcontroller with Arduino support).
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | Friends | List of all members
EmbAJAXBase Class Referenceabstract

Abstract base class for anything shown on an EmbAJAXPage. More...

#include <EmbAJAX.h>

Inheritance diagram for EmbAJAXBase:
Inheritance graph
[legend]
Collaboration diagram for EmbAJAXBase:
Collaboration graph
[legend]

Public Types

enum  Property {
  Visibility , Enabledness , Value , FirstElementSpecificProperty ,
  HTMLAllowed
}
 

Public Member Functions

virtual void print () const =0
 
virtual bool sendUpdates (uint16_t since, bool first)
 
virtual EmbAJAXElementtoElement ()
 
void setVisible (bool visible)
 
void setEnabled (bool enabled)
 
virtual EmbAJAXElementfindChild (const char *id) const
 

Static Public Member Functions

static void setDriver (EmbAJAXOutputDriverBase *driver)
 

Protected Member Functions

virtual void setBasicProperty (uint8_t num, bool status)
 
void printChildren (EmbAJAXBase **children, size_t num) const
 
bool sendUpdates (EmbAJAXBase **children, size_t num, uint16_t since, bool first)
 
EmbAJAXElementfindChild (EmbAJAXBase **children, size_t num, const char *id) const
 
void printPage (EmbAJAXBase **children, size_t num, const char *_title, const char *_header, uint16_t _min_interval) const
 
void handleRequest (EmbAJAXBase **children, size_t num, void(*change_callback)())
 

Static Protected Attributes

static EmbAJAXOutputDriverBase_driver
 
static char itoa_buf [8]
 
constexpr static const char null_string [1]
 

Friends

template<size_t NUM>
class EmbAJAXContainer
 

Detailed Description

Abstract base class for anything shown on an EmbAJAXPage.

Anything that can be displayed on an EmbAJAXPage will have to inherit from this class (or be wrapped in something inherited from this class

See also
EmbAJAXStatic).

Member Function Documentation

◆ findChild() [1/2]

virtual EmbAJAXElement* EmbAJAXBase::findChild ( const char *  id) const
inlinevirtual

Find child element of this one, with the given id. Returns 0, if this is not a container, or does not have such a child.

See also
EmbAJAXContainer, and
EmbAJAXHideableContainer.

Reimplemented in EmbAJAXContainer< NUM >, and EmbAJAXHideableContainer< NUM >.

◆ findChild() [2/2]

EmbAJAXElement * EmbAJAXBase::findChild ( EmbAJAXBase **  children,
size_t  num,
const char *  id 
) const
protected

Filthy trick to keep (template) implementation out of the header. See EmbAJAXContainer::findChild()

◆ handleRequest()

void EmbAJAXBase::handleRequest ( EmbAJAXBase **  children,
size_t  num,
void(*)()  change_callback 
)
protected

Filthy trick to keep (template) implementation out of the header. See EmbAJAXPage::handleRequest()

◆ printChildren()

void EmbAJAXBase::printChildren ( EmbAJAXBase **  children,
size_t  num 
) const
protected

Filthy trick to keep (template) implementation out of the header. See EmbAJAXContainer::printChildren()

◆ printPage()

void EmbAJAXBase::printPage ( EmbAJAXBase **  children,
size_t  num,
const char *  _title,
const char *  _header,
uint16_t  _min_interval 
) const
protected

Filthy trick to keep (template) implementation out of the header. See EmbAJAXPage::print()

◆ sendUpdates() [1/2]

bool EmbAJAXBase::sendUpdates ( EmbAJAXBase **  children,
size_t  num,
uint16_t  since,
bool  first 
)
protected

Filthy trick to keep (template) implementation out of the header. See EmbAJAXContainer::sendUpdates()

◆ sendUpdates() [2/2]

virtual bool EmbAJAXBase::sendUpdates ( uint16_t  since,
bool  first 
)
inlinevirtual

serialize pending changes for the client. Virtual so you could customize it, completely, but instead you probably want to override EmbAJAXElement::valueProperty(), only, instead.

Parameters
sincerevision number last sent to the server. Send only changes that occured since this revision.
firstif false, and this object writes any update, it should write a ',', first.
Returns
true if anything has been written, false otherwise.

Reimplemented in EmbAJAXHideableContainer< NUM >, EmbAJAXContainer< NUM >, and EmbAJAXElement.

◆ setDriver()

static void EmbAJAXBase::setDriver ( EmbAJAXOutputDriverBase driver)
inlinestatic

Set the driver. You do not have to call this, except if you actually want to switch between several drivers at runtime.

◆ setEnabled()

void EmbAJAXBase::setEnabled ( bool  enabled)
inline

Set enabledness state of this element. Note not all EmbAJAXBase-objects support this. Importantly, EmbAJAXStatic does not. Provided in the base class for efficiency.

◆ setVisible()

void EmbAJAXBase::setVisible ( bool  visible)
inline

Set visibility of this element. Note not all EmbAJAXBase-objects support this. Importantly, EmbAJAXStatic does not. Provided in the base class for efficiency.

◆ toElement()

virtual EmbAJAXElement* EmbAJAXBase::toElement ( )
inlinevirtual

Cast this object to EmbAJAXElement if it is a controllable element.

Returns
0, if this is not a controllable element.

Reimplemented in EmbAJAXElement.


The documentation for this class was generated from the following files: