flip_store_apps.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef FLIP_STORE_APPS_H
  2. #define FLIP_STORE_APPS_H
  3. #include <flip_store.h>
  4. #include <flip_storage/flip_store_storage.h>
  5. #include <callback/flip_store_callback.h>
  6. // Define maximum limits
  7. #define MAX_APP_NAME_LENGTH 32
  8. #define MAX_ID_LENGTH 32
  9. #define MAX_APP_COUNT 100
  10. #define MAX_APP_DESCRIPTION_LENGTH 100
  11. #define MAX_APP_VERSION_LENGTH 5
  12. // define the list of categories
  13. extern char *categories[];
  14. typedef struct
  15. {
  16. char *app_name;
  17. char *app_id;
  18. char *app_build_id;
  19. char *app_version;
  20. char *app_description;
  21. } FlipStoreAppInfo;
  22. extern FlipStoreAppInfo *flip_catalog;
  23. extern uint32_t app_selected_index;
  24. extern bool flip_store_sent_request;
  25. extern bool flip_store_success;
  26. extern bool flip_store_saved_data;
  27. extern bool flip_store_saved_success;
  28. extern uint32_t flip_store_category_index;
  29. enum ObjectState
  30. {
  31. OBJECT_EXPECT_KEY,
  32. OBJECT_EXPECT_COLON,
  33. OBJECT_EXPECT_VALUE,
  34. OBJECT_EXPECT_COMMA_OR_END
  35. };
  36. FlipStoreAppInfo *flip_catalog_alloc();
  37. void flip_catalog_free();
  38. // Utility function to parse JSON incrementally from a file
  39. bool flip_store_process_app_list();
  40. bool flip_store_get_fap_file(char *build_id, uint8_t target, uint16_t api_major, uint16_t api_minor);
  41. // function to handle the entire installation process "asynchronously"
  42. bool flip_store_install_app(Canvas *canvas, char *category);
  43. // process the app list and return view
  44. int32_t flip_store_handle_app_list(FlipStoreApp *app, int32_t success_view, char *category, Submenu **submenu);
  45. #endif // FLIP_STORE_APPS_H