Peter d153fe0f21 Add 'submodules/LegacyComponents/' from commit 'd5594346161c1b7f203d1e87068bbe77bcaac019'
git-subtree-dir: submodules/LegacyComponents
git-subtree-mainline: 608630530451e02e5aec48389d144dbf7a3625b9
git-subtree-split: d5594346161c1b7f203d1e87068bbe77bcaac019
2019-06-11 18:51:15 +01: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