flipbip.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #pragma once
  2. #include <furi.h>
  3. #include <furi_hal.h>
  4. #include <gui/gui.h>
  5. #include <input/input.h>
  6. #include <stdlib.h>
  7. #include <notification/notification_messages.h>
  8. #include <gui/view_dispatcher.h>
  9. #include <gui/modules/submenu.h>
  10. #include <gui/scene_manager.h>
  11. #include <gui/modules/variable_item_list.h>
  12. #include <gui/modules/text_input.h>
  13. #include "scenes/flipbip_scene.h"
  14. #include "views/flipbip_startscreen.h"
  15. #include "views/flipbip_scene_1.h"
  16. #define FLIPBIP_VERSION "v1.11.0"
  17. #define COIN_BTC 0
  18. #define COIN_DOGE 3
  19. #define COIN_ETH 60
  20. #define COIN_ZEC 133
  21. #define TEXT_BUFFER_SIZE 256
  22. typedef struct {
  23. Gui* gui;
  24. NotificationApp* notification;
  25. ViewDispatcher* view_dispatcher;
  26. Submenu* submenu;
  27. SceneManager* scene_manager;
  28. VariableItemList* variable_item_list;
  29. TextInput* text_input;
  30. FlipBipStartscreen* flipbip_startscreen;
  31. FlipBipScene1* flipbip_scene_1;
  32. // Settings options
  33. int haptic;
  34. int led;
  35. int bip39_strength;
  36. int passphrase;
  37. // Main menu options
  38. int bip44_coin;
  39. int overwrite_saved_seed;
  40. int import_from_mnemonic;
  41. // Text input
  42. int input_state;
  43. char passphrase_text[TEXT_BUFFER_SIZE];
  44. char import_mnemonic_text[TEXT_BUFFER_SIZE];
  45. char input_text[TEXT_BUFFER_SIZE];
  46. } FlipBip;
  47. typedef enum {
  48. FlipBipViewIdStartscreen,
  49. FlipBipViewIdMenu,
  50. FlipBipViewIdScene1,
  51. FlipBipViewIdSettings,
  52. FlipBipViewIdTextInput,
  53. } FlipBipViewId;
  54. typedef enum {
  55. FlipBipHapticOff,
  56. FlipBipHapticOn,
  57. } FlipBipHapticState;
  58. typedef enum {
  59. FlipBipLedOff,
  60. FlipBipLedOn,
  61. } FlipBipLedState;
  62. typedef enum {
  63. FlipBipStrength128,
  64. FlipBipStrength192,
  65. FlipBipStrength256,
  66. } FlipBipStrengthState;
  67. typedef enum {
  68. FlipBipPassphraseOff,
  69. FlipBipPassphraseOn,
  70. } FlipBipPassphraseState;
  71. typedef enum {
  72. FlipBipCoinBTC0,
  73. FlipBipCoinETH60,
  74. FlipBipCoinDOGE3,
  75. FlipBipCoinZEC133,
  76. } FlipBipCoin;
  77. typedef enum {
  78. FlipBipTextInputDefault,
  79. FlipBipTextInputPassphrase,
  80. FlipBipTextInputMnemonic
  81. } FlipBipTextInputState;
  82. typedef enum {
  83. FlipBipStatusSuccess = 0,
  84. FlipBipStatusReturn = 10,
  85. FlipBipStatusLoadError = 11,
  86. FlipBipStatusSaveError = 12,
  87. FlipBipStatusMnemonicCheckError = 13,
  88. } FlipBipStatus;