EX-Display
EX-Display
Loading...
Searching...
No Matches
/home/runner/work/EX-Display/EX-Display/CallbackInterface.h
Go to the documentation of this file.
1/*
2 * © 2024 Peter Cole
3 *
4 * This is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * It is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this code. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#ifndef CALLBACKINTERFACE_H
19#define CALLBACKINTERFACE_H
20
21#include "InputActions.h"
22#include "Logger.h"
23#include <Arduino.h>
24
27public:
32 virtual void updateScreen(uint8_t screenId, uint8_t row, const char *text) = 0;
33
36 virtual void onInputAction(InputAction action) = 0;
37
40 void setLogger(Logger *logger) { _logger = logger; }
41
43 virtual ~CallbackInterface() = default;
44
45protected:
47 Logger *_logger = nullptr;
48};
49
50#endif // CALLBACKINTERFACE_H
InputAction
Input action to be returned from the user interface to control screens and displays.
Definition InputActions.h:22
Interface class to use for callbacks.
Definition CallbackInterface.h:26
virtual void onInputAction(InputAction action)=0
Method to implement to respond to an input action.
virtual ~CallbackInterface()=default
Virtual destructor for the CallBackInterface.
Logger * _logger
Pointer to the logger interface.
Definition CallbackInterface.h:47
void setLogger(Logger *logger)
Set the logger instance to use for diagnostic logging.
Definition CallbackInterface.h:40
virtual void updateScreen(uint8_t screenId, uint8_t row, const char *text)=0
Method to implement updating a screen.
Class to enable simple logging to a Stream object with different log levels This enables embedding pe...
Definition Logger.h:35