2018-11-26 11:58:15 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the "bluetoothheater" distribution
|
|
|
|
* (https://gitlab.com/mrjones.id.au/bluetoothheater)
|
|
|
|
*
|
|
|
|
* Copyright (C) 2018 Ray Jones <ray@mrjones.id.au>
|
|
|
|
*
|
|
|
|
* This program 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.
|
|
|
|
*
|
|
|
|
* This program 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 program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-12-01 00:36:25 +00:00
|
|
|
#ifndef __SCREEN_MANAGER_H__
|
|
|
|
#define __SCREEN_MANAGER_H__
|
2018-11-17 02:08:22 +00:00
|
|
|
|
|
|
|
#include <Arduino.h>
|
2018-12-07 04:53:08 +00:00
|
|
|
#include <vector>
|
2018-11-17 02:08:22 +00:00
|
|
|
|
2018-11-25 04:45:17 +00:00
|
|
|
class CProtocol;
|
|
|
|
class C128x64_OLED;
|
|
|
|
class CScreen;
|
2018-11-17 02:08:22 +00:00
|
|
|
|
2018-11-25 04:45:17 +00:00
|
|
|
class CScreenManager {
|
2018-12-07 04:53:08 +00:00
|
|
|
std::vector<CScreen*> _Screens;
|
2018-11-25 04:45:17 +00:00
|
|
|
C128x64_OLED* _pDisplay;
|
|
|
|
int _currentScreen;
|
2018-11-27 10:44:47 +00:00
|
|
|
bool _bReqUpdate;
|
2018-11-25 04:45:17 +00:00
|
|
|
void _switchScreen();
|
|
|
|
public:
|
|
|
|
CScreenManager();
|
|
|
|
~CScreenManager();
|
2018-12-12 10:37:02 +00:00
|
|
|
void begin();
|
2018-12-01 18:25:10 +00:00
|
|
|
bool checkUpdate();
|
|
|
|
bool animate();
|
|
|
|
void refresh();
|
2018-11-25 04:45:17 +00:00
|
|
|
void nextScreen();
|
|
|
|
void prevScreen();
|
|
|
|
void keyHandler(uint8_t event);
|
2018-11-27 10:44:47 +00:00
|
|
|
void reqUpdate();
|
2018-11-25 04:45:17 +00:00
|
|
|
};
|
2018-11-23 10:34:37 +00:00
|
|
|
|
2018-12-01 00:36:25 +00:00
|
|
|
#endif // __SCREEN_MANAGER_H__
|