![]() |
Mapper
0.9.0
API documentation
|
A generic utility for requesting app permissions from the user. More...
Enumerations | |
enum | AppPermission { LocationAccess, StorageAccess } |
Permissions which are required for certain features of the application. More... | |
enum | PermissionResult { Denied, Granted } |
Possible results of requesting a permission. More... | |
Functions | |
PermissionResult | checkPermission (AppPermission permission) |
Checks if the permission was granted or not. More... | |
template<class T > | |
void | requestPermission (AppPermission permission, T *object, void(T::*function)()) |
Asynchronously requests a new permission to be granted. More... | |
PermissionResult | requestPermissionSync (AppPermission permission) |
Requests a permissions to be granted to the application. More... | |
QStringList | androidPermissions (AppPermission permission) |
bool | permissionsGranted (const QStringList &requested_permissions, const QtAndroid::PermissionResultMap &actual_permissions) |
A generic utility for requesting app permissions from the user.
This class is modeled after the patterns found in [Qt]Android, but provides an abstraction from OS specific aspects.
QStringList AppPermissions::androidPermissions | ( | AppPermission | permission | ) |
|
inline |
Checks if the permission was granted or not.
bool AppPermissions::permissionsGranted | ( | const QStringList & | requested_permissions, |
const QtAndroid::PermissionResultMap & | actual_permissions | ||
) |
void AppPermissions::requestPermission | ( | AppPermission | permission, |
T * | object, | ||
void(T::*)() | function | ||
) |
Asynchronously requests a new permission to be granted.
The given member function on the receiver will be called when the permission is actually granted.
This function must not be called while the requested permission is granted.
|
inline |
Requests a permissions to be granted to the application.
This function must not be called while the requested permission is granted.