NDEVR
API Documentation
PermissionManager

Centralized manager for checking and requesting application permissions. More...

Collaboration diagram for PermissionManager:
[legend]

Static Public Member Functions

static void AddPermissionHandler (PermissionHandler *handler)
 Registers a platform-specific permission handler.
static PermissionState CheckPermission (StringView permission)
 Checks whether the specified permission is currently granted.
static bool HasCamera ()
 Checks whether camera access is currently granted.
static bool HasLocationWhenInUse ()
 Checks whether location-when-in-use access is currently granted.
static bool HasMicrophone ()
 Checks whether microphone access is currently granted.
static void RemovePermissionHandler (PermissionHandler *handler)
 Unregisters a previously added permission handler.
static bool RequestCamera ()
 Requests camera access from the user or system.
static bool RequestLocationWhenInUse ()
 Requests location-when-in-use access from the user or system.
static bool RequestMicrophone ()
 Requests microphone access from the user or system.
static PermissionState RequestPermission (StringView permission)
 Requests the specified permission from all registered handlers.

Static Public Attributes

static constexpr StringView bluetooth_access = "bluetooth_access"
 Permission identifier for Bluetooth access.
static constexpr StringView calendar_access = "calendar_access"
 Permission identifier for calendar access.
static constexpr StringView camera_access = "camera_access"
 Permission identifier for camera access.
static constexpr StringView contacts_access = "contacts_access"
 Permission identifier for contacts access.
static constexpr StringView file_access = "file_access"
 Permission identifier for file system access.
static constexpr StringView local_network_access = "local_network_access"
 Permission identifier for local network discovery access.
static constexpr StringView location_always = "location_always"
 Permission identifier for persistent location access.
static constexpr StringView location_when_in_use = "location_when_in_use"
 Permission identifier for location access while the app is in use.
static constexpr StringView microphone_access = "microphone_access"
 Permission identifier for microphone access.
static constexpr StringView motion_sensors_access = "motion_sensors_access"
 Permission identifier for motion sensor access.
static constexpr StringView network_access = "network_access"
 Permission identifier for network access.
static constexpr StringView notifications_access = "notifications_access"
 Permission identifier for push notification access.
static constexpr StringView photo_library_access = "photo_library_access"
 Permission identifier for photo library access.
static Buffer< PermissionHandler * > s_permission_handlers
 List of registered platform-specific permission handlers.
static constexpr StringView speech_recognition = "speech_recognition"
 Permission identifier for speech recognition access.

Detailed Description

Centralized manager for checking and requesting application permissions.


Provides a static interface for querying and requesting permissions such as camera, microphone, location, and other system capabilities. Delegates to registered PermissionHandler instances for platform-specific behavior.

Definition at line 43 of file PermissionManager.h.

Member Function Documentation

◆ AddPermissionHandler()

void PermissionManager::AddPermissionHandler ( PermissionHandler * handler)
static

Registers a platform-specific permission handler.

Parameters
[in]handlerThe PermissionHandler to add to the handler list.

◆ CheckPermission()

PermissionState PermissionManager::CheckPermission ( StringView permission)
static

Checks whether the specified permission is currently granted.

Parameters
[in]permissionThe identifier of the permission to check.
Returns
The current PermissionState for the requested permission.

Referenced by HasCamera(), HasLocationWhenInUse(), and HasMicrophone().

◆ HasCamera()

bool PermissionManager::HasCamera ( )
inlinestatic

Checks whether camera access is currently granted.

Returns
True if camera permission is granted, false otherwise.

Definition at line 88 of file PermissionManager.h.

References camera_access, CheckPermission(), and e_granted.

◆ HasLocationWhenInUse()

bool PermissionManager::HasLocationWhenInUse ( )
inlinestatic

Checks whether location-when-in-use access is currently granted.

Returns
True if location-when-in-use permission is granted, false otherwise.

Definition at line 110 of file PermissionManager.h.

References CheckPermission(), e_granted, and location_when_in_use.

◆ HasMicrophone()

bool PermissionManager::HasMicrophone ( )
inlinestatic

Checks whether microphone access is currently granted.

Returns
True if microphone permission is granted, false otherwise.

Definition at line 99 of file PermissionManager.h.

References CheckPermission(), e_granted, and microphone_access.

◆ RemovePermissionHandler()

void PermissionManager::RemovePermissionHandler ( PermissionHandler * handler)
static

Unregisters a previously added permission handler.

Parameters
[in]handlerThe PermissionHandler to remove from the handler list.

◆ RequestCamera()

bool PermissionManager::RequestCamera ( )
inlinestatic

Requests camera access from the user or system.

Returns
True if camera permission is granted after the request, false otherwise.

Definition at line 93 of file PermissionManager.h.

References camera_access, e_granted, and RequestPermission().

◆ RequestLocationWhenInUse()

bool PermissionManager::RequestLocationWhenInUse ( )
inlinestatic

Requests location-when-in-use access from the user or system.

Returns
True if location-when-in-use permission is granted after the request, false otherwise.

Definition at line 115 of file PermissionManager.h.

References e_granted, location_when_in_use, and RequestPermission().

◆ RequestMicrophone()

bool PermissionManager::RequestMicrophone ( )
inlinestatic

Requests microphone access from the user or system.

Returns
True if microphone permission is granted after the request, false otherwise.

Definition at line 104 of file PermissionManager.h.

References e_granted, microphone_access, and RequestPermission().

◆ RequestPermission()

PermissionState PermissionManager::RequestPermission ( StringView permission)
static

Requests the specified permission from all registered handlers.

Parameters
[in]permissionThe identifier of the permission to request.
Returns
The resulting PermissionState after the request completes.

Referenced by RequestCamera(), RequestLocationWhenInUse(), and RequestMicrophone().


The documentation for this class was generated from the following file: