OMOTE/Platformio/OmoteUI/core/ScreenManager.hpp

33 lines
717 B
C++
Raw Normal View History

2023-10-22 14:35:49 -04:00
#pragma once
#include "PageBase.hpp"
#include "ScreenBase.hpp"
#include <memory>
#include <vector>
namespace UI::Screen {
class Manager {
public:
static Manager &getInstance();
void pushScreen(Screen::Base::Ptr aScreen);
void pushScreen(Screen::Base::Ptr aScreen,
lv_scr_load_anim_t aPushAnimationOverride);
void
pushPopUp(UI::Page::Base::Ptr aPopUpPage,
lv_scr_load_anim_t aPushAnimation = LV_SCR_LOAD_ANIM_OVER_LEFT);
Screen::Base::Ptr popScreen(Screen::Base *aScreenToRemove);
bool distributeKeyEvent(KeyPressAbstract::KeyEvent aKeyEvent);
private:
Manager();
static Manager mManager;
std::vector<Screen::Base::Ptr> mScreens;
};
} // namespace UI::Screen