]>
Commit | Line | Data |
---|---|---|
1 | #import <UICaboodle/RVPage.h> | |
2 | #import <UICaboodle/RVBook.h> | |
3 | ||
4 | #import <UIKit/UIKit.h> | |
5 | ||
6 | #include <WebKit/DOMNodeList.h> | |
7 | #include <WebKit/WebFrame.h> | |
8 | #include <WebKit/WebScriptObject.h> | |
9 | #include <WebKit/WebView.h> | |
10 | ||
11 | #import <JavaScriptCore/JavaScriptCore.h> | |
12 | ||
13 | @class NSMutableArray; | |
14 | @class NSString; | |
15 | @class NSURL; | |
16 | @class NSURLRequest; | |
17 | ||
18 | @class UIScroller; | |
19 | @class UIDocumentWebView; | |
20 | ||
21 | @class WebView; | |
22 | ||
23 | @class Database; | |
24 | @class IndirectDelegate; | |
25 | ||
26 | @protocol CYWebViewDelegate <UIWebViewDelegate> | |
27 | - (void) webView:(WebView *)view decidePolicyForNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener; | |
28 | - (void) webView:(WebView *)view decidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)name decisionListener:(id<WebPolicyDecisionListener>)listener; | |
29 | - (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame; | |
30 | - (void) webView:(WebView *)view didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame; | |
31 | - (void) webView:(WebView *)view didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame; | |
32 | - (void) webView:(WebView *)view didFinishLoadForFrame:(WebFrame *)frame; | |
33 | - (void) webView:(WebView *)view didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame; | |
34 | - (void) webView:(WebView *)view didStartProvisionalLoadForFrame:(WebFrame *)frame; | |
35 | - (NSURLRequest *) webView:(WebView *)view resource:(id)resource willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source; | |
36 | - (void) webViewClose:(WebView *)view; | |
37 | - (bool) webView:(WebView *)view shouldRunJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame; | |
38 | - (bool) webView:(WebView *)view shouldRunJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame; | |
39 | - (bool) webView:(WebView *)view shouldRunJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)text initiatedByFrame:(WebFrame *)frame; | |
40 | - (void) webViewUpdateViewSettings:(UIWebView *)view; | |
41 | @end | |
42 | ||
43 | @interface CYWebView : UIWebView | |
44 | - (id<CYWebViewDelegate>) delegate; | |
45 | @end | |
46 | ||
47 | @interface WebScriptObject (UICaboodle) | |
48 | - (NSUInteger) count; | |
49 | - (id) objectAtIndex:(unsigned)index; | |
50 | @end | |
51 | ||
52 | @protocol BrowserControllerDelegate | |
53 | - (void) retainNetworkActivityIndicator; | |
54 | - (void) releaseNetworkActivityIndicator; | |
55 | - (CYViewController *) pageForURL:(NSURL *)url hasTag:(int *)tag; | |
56 | @end | |
57 | ||
58 | @interface BrowserController : CYViewController < | |
59 | CYWebViewDelegate, | |
60 | HookProtocol, | |
61 | UIWebViewDelegate | |
62 | > { | |
63 | _transient CYWebView *webview_; | |
64 | _transient UIScrollView *scroller_; | |
65 | ||
66 | UIActivityIndicatorView *indicator_; | |
67 | IndirectDelegate *indirect_; | |
68 | NSURLAuthenticationChallenge *challenge_; | |
69 | ||
70 | bool error_; | |
71 | NSURLRequest *request_; | |
72 | ||
73 | _transient NSNumber *sensitive_; | |
74 | ||
75 | NSString *title_; | |
76 | NSMutableSet *loading_; | |
77 | ||
78 | // XXX: NSString * or UIImage * | |
79 | id custom_; | |
80 | NSString *style_; | |
81 | ||
82 | WebScriptObject *function_; | |
83 | WebScriptObject *closer_; | |
84 | ||
85 | float width_; | |
86 | Class class_; | |
87 | ||
88 | UIBarButtonItem *reloaditem_; | |
89 | UIBarButtonItem *loadingitem_; | |
90 | } | |
91 | ||
92 | + (void) _initialize; | |
93 | ||
94 | - (void) loadURL:(NSURL *)url cachePolicy:(NSURLRequestCachePolicy)policy; | |
95 | - (void) loadURL:(NSURL *)url; | |
96 | ||
97 | - (void) loadRequest:(NSURLRequest *)request; | |
98 | - (void) reloadURL; | |
99 | - (bool) isLoading; | |
100 | ||
101 | - (id) init; | |
102 | - (id) initWithWidth:(float)width; | |
103 | - (id) initWithWidth:(float)width ofClass:(Class)_class; | |
104 | ||
105 | - (void) callFunction:(WebScriptObject *)function; | |
106 | ||
107 | - (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame; | |
108 | - (NSURLRequest *) webView:(WebView *)view resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source; | |
109 | ||
110 | + (float) defaultWidth; | |
111 | ||
112 | - (void) setButtonImage:(NSString *)button withStyle:(NSString *)style toFunction:(id)function; | |
113 | - (void) setButtonTitle:(NSString *)button withStyle:(NSString *)style toFunction:(id)function; | |
114 | - (void) setPopupHook:(id)function; | |
115 | ||
116 | - (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)button; | |
117 | - (void) customButtonClicked; | |
118 | - (void) applyRightButton; | |
119 | ||
120 | - (void) _didStartLoading; | |
121 | - (void) _didFinishLoading; | |
122 | ||
123 | - (void) close; | |
124 | ||
125 | @end |