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 Member Functions | Protected Member Functions | Protected Attributes | List of all members
EmbAJAXHideableContainer< NUM > Class Template Reference

A list of objects that can be hidden, completely. More...

#include <EmbAJAX.h>

Inheritance diagram for EmbAJAXHideableContainer< NUM >:
Inheritance graph
[legend]
Collaboration diagram for EmbAJAXHideableContainer< NUM >:
Collaboration graph
[legend]

Public Member Functions

 EmbAJAXHideableContainer (const char *id, EmbAJAXBase *children[NUM])
 
void print () const override
 
EmbAJAXElementfindChild (const char *id) const override
 
bool sendUpdates (uint16_t since, bool first) override
 
- Public Member Functions inherited from EmbAJAXElement
 EmbAJAXElement (const char *id)
 
const char * id () const
 
virtual const char * value (uint8_t which=EmbAJAXBase::Value) const
 
virtual bool valueNeedsEscaping (uint8_t which=EmbAJAXBase::Value) const
 
virtual const char * valueProperty (uint8_t which=EmbAJAXBase::Value) const
 
virtual void updateFromDriverArg (const char *argname)
 
EmbAJAXElementtoElement () override final
 
- Public Member Functions inherited from EmbAJAXBase
void setVisible (bool visible)
 
void setEnabled (bool enabled)
 

Protected Member Functions

void setBasicProperty (uint8_t num, bool status) override
 
- Protected Member Functions inherited from EmbAJAXElement
bool basicProperty (uint8_t num) const
 
void setChanged ()
 
bool changed (uint16_t since)
 
void printTextInput (size_t size, const char *value) const
 
- Protected Member Functions inherited from EmbAJAXBase
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)())
 

Protected Attributes

EmbAJAXContainer< NUM > _childlist
 
- Protected Attributes inherited from EmbAJAXElement
byte _flags
 
const char * _id
 

Additional Inherited Members

- Public Types inherited from EmbAJAXBase
enum  Property {
  Visibility , Enabledness , Value , FirstElementSpecificProperty ,
  HTMLAllowed
}
 
- Static Public Member Functions inherited from EmbAJAXBase
static void setDriver (EmbAJAXOutputDriverBase *driver)
 
- Static Protected Attributes inherited from EmbAJAXBase
static EmbAJAXOutputDriverBase_driver
 
static char itoa_buf [8]
 
constexpr static const char null_string [1]
 

Detailed Description

template<size_t NUM>
class EmbAJAXHideableContainer< NUM >

A list of objects that can be hidden, completely.

This is essentially an EmbAJAXContainer with an id. The one advantage that this class has other EmbAJAXContainer, is that it can be hidden completely, including any EmbAJAXStatic objects inside it. On the client, the children of this element are encapsulated in a <div> element. Other than this, it should behave identical to EmbAJAXContainer.

You do not need this class to hide an EmbAJAXContainer that contains only EmbAJAXElement derived objects, or standalone EmbAJAXElement objects.

Note
This is not a derived class of EmbAJAXContainer, to avoid adding virtual inheritance just for this.

Member Function Documentation

◆ findChild()

template<size_t NUM>
EmbAJAXElement* EmbAJAXHideableContainer< NUM >::findChild ( const char *  id) const
inlineoverridevirtual

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 from EmbAJAXBase.

◆ sendUpdates()

template<size_t NUM>
bool EmbAJAXHideableContainer< NUM >::sendUpdates ( uint16_t  since,
bool  first 
)
inlineoverridevirtual

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 from EmbAJAXElement.


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