2024-01-27 14:02:34 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Geode/DefaultInclude.hpp>
|
|
|
|
#include <string_view>
|
|
|
|
|
|
|
|
namespace geode::utils::permission {
|
|
|
|
enum class Permission {
|
2024-02-23 23:13:52 -05:00
|
|
|
ReadAllFiles = 0x3, // maintain compatibility with some older mods
|
|
|
|
RecordAudio
|
2024-01-27 14:02:34 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request whether the given permission is granted to Geode by the operating system.
|
|
|
|
* @param permission The permission
|
|
|
|
*/
|
2024-01-28 16:20:27 -05:00
|
|
|
bool GEODE_DLL getPermissionStatus(Permission permission);
|
2024-01-27 14:02:34 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Request a permission to be granted by the operating system.
|
|
|
|
* @param permission The permission
|
|
|
|
* @param callback The callback, passed value is 'true' if permission was granted and 'false' otherwise.
|
|
|
|
*/
|
2024-11-04 12:42:09 -05:00
|
|
|
void GEODE_DLL requestPermission(Permission permission, std::function<void(bool)> callback);
|
2024-01-27 14:02:34 -05:00
|
|
|
}
|