1
0
mirror of https://github.com/Dejvino/lilybook.git synced 2024-11-14 12:23:28 +00:00
lilybook/main/modes/MainMenuMode.cpp
2020-02-02 17:14:45 +01:00

60 lines
1.2 KiB
C++

#include "core/common.h"
#include "core/buttons.h"
#include "core/display.h"
#include <EPD.h>
#include "ModeRunner.h"
#include "ReaderMode.h"
#include "InternalMemoryMenuMode.h"
#include "SdCardMenuMode.h"
#include "SettingsMenuMode.h"
#include "MainMenuMode.h"
static char* options[] = {
"Continue Reading",
"Internal Memory",
"SC Card",
"Settings"
};
void MainMenuMode::start()
{
display_refresh();
}
void MainMenuMode::finish()
{}
char* MainMenuMode::getTitle()
{
return "Main Menu";
}
char** MainMenuMode::getOptions()
{
return options;
}
int MainMenuMode::getOptionsSize()
{
return 4;
}
void MainMenuMode::onOptionSelected(int option)
{
switch (option) {
case 0: // reading
display_refresh();
getModeRunner()->startInnerMode(new ReaderMode());
return;
case 1: // memory
getModeRunner()->startInnerMode(new InternalMemoryMenuMode());
break;
case 2: // sd card
getModeRunner()->startInnerMode(new SdCardMenuMode());
break;
case 3: // settings
getModeRunner()->startInnerMode(new SettingsMenuMode());
break;
}
}