2021-06-02 18:16:05 +03:00
|
|
|
#pragma once
|
|
|
|
#include "../irda-app.hpp"
|
|
|
|
#include <api-hal-irda.h>
|
|
|
|
#include "irda.h"
|
|
|
|
#include <gui/elements.h>
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
class IrdaApp;
|
|
|
|
|
|
|
|
class IrdaAppScene {
|
|
|
|
public:
|
|
|
|
virtual void on_enter(IrdaApp* app) = 0;
|
|
|
|
virtual bool on_event(IrdaApp* app, IrdaAppEvent* event) = 0;
|
|
|
|
virtual void on_exit(IrdaApp* app) = 0;
|
|
|
|
virtual ~IrdaAppScene(){};
|
|
|
|
|
|
|
|
private:
|
|
|
|
};
|
|
|
|
|
|
|
|
class IrdaAppSceneStart : public IrdaAppScene {
|
|
|
|
public:
|
|
|
|
void on_enter(IrdaApp* app) final;
|
|
|
|
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
|
|
|
void on_exit(IrdaApp* app) final;
|
2021-06-09 16:04:49 +03:00
|
|
|
private:
|
|
|
|
uint32_t submenu_item_selected = 0;
|
2021-06-02 18:16:05 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
class IrdaAppSceneUniversal : public IrdaAppScene {
|
|
|
|
public:
|
|
|
|
void on_enter(IrdaApp* app) final;
|
|
|
|
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
|
|
|
void on_exit(IrdaApp* app) final;
|
2021-06-09 16:04:49 +03:00
|
|
|
private:
|
|
|
|
uint32_t submenu_item_selected = 0;
|
2021-06-02 18:16:05 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
class IrdaAppSceneLearn : public IrdaAppScene {
|
|
|
|
public:
|
|
|
|
void on_enter(IrdaApp* app) final;
|
|
|
|
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
|
|
|
void on_exit(IrdaApp* app) final;
|
|
|
|
};
|
|
|
|
|
|
|
|
class IrdaAppSceneLearnSuccess : public IrdaAppScene {
|
|
|
|
public:
|
|
|
|
void on_enter(IrdaApp* app) final;
|
|
|
|
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
|
|
|
void on_exit(IrdaApp* app) final;
|
|
|
|
};
|
|
|
|
|
|
|
|
class IrdaAppSceneLearnEnterName : public IrdaAppScene {
|
|
|
|
public:
|
|
|
|
void on_enter(IrdaApp* app) final;
|
|
|
|
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
|
|
|
void on_exit(IrdaApp* app) final;
|
|
|
|
};
|
|
|
|
|
|
|
|
class IrdaAppSceneLearnDone : public IrdaAppScene {
|
|
|
|
public:
|
|
|
|
void on_enter(IrdaApp* app) final;
|
|
|
|
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
|
|
|
void on_exit(IrdaApp* app) final;
|
|
|
|
};
|
|
|
|
|
|
|
|
class IrdaAppSceneLearnDoneAfter : public IrdaAppScene {
|
|
|
|
public:
|
|
|
|
void on_enter(IrdaApp* app) final;
|
|
|
|
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
|
|
|
void on_exit(IrdaApp* app) final;
|
|
|
|
};
|
|
|
|
|
|
|
|
class IrdaAppSceneRemote : public IrdaAppScene {
|
|
|
|
public:
|
|
|
|
void on_enter(IrdaApp* app) final;
|
|
|
|
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
|
|
|
void on_exit(IrdaApp* app) final;
|
|
|
|
private:
|
|
|
|
std::vector<std::string> buttons_names;
|
2021-06-09 16:04:49 +03:00
|
|
|
uint32_t buttonmenu_item_selected = 0;
|
2021-06-02 18:16:05 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
class IrdaAppSceneRemoteList : public IrdaAppScene {
|
|
|
|
public:
|
|
|
|
void on_enter(IrdaApp* app) final;
|
|
|
|
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
|
|
|
void on_exit(IrdaApp* app) final;
|
2021-06-09 16:04:49 +03:00
|
|
|
private:
|
|
|
|
uint32_t submenu_item_selected = 0;
|
2021-06-02 18:16:05 +03:00
|
|
|
std::vector<std::string> remote_names;
|
|
|
|
};
|
|
|
|
|
|
|
|
class IrdaAppSceneEdit : public IrdaAppScene {
|
|
|
|
public:
|
|
|
|
void on_enter(IrdaApp* app) final;
|
|
|
|
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
|
|
|
void on_exit(IrdaApp* app) final;
|
2021-06-09 16:04:49 +03:00
|
|
|
private:
|
|
|
|
uint32_t submenu_item_selected = 0;
|
2021-06-02 18:16:05 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
class IrdaAppSceneEditKeySelect : public IrdaAppScene {
|
|
|
|
public:
|
|
|
|
void on_enter(IrdaApp* app) final;
|
|
|
|
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
|
|
|
void on_exit(IrdaApp* app) final;
|
|
|
|
private:
|
|
|
|
std::vector<std::string> buttons_names;
|
|
|
|
};
|
|
|
|
|
|
|
|
class IrdaAppSceneEditRename : public IrdaAppScene {
|
|
|
|
public:
|
|
|
|
void on_enter(IrdaApp* app) final;
|
|
|
|
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
|
|
|
void on_exit(IrdaApp* app) final;
|
|
|
|
};
|
|
|
|
|
|
|
|
class IrdaAppSceneEditDelete : public IrdaAppScene {
|
|
|
|
public:
|
|
|
|
void on_enter(IrdaApp* app) final;
|
|
|
|
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
|
|
|
void on_exit(IrdaApp* app) final;
|
|
|
|
};
|
|
|
|
|
|
|
|
class IrdaAppSceneEditRenameDone : public IrdaAppScene {
|
|
|
|
public:
|
|
|
|
void on_enter(IrdaApp* app) final;
|
|
|
|
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
|
|
|
void on_exit(IrdaApp* app) final;
|
|
|
|
};
|
|
|
|
|
|
|
|
class IrdaAppSceneEditDeleteDone : public IrdaAppScene {
|
|
|
|
public:
|
|
|
|
void on_enter(IrdaApp* app) final;
|
|
|
|
bool on_event(IrdaApp* app, IrdaAppEvent* event) final;
|
|
|
|
void on_exit(IrdaApp* app) final;
|
|
|
|
};
|
|
|
|
|