mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-23 07:57:51 -05:00
9ff919118e
* add methods for requesting and querying permissions * change requestPermission to void and handle jni errors * move permissions to utils * how could i forget the mac operating system * genuinely blind * make a permission enum * call permission callbacks on unimpl platforms
27 lines
No EOL
778 B
C++
27 lines
No EOL
778 B
C++
#pragma once
|
|
|
|
#include <Geode/DefaultInclude.hpp>
|
|
#include "MiniFunction.hpp"
|
|
#include <string_view>
|
|
|
|
namespace geode::utils::permission {
|
|
enum class Permission {
|
|
ReadAudio,
|
|
ReadImages,
|
|
ReadVideo,
|
|
RecordAudio,
|
|
};
|
|
|
|
/**
|
|
* Request whether the given permission is granted to Geode by the operating system.
|
|
* @param permission The permission
|
|
*/
|
|
bool 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 requestPermission(Permission permission, utils::MiniFunction<void(bool)> callback);
|
|
} |