47 lines
783 B
C++
47 lines
783 B
C++
/**
|
|
* @file menu.h
|
|
* @author Alexander Klein (alex@kleiax.de)
|
|
* @brief
|
|
* @version 0.1
|
|
* @date 2022-01-12
|
|
*
|
|
* @copyright Copyright (c) 2022
|
|
*
|
|
*/
|
|
#ifndef MENU_H
|
|
#define MENU_H
|
|
|
|
#include <list>
|
|
|
|
// Only for print in consol
|
|
// have to be deleted after display installation
|
|
#include <Arduino.h>
|
|
|
|
#include "menuEntry.h"
|
|
|
|
class MenuEntry;
|
|
class Menu {
|
|
public:
|
|
Menu();
|
|
|
|
void setParentMenu(Menu* menu);
|
|
|
|
void addEntry(MenuEntry* entry);
|
|
void printMenu();
|
|
|
|
void nextEntry();
|
|
void prevEntry();
|
|
void enterEntry();
|
|
void enterParentMenu();
|
|
|
|
private:
|
|
bool inSubmenu = false;
|
|
|
|
Menu* parentMenu;
|
|
|
|
std::list<MenuEntry*> entrys;
|
|
std::list<MenuEntry*>::iterator it;
|
|
|
|
};
|
|
|
|
#endif // MENU_H
|