37 lines
1.2 KiB
Objective-C
37 lines
1.2 KiB
Objective-C
#pragma once
|
|
|
|
#import <Foundation/Foundation.h>
|
|
#import <CoreGraphics/CoreGraphics.h>
|
|
#import <ApplicationServices/ApplicationServices.h>
|
|
|
|
class Permissions {
|
|
public:
|
|
// Check if screen recording permission is granted
|
|
// Returns true if granted, false otherwise
|
|
static bool checkScreenCapture();
|
|
|
|
// Request screen recording permission (shows system dialog, macOS 10.15+)
|
|
static void requestScreenCapture();
|
|
|
|
// Check if accessibility permission is granted (for input simulation)
|
|
// Returns true if granted, false otherwise
|
|
static bool checkAccessibility();
|
|
|
|
// Request accessibility permission (shows system dialog)
|
|
static void requestAccessibility();
|
|
|
|
// Open System Preferences to Screen Recording settings
|
|
static void openScreenCaptureSettings();
|
|
|
|
// Open System Preferences to Accessibility settings
|
|
static void openAccessibilitySettings();
|
|
|
|
// Check all required permissions
|
|
// Returns true if all permissions are granted
|
|
static bool checkAllPermissions();
|
|
|
|
// Wait for permissions to be granted (blocking)
|
|
// Returns true if all granted within timeout, false otherwise
|
|
static bool waitForPermissions(int timeoutSeconds);
|
|
};
|