]> git.saurik.com Git - cydia.git/blame - UICaboodle/BrowserView.h
Fix 'resubmit form' dialog: new alert API crash.
[cydia.git] / UICaboodle / BrowserView.h
CommitLineData
a9dbe12c
JF
1#import <UICaboodle/RVPage.h>
2#import <UICaboodle/RVBook.h>
3
4#import <UIKit/UIKit.h>
ab398adf 5
22f8bed9 6#include <WebKit/DOMNodeList.h>
22f8bed9 7#include <WebKit/WebFrame.h>
22f8bed9 8#include <WebKit/WebScriptObject.h>
c21004b9 9#include <WebKit/WebView.h>
22f8bed9
JF
10
11#import <JavaScriptCore/JavaScriptCore.h>
12
ab398adf
JF
13@class NSMutableArray;
14@class NSString;
15@class NSURL;
16@class NSURLRequest;
17
ab398adf 18@class UIScroller;
facbc56d 19@class UIDocumentWebView;
ab398adf 20
a9543575
JF
21@class WebView;
22
ab398adf 23@class Database;
facbc56d 24@class IndirectDelegate;
43f3d7f6 25
2634b249
JF
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;
7e37a676 40- (void) webViewUpdateViewSettings:(UIWebView *)view;
2634b249
JF
41@end
42
43@interface CYWebView : UIWebView
44- (id<CYWebViewDelegate>) delegate;
45@end
46
43f3d7f6 47@interface WebScriptObject (UICaboodle)
96f3833b 48- (NSUInteger) count;
43f3d7f6
JF
49- (id) objectAtIndex:(unsigned)index;
50@end
51
2e6c1426 52@protocol BrowserControllerDelegate
54043703
JF
53- (void) retainNetworkActivityIndicator;
54- (void) releaseNetworkActivityIndicator;
9b623dac 55- (CYViewController *) pageForURL:(NSURL *)url hasTag:(int *)tag;
43f3d7f6 56@end
ab398adf 57
9b623dac 58@interface BrowserController : CYViewController <
2634b249
JF
59 CYWebViewDelegate,
60 HookProtocol,
61 UIWebViewDelegate
c21004b9 62> {
3931b718
JF
63 _transient CYWebView *webview_;
64 _transient UIScrollView *scroller_;
2634b249 65
7a11fbb9 66 UIActivityIndicatorView *indicator_;
facbc56d 67 IndirectDelegate *indirect_;
0ce617c8 68 NSURLAuthenticationChallenge *challenge_;
fe468f45
JF
69
70 bool error_;
0c7c9052 71 NSURLRequest *request_;
ab398adf 72
3931b718 73 _transient NSNumber *sensitive_;
2634b249 74
ab398adf 75 NSString *title_;
caa427d1 76 NSMutableSet *loading_;
a0376fc1 77
2634b249
JF
78 // XXX: NSString * or UIImage *
79 id custom_;
9fe5e5f8 80 NSString *style_;
caa427d1 81
9fe5e5f8 82 WebScriptObject *function_;
12b59862 83 WebScriptObject *closer_;
3e9c9e85
JF
84
85 float width_;
245cce8a 86 Class class_;
bc11cf5b 87
2634b249
JF
88 UIBarButtonItem *reloaditem_;
89 UIBarButtonItem *loadingitem_;
ab398adf
JF
90}
91
ea173384
JF
92+ (void) _initialize;
93
ab398adf
JF
94- (void) loadURL:(NSURL *)url cachePolicy:(NSURLRequestCachePolicy)policy;
95- (void) loadURL:(NSURL *)url;
96
97- (void) loadRequest:(NSURLRequest *)request;
98- (void) reloadURL;
12b59862 99- (bool) isLoading;
ab398adf 100
b5e7eebb
GP
101- (id) init;
102- (id) initWithWidth:(float)width;
103- (id) initWithWidth:(float)width ofClass:(Class)_class;
ab398adf 104
caa427d1
JF
105- (void) callFunction:(WebScriptObject *)function;
106
2634b249
JF
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;
43f3d7f6 109
3e9c9e85
JF
110+ (float) defaultWidth;
111
caa427d1
JF
112- (void) setButtonImage:(NSString *)button withStyle:(NSString *)style toFunction:(id)function;
113- (void) setButtonTitle:(NSString *)button withStyle:(NSString *)style toFunction:(id)function;
caa427d1
JF
114- (void) setPopupHook:(id)function;
115
c21004b9 116- (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)button;
a5938ea5 117- (void) customButtonClicked;
c21004b9
JF
118- (void) applyRightButton;
119
2634b249
JF
120- (void) _didStartLoading;
121- (void) _didFinishLoading;
122
c21004b9
JF
123- (void) close;
124
a5938ea5 125@end