SensESP
3.1.1
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
#include <memory>
6
7
#include "Arduino.h"
8
#include "
sensesp/system/observable.h
"
9
10
namespace
sensesp
{
11
18
class
UIButton
:
public
Observable
{
19
public
:
20
UIButton
(String title, String name,
bool
must_confirm)
21
:
title_
(title),
name_
(name),
must_confirm_
(must_confirm) {}
22
23
const
bool
get_must_confirm
() {
return
must_confirm_
; }
24
const
String
get_title
() {
return
title_
; }
25
const
String
get_name
() {
return
name_
; }
26
27
static
const
std::map<String, std::shared_ptr<UIButton>>&
get_ui_buttons
() {
28
return
ui_buttons_
;
29
}
30
31
static
UIButton
*
add
(String name, String title,
bool
must_confirm =
true
) {
32
auto
new_cmd = std::make_shared<UIButton>(title, name, must_confirm);
33
ui_buttons_
[name] = new_cmd;
34
35
return
new_cmd.get();
36
}
37
38
protected
:
39
String
title_
;
40
String
name_
;
41
bool
must_confirm_
;
42
43
static
std::map<String, std::shared_ptr<UIButton>>
ui_buttons_
;
44
};
45
46
}
// namespace sensesp
47
48
#endif
sensesp::Observable::Observable
Observable()
Definition
observable.h:18
sensesp::UIButton::get_ui_buttons
static const std::map< String, std::shared_ptr< UIButton > > & get_ui_buttons()
Definition
ui_button.h:27
sensesp::UIButton::UIButton
UIButton(String title, String name, bool must_confirm)
Definition
ui_button.h:20
sensesp::UIButton::name_
String name_
Definition
ui_button.h:40
sensesp::UIButton::title_
String title_
Definition
ui_button.h:39
sensesp::UIButton::get_must_confirm
const bool get_must_confirm()
Definition
ui_button.h:23
sensesp::UIButton::get_name
const String get_name()
Definition
ui_button.h:25
sensesp::UIButton::get_title
const String get_title()
Definition
ui_button.h:24
sensesp::UIButton::must_confirm_
bool must_confirm_
Definition
ui_button.h:41
sensesp::UIButton::add
static UIButton * add(String name, String title, bool must_confirm=true)
Definition
ui_button.h:31
sensesp::UIButton::ui_buttons_
static std::map< String, std::shared_ptr< UIButton > > ui_buttons_
Definition
ui_button.h:43
sensesp
Definition
sensesp.cpp:7
observable.h
src
sensesp
ui
ui_button.h
Generated by
1.13.2