supla-device
Loading...
Searching...
No Matches
Supla::Html::CustomTextParameter Class Reference

This HTML Element provides input in config mode for text value. More...

#include <custom_text_parameter.h>

Inheritance diagram for Supla::Html::CustomTextParameter:
Collaboration diagram for Supla::Html::CustomTextParameter:

Public Member Functions

 CustomTextParameter (const char *paramTag, const char *paramLabel, int maxSize)
 Constructor.
 
virtual ~CustomTextParameter ()
 Destructor.
 
void send (Supla::WebSender *sender) override
 Sends HTML content.
 
bool handleResponse (const char *key, const char *value) override
 Handles HTTP request.
 
bool getParameterValue (char *result, const int maxSize)
 Returns parameter value.
 
void setParameterValue (const char *value)
 Sets parameter value and stores it in Supla::Config.
 
- Public Member Functions inherited from Supla::HtmlElement
HtmlElementnext ()
 
 HtmlElement (HtmlSection section=HTML_SECTION_FORM)
 
virtual void onProcessingEnd ()
 

Protected Attributes

char tag [SUPLA_CONFIG_MAX_KEY_SIZE] = {}
 
char * label = nullptr
 
int maxSize = 0
 
- Protected Attributes inherited from Supla::HtmlElement
HtmlElementnextPtr = nullptr
 

Additional Inherited Members

- Static Public Member Functions inherited from Supla::HtmlElement
static HtmlElementbegin ()
 
static HtmlElementlast ()
 
static const char * selected (bool isSelected)
 
static const char * checked (bool isChecked)
 
- Public Attributes inherited from Supla::HtmlElement
HtmlSection section
 
- Static Protected Attributes inherited from Supla::HtmlElement
static HtmlElementfirstPtr = nullptr
 

Detailed Description

This HTML Element provides input in config mode for text value.

You have to provide paramTag under which provided value will be stored in Supla::Storage::Config. paramLabel provides label which is displayed next to input in www.

Constructor & Destructor Documentation

◆ CustomTextParameter()

Supla::Html::CustomTextParameter::CustomTextParameter ( const char * paramTag,
const char * paramLabel,
int maxSize )

Constructor.

Parameters
paramTagname that will be used in HTML form and in Supla::Config to store value. Max length is 16 B (including \0)
paramLabellabel that will be displayed next to input
maxSizemaximum length of value

Member Function Documentation

◆ getParameterValue()

bool Supla::Html::CustomTextParameter::getParameterValue ( char * result,
const int maxSize )

Returns parameter value.

Parameters
resultbuffer to store value
maxSizesize of the buffer
Returns
true if value was found, false otherwise

◆ handleResponse()

bool Supla::Html::CustomTextParameter::handleResponse ( const char * key,
const char * value )
overridevirtual

Handles HTTP request.

Parameters
key
value
Returns
true if element processed requested key, false otherwise

Reimplemented from Supla::HtmlElement.

◆ send()

void Supla::Html::CustomTextParameter::send ( Supla::WebSender * sender)
overridevirtual

Sends HTML content.

Parameters
sender

Implements Supla::HtmlElement.

◆ setParameterValue()

void Supla::Html::CustomTextParameter::setParameterValue ( const char * value)

Sets parameter value and stores it in Supla::Config.

Parameters
valuevalue to be stored

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