-
Notifications
You must be signed in to change notification settings - Fork 2
/
UploaderUI.h
62 lines (56 loc) · 1.11 KB
/
UploaderUI.h
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
#ifndef ARDUINO_UPLOADERUI_H
#define ARDUINO_UPLOADERUI_H
#include "SerialUploader.h"
class UIChoices
{
public:
virtual void prompt(Print &display) = 0;
virtual bool hasNext() = 0;
virtual void next(Print &display) = 0;
virtual void next() = 0;
};
class UploaderUI : public Print
{
public:
virtual int8_t choose(UIChoices &choices);
virtual bool begin() = 0;
virtual void end()
{};
};
#endif //ARDUINO_UPLOADERUI_H
//
//class ArrayChoice : public UIChoices
//{
//public:
// ArrayChoice(FString prompt, uint8_t count, FString *entries) :
// _prompt(prompt), _count(count), _entries(entries), _next(0) {}
//
//public:
//
// void prompt(Print &display) override
// {
// display.print(_prompt);
// }
//
// boolean hasNext() override
// {
// return _next < _count;
// }
//
// void next(Print &display) override
// {
// display.println(_entries[_next++]);
// }
//
// void next() override
// {
// _next++;
// }
//
//private:
// uint8_t _count;
// uint8_t _next;
// FString _prompt;
// FString *_entries;
//
//};