2022-05-27 11:19:21 +00:00
|
|
|
/**
|
|
|
|
* @file file_browser.h
|
|
|
|
* GUI: FileBrowser view module API
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <gui/view.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct FileBrowser FileBrowser;
|
|
|
|
typedef void (*FileBrowserCallback)(void* context);
|
|
|
|
|
2022-10-05 15:15:23 +00:00
|
|
|
typedef bool (*FileBrowserLoadItemCallback)(
|
|
|
|
FuriString* path,
|
|
|
|
void* context,
|
|
|
|
uint8_t** icon,
|
|
|
|
FuriString* item_name);
|
2022-09-14 16:11:38 +00:00
|
|
|
|
2022-10-05 15:15:23 +00:00
|
|
|
FileBrowser* file_browser_alloc(FuriString* result_path);
|
2022-05-27 11:19:21 +00:00
|
|
|
|
|
|
|
void file_browser_free(FileBrowser* browser);
|
|
|
|
|
|
|
|
View* file_browser_get_view(FileBrowser* browser);
|
|
|
|
|
|
|
|
void file_browser_configure(
|
|
|
|
FileBrowser* browser,
|
|
|
|
const char* extension,
|
2022-12-07 14:17:41 +00:00
|
|
|
const char* base_path,
|
2022-05-27 11:19:21 +00:00
|
|
|
bool skip_assets,
|
2022-12-07 10:52:44 +00:00
|
|
|
bool hide_dot_files,
|
2022-05-27 11:19:21 +00:00
|
|
|
const Icon* file_icon,
|
|
|
|
bool hide_ext);
|
|
|
|
|
2022-10-05 15:15:23 +00:00
|
|
|
void file_browser_start(FileBrowser* browser, FuriString* path);
|
2022-05-27 11:19:21 +00:00
|
|
|
|
|
|
|
void file_browser_stop(FileBrowser* browser);
|
|
|
|
|
|
|
|
void file_browser_set_callback(FileBrowser* browser, FileBrowserCallback callback, void* context);
|
|
|
|
|
2022-09-14 16:11:38 +00:00
|
|
|
void file_browser_set_item_callback(
|
|
|
|
FileBrowser* browser,
|
|
|
|
FileBrowserLoadItemCallback callback,
|
|
|
|
void* context);
|
|
|
|
|
2022-05-27 11:19:21 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|