2023-01-22 17:32:34 +00:00
|
|
|
//
|
2023-01-31 10:36:14 +00:00
|
|
|
// DarwinFileSystemServices.h
|
2023-01-22 17:32:34 +00:00
|
|
|
// PPSSPP
|
|
|
|
//
|
|
|
|
// Created by Serena on 20/01/2023.
|
|
|
|
//
|
|
|
|
|
2023-02-01 16:03:12 +00:00
|
|
|
#pragma once
|
2023-01-22 17:32:34 +00:00
|
|
|
|
|
|
|
#include "ppsspp_config.h"
|
|
|
|
#include "Common/File/Path.h"
|
2023-07-16 13:22:04 +00:00
|
|
|
#include "Common/System/Request.h"
|
2023-01-22 17:32:34 +00:00
|
|
|
|
|
|
|
#define PreferredMemoryStickUserDefaultsKey "UserPreferredMemoryStickDirectoryPath"
|
|
|
|
|
2023-03-22 15:20:30 +00:00
|
|
|
typedef std::function<void (bool, Path)> DarwinDirectoryPanelCallback;
|
2023-01-22 17:32:34 +00:00
|
|
|
|
2023-01-31 10:36:14 +00:00
|
|
|
/// A Class providing help functions to work with the FileSystem
|
|
|
|
/// on Darwin platforms.
|
|
|
|
class DarwinFileSystemServices {
|
2023-01-22 17:32:34 +00:00
|
|
|
public:
|
2023-07-16 13:22:04 +00:00
|
|
|
/// Present a panel to choose a file or directory.
|
2024-06-01 10:17:32 +00:00
|
|
|
static void presentDirectoryPanel(
|
|
|
|
DarwinDirectoryPanelCallback panelCallback,
|
2023-07-16 13:22:04 +00:00
|
|
|
bool allowFiles = false,
|
|
|
|
bool allowDirectories = true,
|
|
|
|
BrowseFileType fileType = BrowseFileType::ANY);
|
|
|
|
|
|
|
|
static Path appropriateMemoryStickDirectoryToUse();
|
|
|
|
static void setUserPreferredMemoryStickDirectory(Path);
|
2024-09-26 19:09:23 +00:00
|
|
|
static Path defaultMemoryStickPath();
|
2024-06-01 10:17:32 +00:00
|
|
|
|
|
|
|
static void ClearDelegate();
|
2023-01-22 17:32:34 +00:00
|
|
|
private:
|
|
|
|
#if PPSSPP_PLATFORM(IOS)
|
2023-07-16 13:22:04 +00:00
|
|
|
// iOS only, needed for UIDocumentPickerViewController
|
2024-06-01 10:17:32 +00:00
|
|
|
static void *__pickerDelegate;
|
2023-01-22 17:32:34 +00:00
|
|
|
#endif // PPSSPP_PLATFORM(IOS)
|
|
|
|
};
|
2023-02-06 19:17:27 +00:00
|
|
|
|
2023-04-29 09:17:10 +00:00
|
|
|
void RestartMacApp();
|