create_view.h 964 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #pragma once
  2. #include <gui/view.h>
  3. typedef struct BarcodeApp BarcodeApp;
  4. typedef enum {
  5. FileNameSetter,
  6. BarcodeDataSetter
  7. } InputSetter; //what value to set for the text input view
  8. typedef enum {
  9. EditMode,
  10. NewMode
  11. } CreateMode;
  12. typedef struct {
  13. View* view;
  14. BarcodeApp* barcode_app;
  15. InputSetter setter;
  16. char input[TEXT_BUFFER_SIZE];
  17. } CreateView;
  18. typedef struct {
  19. int selected_menu_item;
  20. CreateMode mode;
  21. BarcodeTypeObj* barcode_type;
  22. FuriString* file_path; //the current file that is opened
  23. FuriString* file_name;
  24. FuriString* barcode_data;
  25. } CreateViewModel;
  26. CreateView* create_view_allocate(BarcodeApp* barcode_app);
  27. void remove_barcode(CreateView* create_view_object);
  28. void save_barcode(CreateView* create_view_object);
  29. void create_view_free_model(CreateView* create_view_object);
  30. void create_view_free(CreateView* create_view_object);
  31. View* create_get_view(CreateView* create_view_object);