SpaIot Library
buttonsettings.h
1/*
2 * SpaIot Library (c) by epsilonrt - epsilonrt@gmail.com
3 * This file is part of SpaIot library <https://github.com/epsilonrt/spaiot-lib>
4 *
5 * SpaIot library is licensed under a
6 * Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
7 *
8 * You should have received a copy of the license along with this
9 * work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
10 *
11 * SpaIot library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY;
13 */
14#pragma once
15
16#include <map>
17#include "global.h"
18
19namespace SpaIot {
20
21 class ButtonController;
22
27 class ButtonSettings {
28 public:
32 ButtonSettings();
38 ButtonSettings (const String & controllerName, int buttonId);
44 ButtonSettings (ButtonController & controller, int buttonId);
49 const String & controllerName() const;
54 int id() const;
59 void setId (int id);
64 bool isNull() const;
69 bool operator== (const ButtonSettings &other) const;
74 bool operator!= (const ButtonSettings &other) const;
79 const ButtonController & ctrl() const;
84 ButtonController & ctrl();
85
86 private:
87 int m_id;
88 String m_ctrlName;
89 mutable ButtonController * m_ctrl;
90 };
91
95 extern const std::map<int, ButtonSettings> Scip2SspButtons;
99 extern const std::map<int, ButtonSettings> Scip2SjbButtons;
100}
SpaIot name space.
Definition: bussettings.h:21