2022-05-27 14:19:21 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <gui/view.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2023-02-13 08:01:31 +03:00
|
|
|
#define BROWSER_SORT_THRESHOLD 400
|
|
|
|
|
2022-05-27 14:19:21 +03:00
|
|
|
typedef struct BrowserWorker BrowserWorker;
|
|
|
|
typedef void (*BrowserWorkerFolderOpenCallback)(
|
|
|
|
void* context,
|
|
|
|
uint32_t item_cnt,
|
|
|
|
int32_t file_idx,
|
|
|
|
bool is_root);
|
|
|
|
typedef void (*BrowserWorkerListLoadCallback)(void* context, uint32_t list_load_offset);
|
|
|
|
typedef void (*BrowserWorkerListItemCallback)(
|
|
|
|
void* context,
|
2022-10-05 18:15:23 +03:00
|
|
|
FuriString* item_path,
|
2023-02-12 14:15:11 +03:00
|
|
|
uint32_t idx,
|
2022-05-27 14:19:21 +03:00
|
|
|
bool is_folder,
|
|
|
|
bool is_last);
|
|
|
|
typedef void (*BrowserWorkerLongLoadCallback)(void* context);
|
|
|
|
|
2022-12-07 13:52:44 +03:00
|
|
|
BrowserWorker* file_browser_worker_alloc(
|
|
|
|
FuriString* path,
|
2022-12-07 17:17:41 +03:00
|
|
|
const char* base_path,
|
2022-12-07 13:52:44 +03:00
|
|
|
const char* filter_ext,
|
|
|
|
bool skip_assets,
|
|
|
|
bool hide_dot_files);
|
2022-05-27 14:19:21 +03:00
|
|
|
|
|
|
|
void file_browser_worker_free(BrowserWorker* browser);
|
|
|
|
|
|
|
|
void file_browser_worker_set_callback_context(BrowserWorker* browser, void* context);
|
|
|
|
|
|
|
|
void file_browser_worker_set_folder_callback(
|
|
|
|
BrowserWorker* browser,
|
|
|
|
BrowserWorkerFolderOpenCallback cb);
|
|
|
|
|
|
|
|
void file_browser_worker_set_list_callback(
|
|
|
|
BrowserWorker* browser,
|
|
|
|
BrowserWorkerListLoadCallback cb);
|
|
|
|
|
|
|
|
void file_browser_worker_set_item_callback(
|
|
|
|
BrowserWorker* browser,
|
|
|
|
BrowserWorkerListItemCallback cb);
|
|
|
|
|
|
|
|
void file_browser_worker_set_long_load_callback(
|
|
|
|
BrowserWorker* browser,
|
|
|
|
BrowserWorkerLongLoadCallback cb);
|
|
|
|
|
2022-06-09 10:09:52 +03:00
|
|
|
void file_browser_worker_set_config(
|
|
|
|
BrowserWorker* browser,
|
2022-10-05 18:15:23 +03:00
|
|
|
FuriString* path,
|
2022-06-09 10:09:52 +03:00
|
|
|
const char* filter_ext,
|
2022-12-07 13:52:44 +03:00
|
|
|
bool skip_assets,
|
|
|
|
bool hide_dot_files);
|
2022-06-09 10:09:52 +03:00
|
|
|
|
2022-10-05 18:15:23 +03:00
|
|
|
void file_browser_worker_folder_enter(BrowserWorker* browser, FuriString* path, int32_t item_idx);
|
2022-05-27 14:19:21 +03:00
|
|
|
|
2022-11-28 21:59:24 +03:00
|
|
|
bool file_browser_worker_is_in_start_folder(BrowserWorker* browser);
|
|
|
|
|
2022-05-27 14:19:21 +03:00
|
|
|
void file_browser_worker_folder_exit(BrowserWorker* browser);
|
|
|
|
|
2022-06-09 10:09:52 +03:00
|
|
|
void file_browser_worker_folder_refresh(BrowserWorker* browser, int32_t item_idx);
|
|
|
|
|
2022-05-27 14:19:21 +03:00
|
|
|
void file_browser_worker_load(BrowserWorker* browser, uint32_t offset, uint32_t count);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|