SensESP
2.7.2
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
ui_button.h
Go to the documentation of this file.
1
#ifndef _SENSESP_UI_UI_BUTTON_H_
2
#define _SENSESP_UI_UI_BUTTON_H_
3
4
#include <map>
5
6
#include "Arduino.h"
7
#include "
sensesp/system/observable.h
"
8
9
namespace
sensesp
{
10
17
class
UIButton
:
public
Observable
{
18
public
:
19
UIButton
(
String
title
,
String
name
,
bool
must_confirm
)
20
:
title_
(
title
),
name_
(
name
),
must_confirm_
(
must_confirm
) {}
21
22
const
bool
get_must_confirm
() {
return
must_confirm_
; }
23
const
String
get_title
() {
return
title_
; }
24
const
String
get_name
() {
return
name_
; }
25
26
static
const
std::map<String, UIButton*>&
get_ui_buttons
() {
27
return
ui_buttons_
;
28
}
29
30
static
UIButton
*
add
(
String
name
,
String
title
,
bool
must_confirm
=
true
) {
31
UIButton
*
new_cmd
=
new
UIButton
(
title
,
name
,
must_confirm
);
32
ui_buttons_
[
name
] =
new_cmd
;
33
34
return
new_cmd
;
35
}
36
37
protected
:
38
String
title_
;
39
String
name_
;
40
bool
must_confirm_
;
41
42
static
std::map<String, UIButton*>
ui_buttons_
;
43
};
44
45
}
// namespace sensesp
46
47
#endif
sensesp::LambdaTransform
Construct a new transform based on a single function.
Definition
lambda_transform.h:71
sensesp::Observable
A base class which allow observers to attach callbacks to themselves. The callbacks will be called wh...
Definition
observable.h:16
sensesp::UIButton
UIButton implements a button interface on the web UI.
Definition
ui_button.h:17
sensesp::UIButton::get_ui_buttons
static const std::map< String, UIButton * > & get_ui_buttons()
Definition
ui_button.h:26
sensesp::UIButton::UIButton
UIButton(String title, String name, bool must_confirm)
Definition
ui_button.h:19
sensesp::UIButton::name_
String name_
Definition
ui_button.h:39
sensesp::UIButton::title_
String title_
Definition
ui_button.h:38
sensesp::UIButton::get_must_confirm
const bool get_must_confirm()
Definition
ui_button.h:22
sensesp::UIButton::ui_buttons_
static std::map< String, UIButton * > ui_buttons_
Definition
ui_button.h:42
sensesp::UIButton::get_name
const String get_name()
Definition
ui_button.h:24
sensesp::UIButton::get_title
const String get_title()
Definition
ui_button.h:23
sensesp::UIButton::must_confirm_
bool must_confirm_
Definition
ui_button.h:40
sensesp::UIButton::add
static UIButton * add(String name, String title, bool must_confirm=true)
Definition
ui_button.h:30
sensesp
Definition
sensesp.h:22
observable.h
src
sensesp
ui
ui_button.h
Generated by
1.9.8