4 #import <Foundation/Foundation.h>
5 #import "keychain/ot/OctagonStateMachineHelpers.h"
7 NS_ASSUME_NONNULL_BEGIN
9 // An OctagonPendingFlag asks the state machine to add a flag in the future, when some conditions are met
11 // Currently, this is only time-based.
12 // Future planned conditions include "device is probably unlocked" and "device has network again"
14 typedef NS_OPTIONS(NSUInteger
, OctagonPendingConditions
) {
15 OctagonPendingConditionsDeviceUnlocked
= 1,
18 NSString
* OctagonPendingConditionsToString(OctagonPendingConditions cond
);
20 @interface OctagonPendingFlag
: NSObject
21 @
property (readonly
) OctagonFlag
* flag
;
23 // NSDate after which this flag should become unpending
24 @
property (nullable
, readonly
) NSDate
* fireTime
;
26 @
property (readonly
) OctagonPendingConditions conditions
;
28 - (instancetype
)initWithFlag
:(OctagonFlag
*)flag delayInSeconds
:(NSTimeInterval
)delay
;
29 - (instancetype
)initWithFlag
:(OctagonFlag
*)flag conditions
:(OctagonPendingConditions
)conditions
;