file_browser.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * @file file_browser.h
  3. * GUI: FileBrowser view module API
  4. */
  5. #pragma once
  6. #include <gui/view.h>
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. typedef struct FileBrowser FileBrowser;
  11. typedef void (*FileBrowserCallback)(void* context);
  12. typedef bool (*FileBrowserLoadItemCallback)(
  13. FuriString* path,
  14. void* context,
  15. uint8_t** icon,
  16. FuriString* item_name);
  17. FileBrowser* file_browser_alloc(FuriString* result_path);
  18. void file_browser_free(FileBrowser* browser);
  19. View* file_browser_get_view(FileBrowser* browser);
  20. void file_browser_configure(
  21. FileBrowser* browser,
  22. const char* extension,
  23. const char* base_path,
  24. bool skip_assets,
  25. bool hide_dot_files,
  26. const Icon* file_icon,
  27. bool hide_ext);
  28. void file_browser_start(FileBrowser* browser, FuriString* path);
  29. void file_browser_stop(FileBrowser* browser);
  30. void file_browser_set_callback(FileBrowser* browser, FileBrowserCallback callback, void* context);
  31. void file_browser_set_item_callback(
  32. FileBrowser* browser,
  33. FileBrowserLoadItemCallback callback,
  34. void* context);
  35. #ifdef __cplusplus
  36. }
  37. #endif