Repository navigation
Expand file tree
/
Copy pathInputManager.h
More file actions
69 lines (56 loc) · 2.13 KB
/
Copy pathInputManager.h
File metadata and controls
69 lines (56 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
* © 2024 Peter Cole
*
* This is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* It is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this code. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef INPUTMANAGER_H
#define INPUTMANAGER_H
#include "CallbackInterface.h"
#include "Defines.h"
#include "DisplayInterface.h"
#include "InputInterface.h"
#include "Logger.h"
class InputManager {
public:
/// @brief Constructor for the InputManager
InputManager();
/// @brief Call once to create the InputInterface derived input
void createInput();
/// @brief Set the InputInterface
/// @param input Pointer to the InputInterface
void addInput(InputInterface *input);
/// @brief Get the configured InputInterface
/// @return Pointer to the input
InputInterface *getInput();
/// @brief Set the display interface to retrieve required attributes - note this should only be required for TFT_eSPI
/// touch screens that share the same instance between display and touch
/// @param display Pointer to the DisplayInterface
void setDisplay(DisplayInterface *display);
/// @brief Start the configured input - calls the InputInterface::begin() method
void startInput();
/// @brief Set the Logger instance
/// @param logger Pointer to the Logger
void setLogger(Logger *logger);
/// @brief Set the CallbackInterface derived instance for user input to use for callbacks
/// @param callback Pointer to the instance
void setCallback(CallbackInterface *callback);
/// @brief Destructor for the InputManager
~InputManager();
private:
DisplayInterface *_display;
InputInterface *_input;
Logger *_logger;
CallbackInterface *_callback;
};
#endif // INPUTMANAGER_H