KKPasscodeLock.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //
  2. // Copyright 2011-2012 Kosher Penguin LLC
  3. // Created by Adar Porat (https://github.com/aporat) on 1/16/2012.
  4. //
  5. // Licensed under the Apache License, Version 2.0 (the "License");
  6. // you may not use this file except in compliance with the License.
  7. // You may obtain a copy of the License at
  8. //
  9. // http://www.apache.org/licenses/LICENSE-2.0
  10. //
  11. // Unless required by applicable law or agreed to in writing, software
  12. // distributed under the License is distributed on an "AS IS" BASIS,
  13. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. // See the License for the specific language governing permissions and
  15. // limitations under the License.
  16. //
  17. #define KKPasscodeLockLocalizedString(key, comment) [[KKPasscodeLock sharedLock] localizedStringForKey:(key) value:@""]
  18. #import <Foundation/Foundation.h>
  19. #import "KKPasscodeViewController.h"
  20. @interface KKPasscodeLock : NSObject {
  21. // whatever the erase option is enabled in the passcode settings
  22. BOOL _eraseOption;
  23. // how many attemepts is user is allowed to have before the screen is locked
  24. NSUInteger _attemptsAllowed;
  25. }
  26. /**
  27. * a shared object which can change the passcode settings and perform generic actions
  28. */
  29. + (KKPasscodeLock*)sharedLock;
  30. /**
  31. * checks if a passcode has to be displayed
  32. */
  33. - (BOOL)isPasscodeRequired;
  34. - (BOOL)isWithinGracePeriod;
  35. - (void)disablePasscode;
  36. - (BOOL)isTouchIdOn;
  37. /**
  38. * returns a localized string from the framework's bundle
  39. */
  40. - (NSString *)localizedStringForKey:(NSString *)key value:(NSString *)value NS_FORMAT_ARGUMENT(1);
  41. /**
  42. * set the initial settings of the passcode settings
  43. */
  44. - (void)setDefaultSettings;
  45. - (void)upgradeAccessibility;
  46. - (void)updateLastUnlockTime;
  47. @property (nonatomic,assign) BOOL eraseOption;
  48. @property (nonatomic,assign) NSUInteger attemptsAllowed;
  49. @property (nonatomic,assign) time_t lastUnlockTime;
  50. @end