Swiftgram/LegacyComponents/TGPasscodeEntryController.h
2018-09-05 00:21:25 +03:00

49 lines
1.9 KiB
Objective-C

#import <LegacyComponents/TGViewController.h>
#import <LegacyComponents/LegacyComponentsGlobals.h>
typedef enum {
TGPasscodeEntryControllerModeVerifySimple,
TGPasscodeEntryControllerModeVerifyComplex,
TGPasscodeEntryControllerModeSetupSimple,
TGPasscodeEntryControllerModeSetupComplex,
TGPasscodeEntryControllerModeChangeSimpleToComplex,
TGPasscodeEntryControllerModeChangeSimpleToSimple,
TGPasscodeEntryControllerModeChangeComplexToSimple,
TGPasscodeEntryControllerModeChangeComplexToComplex
} TGPasscodeEntryControllerMode;
typedef enum {
TGPasscodeEntryControllerStyleDefault,
TGPasscodeEntryControllerStyleTranslucent
} TGPasscodeEntryControllerStyle;
@interface TGPasscodeEntryAttemptData : NSObject
@property (nonatomic, readonly) NSInteger numberOfInvalidAttempts;
@property (nonatomic, readonly) double dateOfLastInvalidAttempt;
- (instancetype)initWithNumberOfInvalidAttempts:(NSInteger)numberOfInvalidAttempts dateOfLastInvalidAttempt:(double)dateOfLastInvalidAttempt;
@end
@interface TGPasscodeEntryController : TGViewController
@property (nonatomic, copy) void (^completion)(NSString *);
@property (nonatomic, copy) void (^touchIdCompletion)();
@property (nonatomic, copy) bool (^checkCurrentPasscode)(NSString *);
@property (nonatomic, copy) void (^updateAttemptData)(TGPasscodeEntryAttemptData *);
@property (nonatomic) bool allowTouchId;
+ (void)setGlobalsProvider:(id<LegacyComponentsGlobalsProvider>)provider;
- (instancetype)initWithContext:(id<LegacyComponentsContext>)context style:(TGPasscodeEntryControllerStyle)style mode:(TGPasscodeEntryControllerMode)mode cancelEnabled:(bool)cancelEnabled allowTouchId:(bool)allowTouchId attemptData:(TGPasscodeEntryAttemptData *)attemptData completion:(void (^)(NSString *))completion;
- (void)resetMode:(TGPasscodeEntryControllerMode)mode;
- (void)refreshTouchId;
- (NSInteger)invalidPasscodeAttempts;
- (void)prepareForAppear;
- (void)prepareForDisappear;
@end