forked from SelfControlApp/selfcontrol
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSCDaemonBlockMethods.h
More file actions
34 lines (24 loc) · 1.22 KB
/
SCDaemonBlockMethods.h
File metadata and controls
34 lines (24 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// SCDaemonBlockMethods.h
// org.eyebeam.selfcontrold
//
// Created by Charlie Stigler on 7/4/20.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
// Top-level logic for different methods run by the SelfControl daemon
// these logics can be run by XPC methods, or elsewhere
@interface SCDaemonBlockMethods : NSObject
@property (class, readonly) NSLock* daemonMethodLock;
// Starts a block
+ (void)startBlockWithControllingUID:(uid_t)controllingUID blocklist:(NSArray<NSString*>*)blocklist isAllowlist:(BOOL)isAllowlist endDate:(NSDate*)endDate blockSettings:(NSDictionary*)blockSettings authorization:(NSData *)authData reply:(void(^)(NSError* error))reply;
// Checks whether the block is expired or compromised, and takes action to fix
+ (void)checkupBlock;
// updates the blocklist for the currently running block
// (i.e. adds new sites to the list)
+ (void)updateBlocklist:(NSArray<NSString*>*)newBlocklist authorization:(NSData *)authData reply:(void(^)(NSError* error))reply;
// updates the block end date for the currently running block
// (i.e. extends the block)
+ (void)updateBlockEndDate:(NSDate*)newEndDate authorization:(NSData *)authData reply:(void(^)(NSError* error))reply;
@end
NS_ASSUME_NONNULL_END