SpaIot Library
Loading...
Searching...
No Matches
buttonsettings.h
1/*
2 SpaIot Library (c) by epsilonrt - epsilonrt@epsilonrt.fr
3 This file is part of SpaIot library <https://github.com/epsilonrt/spaiot-lib>
4
5 SPDX-License-Identifier: BSD-3-Clause
6
7 SpaIot library is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY;
9*/
10#pragma once
11
12#include <Arduino.h>
13#include <map>
14#include "buttoncontroller.h"
15
16namespace SpaIot {
17
18 class ButtonController;
19
28 public:
29
34
38 virtual ~ButtonSettings();
39
45 ButtonSettings (const String &controllerName, int buttonId);
46
52 ButtonSettings (ButtonController &controller, int buttonId);
53
58
64
69
75
80 void clear();
81
85 bool isNull() const;
86
90 bool isEmpty() const;
91
95 bool operator== (const ButtonSettings &other) const;
96
100 bool operator!= (const ButtonSettings &other) const;
101
105 const String &controllerName() const;
106
110 int id() const;
111
115 void setId (int id);
116
120 const ButtonController &ctrl() const;
121
126
127 protected:
128 class Private;
129 ButtonSettings (Private &dd);
130 std::unique_ptr<Private> d_ptr;
131 private:
132 PIMPL_DECLARE_PRIVATE (ButtonSettings)
133 };
134
161 extern const std::map<int, ButtonSettings> Scip2SspButtons;
162
183 extern const std::map<int, ButtonSettings> SpaIot8266SspButtons;
184
205 extern const std::map<int, ButtonSettings> SpaIot32SspButtons;
206
227 extern const std::map<int, ButtonSettings> SpaIotS3SspButtons;
228
254 extern const std::map<int, ButtonSettings> SpaIot8574SspButtons;
255
278 extern const std::map<int, ButtonSettings> Scip2SjbButtons;
279
302 extern const std::map<int, ButtonSettings> SpaIot8266SjbButtons;
303
326 extern const std::map<int, ButtonSettings> SpaIot32SjbButtons;
327
350 extern const std::map<int, ButtonSettings> SpaIotS3SjbButtons;
351
379 extern const std::map<int, ButtonSettings> SpaIot8574SjbButtons;
380
383}
This class is the base class of all button controllers.
Definition buttoncontroller.h:26
This class represents the settings of a button.
Definition buttonsettings.h:27
virtual ~ButtonSettings()
Destructor.
ButtonSettings(const String &controllerName, int buttonId)
The constructor for the ButtonSettings class takes two parameters.
ButtonSettings(ButtonController &controller, int buttonId)
The constructor for the ButtonSettings class takes two parameters.
bool operator==(const ButtonSettings &other) const
Checks if the two objects are equal.
bool isNull() const
Returns true if the object is null (i.e. it has not been initialized, d_ptr is null)
const ButtonController & ctrl() const
Returns the button controller used by the button.
ButtonSettings & operator=(const ButtonSettings &other)
Sets the ButtonSettings object to be equal to other.
bool operator!=(const ButtonSettings &other) const
Checks if the two objects are not equal.
ButtonSettings(const ButtonSettings &other)
Copy Constructor.
ButtonSettings(ButtonSettings &&other)
Move Constructor after the move, other is null, other.clear() must be called if it is to be used agai...
int id() const
Returns the id of the button.
void setId(int id)
Sets the identifier of the button.
ButtonController & ctrl()
Returns the button controller used by the button.
bool isEmpty() const
Checks if all attributes are set to their default values (same as the default constructor)
void clear()
Clears the ButtonSettings object After the call to this function, the ButtonSettings object is the sa...
const String & controllerName() const
Returns the name of the controller.
ButtonSettings()
The default constructor.
const std::map< int, ButtonSettings > SpaIotS3SspButtons
ButtonSettings for the SSP Spa with SpaIot board (ESP32 S3 version)
const std::map< int, ButtonSettings > SpaIot8266SjbButtons
ButtonSettings for the SJB Spa with SpaIot board (ESP8266 version)
const std::map< int, ButtonSettings > SpaIot8266SspButtons
ButtonSettings for the SSP Spa with SpaIot board (ESP8266 version)
const std::map< int, ButtonSettings > SpaIotS3SjbButtons
ButtonSettings for the SJB Spa with SpaIot board (ESP32 S3 version)
const std::map< int, ButtonSettings > Scip2SspButtons
ButtonSettings for the SSP Spa with Scip2 board.
const std::map< int, ButtonSettings > SpaIot8574SjbButtons
ButtonSettings for the SJB Spa with SpaIot Extended board with PCF8574A.
const std::map< int, ButtonSettings > SpaIot32SspButtons
ButtonSettings for the SSP Spa with SpaIot board (ESP32 version)
const std::map< int, ButtonSettings > SpaIot8574SspButtons
ButtonSettings for the SSP Spa with SpaIot Extended board with PCF8574A.
const std::map< int, ButtonSettings > Scip2SjbButtons
ButtonSettings for the SJB Spa with Scip2 board.
const std::map< int, ButtonSettings > SpaIot32SjbButtons
ButtonSettings for the SJB Spa with SpaIot board (ESP32 version)
SpaIot name space.
Definition bussettings.h:15