flipperzero-firmware/applications/accessor/accessor-app.h
Skorpionm e17336498d
[FL-1756, FL-1769, FL-1776, FL-1759] Gui: input events complementary V3, refactoring. SubGhz: read/emulate fixes. Cleanup. (#684)
* Gui: move rotation logic to ViewPort, replace delayed View switch in ViewDispatcher with event filtering and redirection to previous view.
* SubGhz: add function description
* Gui, Input: add event id to input events.
* SubGhz: fix "crashing on ?"
* SubGhz: add icon scanning
* SubGhz: updated interface read scene,  updated interface config scene
* Assets: update subghz assets
* SubGhz:  replaced the picture in the read scene, changed the paths to additional files
* SubGhz: fix deadlock in timer callback
* SubGhz: fix icon read scene
* SubGhz: fix icon read scene
* SubGhz: fix duble text transmitter scene
* SubGhz: correct spelling. Gui: bigger queue for ViewDispatcher.
* SubGhz: fix creation and transmission of dynamic code without the presence of a manufactory key
* SubGhz: fix keelog, setting a name in the absence of a manufactory key
* SubGhz: fix load bad keelog key
* Format sources
* Furi: remove garbage from core. GpioTester: fix memory leak and cleanup
* Accessor: remove obsolete notification code
* MusicPlayer: remove input event injection
* Input: rename id to sequence

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2021-09-02 00:05:00 +03:00

58 lines
1.3 KiB
C++

#pragma once
#include <map>
#include <list>
#include "accessor-view-manager.h"
#include "scene/accessor-scene-start.h"
#include "helpers/wiegand.h"
#include <one_wire_master.h>
#include <notification/notification-messages.h>
class AccessorApp {
public:
void run(void);
AccessorApp();
~AccessorApp();
enum class Scene : uint8_t {
Exit,
Start,
};
AccessorAppViewManager* get_view_manager();
void switch_to_next_scene(Scene index);
void search_and_switch_to_previous_scene(std::initializer_list<Scene> scenes_list);
bool switch_to_previous_scene(uint8_t count = 1);
Scene get_previous_scene();
void notify_green_blink();
void notify_success();
char* get_text_store();
uint8_t get_text_store_size();
void set_text_store(const char* text...);
WIEGAND* get_wiegand();
OneWireMaster* get_one_wire();
private:
std::list<Scene> previous_scenes_list = {Scene::Exit};
Scene current_scene = Scene::Start;
AccessorAppViewManager view;
std::map<Scene, AccessorScene*> scenes = {
{Scene::Start, new AccessorSceneStart()},
};
static const uint8_t text_store_size = 128;
char text_store[text_store_size + 1];
WIEGAND wiegand;
OneWireMaster onewire_master;
NotificationApp* notification;
};