file_browser.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. bool skip_assets,
  24. bool hide_dot_files,
  25. const Icon* file_icon,
  26. bool hide_ext);
  27. void file_browser_start(FileBrowser* browser, FuriString* path);
  28. void file_browser_stop(FileBrowser* browser);
  29. void file_browser_set_callback(FileBrowser* browser, FileBrowserCallback callback, void* context);
  30. void file_browser_set_item_callback(
  31. FileBrowser* browser,
  32. FileBrowserLoadItemCallback callback,
  33. void* context);
  34. #ifdef __cplusplus
  35. }
  36. #endif