flip_store_apps.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. char* app_name;
  16. char* app_id;
  17. char* app_build_id;
  18. char* app_version;
  19. char* app_description;
  20. } FlipStoreAppInfo;
  21. extern FlipStoreAppInfo* flip_catalog;
  22. extern uint32_t app_selected_index;
  23. extern bool flip_store_sent_request;
  24. extern bool flip_store_success;
  25. extern bool flip_store_saved_data;
  26. extern bool flip_store_saved_success;
  27. extern uint32_t flip_store_category_index;
  28. enum ObjectState {
  29. OBJECT_EXPECT_KEY,
  30. OBJECT_EXPECT_COLON,
  31. OBJECT_EXPECT_VALUE,
  32. OBJECT_EXPECT_COMMA_OR_END
  33. };
  34. FlipStoreAppInfo* flip_catalog_alloc();
  35. void flip_catalog_free();
  36. // Utility function to parse JSON incrementally from a file
  37. bool flip_store_process_app_list();
  38. bool flip_store_get_fap_file(
  39. char* build_id,
  40. uint8_t target,
  41. uint16_t api_major,
  42. uint16_t api_minor);
  43. // function to handle the entire installation process "asynchronously"
  44. bool flip_store_install_app(Canvas* canvas, char* category);
  45. // process the app list and return view
  46. int32_t flip_store_handle_app_list(
  47. FlipStoreApp* app,
  48. int32_t success_view,
  49. char* category,
  50. Submenu** submenu);
  51. #endif // FLIP_STORE_APPS_H