-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathlibPass.h
42 lines (36 loc) · 1.46 KB
/
libPass.h
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
35
36
37
38
39
40
@protocol LibPassDelegate <NSObject>
@optional
// Used to allow basic detection of different passcodes
-(void)passwordWasEntered:(NSString*)password;
// Used during shouldAllowPasscode: to check if the passcode is "correct"
-(BOOL)shouldAllowPasscode:(NSString*)password;
@end
@interface LibPass : NSObject
{
NSMutableArray *delegates;
}
// This is probably a really, really bad idea...
@property (nonatomic, retain) NSString* devicePasscode;
@property (nonatomic) BOOL isPasscodeOn;
+ (instancetype) sharedInstance;
// Registers a delegate for either shouldAllowPasscode and/or passwordWasEnteredHandler
- (void) registerDelegate:(id)delegate;
// Deregisters a delegate for eitehr shouldAllowPasscode and/or passwordWasEnteredHandler
- (void) deregisterDelegate:(id)delegate;
- (BOOL) shouldAllowPasscode:(NSString*)passcode;
- (void) passwordWasEnteredHandler:(NSString *)password;
// Toggles whether the passcode should be temporarily bypassed
- (void) togglePasscode;
// Sets whether the passcode should be temporarily bypassed
- (void) setPasscodeToggle:(BOOL)enabled;
// Unlocks, bypassing the passcode if 'enabled' is YES
- (void) unlockWithCodeEnabled:(BOOL)enabled;
// Locks, setting the passcodeToggle to the enabled flag
- (void) lockWithCodeEnabled:(BOOL)enabled;
// Returns whether the passcode is enabled/disabled
- (BOOL) toggleValue;
// For bypassing, etc
-(BOOL) isPasscodeAvailable;
-(NSString*)getEffectiveDevicePasscode;
-(void) deviceWasUnlockedHandler;
@end