#pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include "view/container_vm.h" #include #include #include #include "helpers/rfid_worker.h" class LfRfidApp { public: enum class EventType : uint8_t { GENERIC_EVENT_ENUM_VALUES, Next, MenuSelected, Stay, Retry, }; enum class SceneType : uint8_t { GENERIC_SCENE_ENUM_VALUES, Read, ReadSuccess, RetryConfirm, ExitConfirm, ReadKeyMenu, Write, WriteSuccess, Emulate, SaveName, SaveSuccess, SelectKey, SavedKeyMenu, SaveData, SaveType, SavedInfo, DeleteConfirm, DeleteSuccess, }; class Event { public: union { int32_t menu_index; } payload; EventType type; }; SceneController, LfRfidApp> scene_controller; ViewController view_controller; ~LfRfidApp(); LfRfidApp(); RecordController notification; RecordController storage; RecordController dialogs; RfidWorker worker; TextStore text_store; void run(void* args); static const char* app_folder; static const char* app_extension; static const char* app_filetype; bool save_key(RfidKey* key); bool load_key_from_file_select(bool need_restore); bool delete_key(RfidKey* key); bool load_key_data(const char* path, RfidKey* key); bool save_key_data(const char* path, RfidKey* key); void make_app_folder(); };