This repository has been archived by the owner on Dec 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
FBDialog.h
112 lines (90 loc) · 2.66 KB
/
FBDialog.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
104
105
106
107
108
109
110
111
112
/*
* Copyright 2009 Facebook
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Modified by Christopher Long
*/
#import <UIKit/UIKit.h>
@protocol FBDialogDelegate;
@interface FBDialog : UIView {
id<FBDialogDelegate> _delegate;
UIView* _view;
UIImageView* _iconView;
UILabel* _titleLabel;
UIButton* _closeButton;
UIDeviceOrientation _orientation;
BOOL _showingKeyboard;
}
/**
* The delegate.
*/
@property(nonatomic,assign) id<FBDialogDelegate> delegate;
/**
* The title that is shown in the header atop the view;
*/
@property(nonatomic,copy) NSString* title;
/**
* Creates the view but does not display it.
*/
- (id)initWithView:(UIView*)view;
/**
* Displays the view with an animation.
*
* The view will be added to the top of the current key window.
*/
- (void)show;
/**
* Displays the first page of the dialog.
*
* Do not ever call this directly. It is intended to be overriden by subclasses.
*/
- (void)load;
/**
* Hides the view and notifies delegates of success or cancellation.
*/
- (void)dismissWithSuccess:(BOOL)success animated:(BOOL)animated;
/**
* Hides the view and notifies delegates of an error.
*/
- (void)dismissWithError:(NSError*)error animated:(BOOL)animated;
/**
* Subclasses may override to perform actions just prior to showing the dialog.
*/
- (void)dialogWillAppear;
/**
* Subclasses may override to perform actions just after the dialog is hidden.
*/
- (void)dialogWillDisappear;
/**
* Subclasses should override to process data returned from the server in a 'fbconnect' url.
*
* Implementations must call dismissWithSuccess:YES at some point to hide the dialog.
*/
- (void)dialogDidSucceed:(NSURL*)url;
@end
///////////////////////////////////////////////////////////////////////////////////////////////////
@protocol FBDialogDelegate <NSObject>
@optional
/**
* Called when the dialog succeeds and is about to be dismissed.
*/
- (void)dialogDidSucceed:(FBDialog*)dialog;
/**
* Called when the dialog is cancelled and is about to be dismissed.
*/
- (void)dialogDidCancel:(FBDialog*)dialog;
/**
* Called when dialog failed to load due to an error.
*/
- (void)dialog:(FBDialog*)dialog didFailWithError:(NSError*)error;
@end