mfc_editor_app_i.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #pragma once
  2. #include <furi.h>
  3. #include <dialogs/dialogs.h>
  4. #include <gui/gui.h>
  5. #include <gui/scene_manager.h>
  6. #include <gui/view_dispatcher.h>
  7. #include <gui/modules/popup.h>
  8. #include <gui/modules/submenu.h>
  9. #include <nfc/nfc.h>
  10. #include <nfc/nfc_device.h>
  11. #include <nfc/protocols/mf_classic/mf_classic.h>
  12. #include <storage/storage.h>
  13. #include "mfc_editor_app.h"
  14. #include "mfc_editor_icons.h"
  15. #include "scenes/mfc_editor_scene.h"
  16. #define TAG "MFCEditor"
  17. #define NFC_APP_FOLDER ANY_PATH("nfc")
  18. #define NFC_APP_EXTENSION ".nfc"
  19. #define NFC_APP_SHADOW_EXTENSION ".shd"
  20. enum MfcEditorCustomEvent {
  21. // Reserve first 100 events for button types and indexes, starting from 0
  22. MfcEditorCustomEventReserved = 100,
  23. MfcEditorCustomEventViewExit,
  24. };
  25. struct MfcEditorApp {
  26. ViewDispatcher* view_dispatcher;
  27. SceneManager* scene_manager;
  28. Gui* gui;
  29. Storage* storage;
  30. DialogsApp* dialogs;
  31. Submenu* submenu;
  32. Popup* popup;
  33. NfcDevice* nfc_device;
  34. FuriString* file_path;
  35. };
  36. typedef enum {
  37. MfcEditorAppViewSubmenu,
  38. MfcEditorAppViewPopup,
  39. } MfcEditorAppView;
  40. typedef enum {
  41. // Generic
  42. MfcEditorPromptResponseSuccess,
  43. MfcEditorPromptResponseFailure,
  44. // Backed out of a prompt
  45. MfcEditorPromptResponseExitedFile,
  46. MfcEditorPromptResponseExitedShadow,
  47. } MfcEditorPromptResponse;
  48. MfcEditorPromptResponse mfc_editor_prompt_load_file(MfcEditorApp* instance);
  49. bool mfc_editor_load_file(MfcEditorApp* instance, FuriString* file_path, bool show_dialog);