2021-06-02 15:16:05 +00:00
|
|
|
#pragma once
|
2022-02-24 11:59:36 +00:00
|
|
|
#include <gui/modules/button_menu.h>
|
|
|
|
#include <gui/modules/text_input.h>
|
|
|
|
#include <gui/view_stack.h>
|
|
|
|
#include <gui/modules/button_panel.h>
|
2021-06-02 15:16:05 +00:00
|
|
|
#include <furi.h>
|
|
|
|
#include <gui/view_dispatcher.h>
|
|
|
|
#include <gui/modules/dialog_ex.h>
|
|
|
|
#include <gui/modules/submenu.h>
|
|
|
|
#include <gui/modules/popup.h>
|
2022-02-24 11:59:36 +00:00
|
|
|
#include <gui/modules/loading.h>
|
|
|
|
|
|
|
|
#include "irda_app_event.h"
|
|
|
|
#include "view/irda_progress_view.h"
|
2021-06-02 15:16:05 +00:00
|
|
|
|
|
|
|
class IrdaAppViewManager {
|
|
|
|
public:
|
|
|
|
enum class ViewType : uint8_t {
|
|
|
|
DialogEx,
|
|
|
|
TextInput,
|
|
|
|
Submenu,
|
|
|
|
ButtonMenu,
|
2022-02-24 11:59:36 +00:00
|
|
|
UniversalRemote,
|
2021-06-02 15:16:05 +00:00
|
|
|
Popup,
|
|
|
|
};
|
|
|
|
|
|
|
|
IrdaAppViewManager();
|
|
|
|
~IrdaAppViewManager();
|
|
|
|
|
|
|
|
void switch_to(ViewType type);
|
|
|
|
|
|
|
|
void receive_event(IrdaAppEvent* event);
|
|
|
|
void send_event(IrdaAppEvent* event);
|
2021-07-22 00:07:00 +00:00
|
|
|
void clear_events();
|
2021-06-02 15:16:05 +00:00
|
|
|
|
|
|
|
DialogEx* get_dialog_ex();
|
|
|
|
Submenu* get_submenu();
|
|
|
|
Popup* get_popup();
|
|
|
|
TextInput* get_text_input();
|
|
|
|
ButtonMenu* get_button_menu();
|
2021-06-25 13:52:27 +00:00
|
|
|
ButtonPanel* get_button_panel();
|
2022-02-24 11:59:36 +00:00
|
|
|
ViewStack* get_universal_view_stack();
|
|
|
|
IrdaProgressView* get_progress();
|
|
|
|
Loading* get_loading();
|
2021-06-02 15:16:05 +00:00
|
|
|
|
|
|
|
osMessageQueueId_t get_event_queue();
|
|
|
|
|
|
|
|
uint32_t previous_view_callback(void* context);
|
|
|
|
|
|
|
|
private:
|
|
|
|
ViewDispatcher* view_dispatcher;
|
|
|
|
Gui* gui;
|
|
|
|
TextInput* text_input;
|
|
|
|
DialogEx* dialog_ex;
|
|
|
|
Submenu* submenu;
|
|
|
|
Popup* popup;
|
|
|
|
ButtonMenu* button_menu;
|
2021-06-25 13:52:27 +00:00
|
|
|
ButtonPanel* button_panel;
|
2022-02-24 11:59:36 +00:00
|
|
|
ViewStack* universal_view_stack;
|
|
|
|
IrdaProgressView* progress_view;
|
|
|
|
Loading* loading_view;
|
2021-06-02 15:16:05 +00:00
|
|
|
|
|
|
|
osMessageQueueId_t event_queue;
|
|
|
|
|
|
|
|
void add_view(ViewType view_type, View* view);
|
|
|
|
};
|