supla-device
Loading...
Searching...
No Matches
custom_text_parameter.h
1// SPDX-FileCopyrightText: AC SOFTWARE SP. Z O.O.
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#ifndef SRC_SUPLA_NETWORK_HTML_CUSTOM_TEXT_PARAMETER_H_
5#define SRC_SUPLA_NETWORK_HTML_CUSTOM_TEXT_PARAMETER_H_
6
7#include <supla/network/html_element.h>
8#include <supla/storage/config.h>
9#include <stdint.h>
10
11namespace Supla {
12
13namespace Html {
14
22 public:
32 const char *paramTag, const char *paramLabel, int maxSize);
33
37 virtual ~CustomTextParameter();
38
44 void send(Supla::WebSender* sender) override;
45
54 bool handleResponse(const char* key, const char* value) override;
55
64 bool getParameterValue(char *result, const int maxSize);
65
71 void setParameterValue(const char *value);
72
73 protected:
74 char tag[SUPLA_CONFIG_MAX_KEY_SIZE] = {};
75 char *label = nullptr;
76 int maxSize = 0;
77};
78
79}; // namespace Html
80}; // namespace Supla
81
82#endif // SRC_SUPLA_NETWORK_HTML_CUSTOM_TEXT_PARAMETER_H_
Definition html_element.h:22
This HTML Element provides input in config mode for text value.
Definition custom_text_parameter.h:21
void send(Supla::WebSender *sender) override
Sends HTML content.
Definition custom_text_parameter.cpp:39
bool getParameterValue(char *result, const int maxSize)
Returns parameter value.
Definition custom_text_parameter.cpp:67
virtual ~CustomTextParameter()
Destructor.
Definition custom_text_parameter.cpp:32
bool handleResponse(const char *key, const char *value) override
Handles HTTP request.
Definition custom_text_parameter.cpp:59
void setParameterValue(const char *value)
Sets parameter value and stores it in Supla::Config.
Definition custom_text_parameter.cpp:77
CustomTextParameter(const char *paramTag, const char *paramLabel, int maxSize)
Constructor.
Definition custom_text_parameter.cpp:19
Definition web_sender.h:160