flipbip.h 2.0 KB

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