]> git.saurik.com Git - apple/security.git/blob - keychain/ot/OctagonPendingFlag.h
Security-59754.41.1.tar.gz
[apple/security.git] / keychain / ot / OctagonPendingFlag.h
1
2 #if OCTAGON
3
4 #import <Foundation/Foundation.h>
5 #import "keychain/ot/OctagonStateMachineHelpers.h"
6
7 NS_ASSUME_NONNULL_BEGIN
8
9 // An OctagonPendingFlag asks the state machine to add a flag in the future, when some conditions are met
10
11 // Currently, this is only time-based.
12 // Future planned conditions include "device is probably unlocked" and "device has network again"
13
14 typedef NS_OPTIONS(NSUInteger, OctagonPendingConditions) {
15 OctagonPendingConditionsDeviceUnlocked = 1,
16 };
17
18 NSString* OctagonPendingConditionsToString(OctagonPendingConditions cond);
19
20 @interface OctagonPendingFlag : NSObject
21 @property (readonly) OctagonFlag* flag;
22
23 // NSDate after which this flag should become unpending
24 @property (nullable, readonly) NSDate* fireTime;
25
26 @property (readonly) OctagonPendingConditions conditions;
27
28 @property (nullable) NSOperation* afterOperation;
29
30 - (instancetype)initWithFlag:(OctagonFlag*)flag delayInSeconds:(NSTimeInterval)delay;
31 - (instancetype)initWithFlag:(OctagonFlag*)flag conditions:(OctagonPendingConditions)conditions;
32 - (instancetype)initWithFlag:(OctagonFlag*)flag after:(NSOperation*)op;
33 @end
34
35 NS_ASSUME_NONNULL_END
36
37 #endif // OCTAGON