geode/loader/include/Geode/utils/permission.hpp

25 lines
814 B
C++
Raw Permalink Normal View History

#pragma once
#include <Geode/DefaultInclude.hpp>
#include "MiniFunction.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
};
/**
* Request whether the given permission is granted to Geode by the operating system.
* @param permission The permission
*/
bool GEODE_DLL getPermissionStatus(Permission permission);
/**
* 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.
*/
void GEODE_DLL requestPermission(Permission permission, utils::MiniFunction<void(bool)> callback);
}