flipbip.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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.12.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 led;
  33. int bip39_strength;
  34. int passphrase;
  35. // Main menu options
  36. int bip44_coin;
  37. int overwrite_saved_seed;
  38. int import_from_mnemonic;
  39. // Text input
  40. int input_state;
  41. char passphrase_text[TEXT_BUFFER_SIZE];
  42. char import_mnemonic_text[TEXT_BUFFER_SIZE];
  43. char input_text[TEXT_BUFFER_SIZE];
  44. } FlipBip;
  45. typedef enum {
  46. FlipBipViewIdStartscreen,
  47. FlipBipViewIdMenu,
  48. FlipBipViewIdScene1,
  49. FlipBipViewIdSettings,
  50. FlipBipViewIdTextInput,
  51. } FlipBipViewId;
  52. typedef enum {
  53. FlipBipHapticOff,
  54. FlipBipHapticOn,
  55. } FlipBipHapticState;
  56. typedef enum {
  57. FlipBipLedOff,
  58. FlipBipLedOn,
  59. } FlipBipLedState;
  60. typedef enum {
  61. FlipBipStrength128,
  62. FlipBipStrength192,
  63. FlipBipStrength256,
  64. } FlipBipStrengthState;
  65. typedef enum {
  66. FlipBipPassphraseOff,
  67. FlipBipPassphraseOn,
  68. } FlipBipPassphraseState;
  69. typedef enum {
  70. FlipBipCoinBTC0,
  71. FlipBipCoinETH60,
  72. FlipBipCoinDOGE3,
  73. FlipBipCoinZEC133,
  74. } FlipBipCoin;
  75. typedef enum {
  76. FlipBipTextInputDefault,
  77. FlipBipTextInputPassphrase,
  78. FlipBipTextInputMnemonic
  79. } FlipBipTextInputState;
  80. typedef enum {
  81. FlipBipStatusSuccess = 0,
  82. FlipBipStatusReturn = 10,
  83. FlipBipStatusLoadError = 11,
  84. FlipBipStatusSaveError = 12,
  85. FlipBipStatusMnemonicCheckError = 13,
  86. } FlipBipStatus;