file_select.h 766 B

12345678910111213141516171819202122232425
  1. #pragma once
  2. #include <gui/view.h>
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. typedef struct FileSelect FileSelect;
  7. typedef void (*FileSelectCallback)(bool result, void* context);
  8. FileSelect* file_select_alloc();
  9. void file_select_free(FileSelect* file_select);
  10. View* file_select_get_view(FileSelect* file_select);
  11. void file_select_set_callback(FileSelect* file_select, FileSelectCallback callback, void* context);
  12. void file_select_set_filter(FileSelect* file_select, const char* path, const char* extension);
  13. void file_select_set_result_buffer(FileSelect* file_select, char* buffer, uint8_t buffer_size);
  14. bool file_select_init(FileSelect* file_select);
  15. void file_select_set_selected_file(FileSelect* file_select, const char* filename);
  16. #ifdef __cplusplus
  17. }
  18. #endif