forked from tomcool420/SMFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SMFPasscodeController.h
104 lines (94 loc) · 3.22 KB
/
SMFPasscodeController.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
//
// SMFPasscodeController.h
// SoftwareMenuFramework
//
// Created by Thomas Cool on 4/19/09.
// Copyright 2009,2010 Thomas Cool. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Backrow/AppleTV.h"
@class BRHeaderControl, BRTextControl,BRScrollingTextControl, BRImageControl, BRPasscodeEntryControl, BRDisplayManager;
/**
*Delegate protocol for SMFPasscodeController
*/
@protocol SMFPasscodeControllerDelegate
/**
*Message sent when the user selects "enter" on the passcode
*@param sender an object to with -(NSString *)stringValue can be called on
*@see passcodeTextDidChange:
*/
- (void) passcodeTextDidEndEditing:(id)sender;
@optional
/**
*Message sent anytime something changes
*@param sender an object to with -(NSString *)stringValue can be called on
*@see passcodeTextDidEndEditing:
*/
- (void) passcodeTextDidChange: (id) sender;
- (void) textDidChange: (id) sender DEPRECATED_ATTRIBUTE;
- (void) textDidEndEditing: (id) sender DEPRECATED_ATTRIBUTE;
@end
/**
*A simple way to have passcode boxes shown on screen. It comes with multiple ways to save/ check the data but setting a delegate is the recommened way
*/
@interface SMFPasscodeController : BRController
{
int padding[16];
BRImage * icon;
id delegate;
NSString * title;
NSString * description;
NSString * key;
NSString * domain;
int boxes;
int initialValue;
}
- (id)initWithTitle:(NSString *)t withDescription:(NSString *)desc withBoxes:(int)b withKey:(NSString *)k withDomain:(NSString *)dom;
/**
*Recommended way to create a SMFPasscodeController
*@param t the title shown at the top of the screen
*@param desc short description explaining why this is passcode is required (may be nil)
*@param b the number of boxes to show (typically 4-6)
*@param del the delegate to which the selected passcode will be returned
*@return autoreleased instance of SMFPasscodeController with set parameters
*
*/
+ (SMFPasscodeController *)passcodeWithTitle:(NSString *)t withDescription:(NSString *)desc withBoxes:(int)b withDelegate:(id)del;
+ (SMFPasscodeController *)passcodeWithTitle:(NSString *)t withDescription:(NSString *)desc withBoxes:(int)b withKey:(NSString *)k withDomain:(NSString *)dom;
/**
* Delegate conforming to protocol: SMFPasscodeControllerDelegate
*/
@property (assign) id delegate;
/**
* The key to which you see the passcode in the Domain selected in domain
*@note requires both domain and key to be set and delegate to be nil
*@see domain
*/
@property (retain) NSString * key;
/**
*The domain in which you set the passcode
*@note requires both domain and key
*@see key
*/
@property (retain) NSString * domain;
/**
*The initial value selected
*/
@property (assign) int initialValue;
/**
* short description explaining why this is passcode is required (may be nil)
*/
@property (retain) NSString *description;
/**
* the number of boxes to show (typically 4-6)
*/
@property (assign) int boxes;
/**
* Icon to show next to the title
*/
@property (retain) BRImage * icon;
/**
* Title of the controller
*/
@property (retain) NSString *title;
@end