TOPasscodeSettingsKeypadView.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //
  2. // TOPasscodeSettingsKeypadView.h
  3. //
  4. // Copyright 2017 Timothy Oliver. All rights reserved.
  5. //
  6. // Permission is hereby granted, free of charge, to any person obtaining a copy
  7. // of this software and associated documentation files (the "Software"), to
  8. // deal in the Software without restriction, including without limitation the
  9. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  10. // sell copies of the Software, and to permit persons to whom the Software is
  11. // furnished to do so, subject to the following conditions:
  12. //
  13. // The above copyright notice and this permission notice shall be included in
  14. // all copies or substantial portions of the Software.
  15. //
  16. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  17. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  20. // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
  21. // IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. #import <UIKit/UIKit.h>
  23. #import "TOPasscodeViewControllerConstants.h"
  24. NS_ASSUME_NONNULL_BEGIN
  25. /**
  26. A keypad view of 9 buttons that allow numerical input on both iPad and iPhone.
  27. Designed to match the base system, with a pseudo-skeuomorphical styling.
  28. */
  29. @interface TOPasscodeSettingsKeypadView : UIView
  30. /* Whether the control is allowing input */
  31. @property (nonatomic, assign) BOOL enabled;
  32. /* Whether the view is currently light mode or dark. */
  33. @property (nonatomic, assign) TOPasscodeSettingsViewStyle style;
  34. /* The color of the separator line */
  35. @property (nonatomic, strong) UIColor *separatorLineColor;
  36. /* Labels in the buttons are laid out horizontally */
  37. @property (nonatomic, assign) BOOL buttonLabelHorizontalLayout;
  38. /* If overridden, the foreground color of the buttons */
  39. @property (nonatomic, assign) CGFloat keypadButtonBorderThickness;
  40. /* Untapped background images */
  41. @property (nonatomic, strong, null_resettable) UIColor *keypadButtonForegroundColor;
  42. @property (nonatomic, strong, null_resettable) UIColor *keypadButtonBorderColor;
  43. /* Tapped background images */
  44. @property (nonatomic, strong, null_resettable) UIColor *keypadButtonTappedForegroundColor;
  45. @property (nonatomic, strong, nullable) UIColor *keypadButtonTappedBorderColor;
  46. /* Button label styling */
  47. @property (nonatomic, strong) UIFont *keypadButtonNumberFont;
  48. @property (nonatomic, strong) UIFont *keypadButtonLetteringFont;
  49. @property (nonatomic, strong) UIColor *keypadButtonLabelTextColor;
  50. @property (nonatomic, assign) CGFloat keypadButtonVerticalSpacing;
  51. @property (nonatomic, assign) CGFloat keypadButtonHorizontalSpacing;
  52. @property (nonatomic, assign) CGFloat keypadButtonLetteringSpacing;
  53. /* Callback handlers */
  54. @property (nonatomic, copy) void (^numberButtonTappedHandler)(NSInteger number);
  55. @property (nonatomic, copy) void (^deleteButtonTappedHandler)(void);
  56. /* In really small sizes, set the keypad labels to horizontal */
  57. - (void)setButtonLabelHorizontalLayout:(BOOL)horizontal animated:(BOOL)animated;
  58. @end
  59. NS_ASSUME_NONNULL_END