]> git.saurik.com Git - cydia.git/blame - UICaboodle/BrowserView.h
Support Activator and libstatusbar.
[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 26@protocol CYWebViewDelegate <UIWebViewDelegate>
72bdb258 27- (void) webView:(WebView *)view addMessageToConsole:(NSDictionary *)message;
2634b249
JF
28- (void) webView:(WebView *)view decidePolicyForNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener;
29- (void) webView:(WebView *)view decidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)name decisionListener:(id<WebPolicyDecisionListener>)listener;
30- (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame;
31- (void) webView:(WebView *)view didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
32- (void) webView:(WebView *)view didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
33- (void) webView:(WebView *)view didFinishLoadForFrame:(WebFrame *)frame;
34- (void) webView:(WebView *)view didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame;
35- (void) webView:(WebView *)view didStartProvisionalLoadForFrame:(WebFrame *)frame;
36- (NSURLRequest *) webView:(WebView *)view resource:(id)resource willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source;
37- (void) webViewClose:(WebView *)view;
38- (bool) webView:(WebView *)view shouldRunJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;
39- (bool) webView:(WebView *)view shouldRunJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;
40- (bool) webView:(WebView *)view shouldRunJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)text initiatedByFrame:(WebFrame *)frame;
7e37a676 41- (void) webViewUpdateViewSettings:(UIWebView *)view;
2634b249
JF
42@end
43
44@interface CYWebView : UIWebView
45- (id<CYWebViewDelegate>) delegate;
46@end
47
43f3d7f6 48@interface WebScriptObject (UICaboodle)
96f3833b 49- (NSUInteger) count;
43f3d7f6
JF
50- (id) objectAtIndex:(unsigned)index;
51@end
52
2e6c1426 53@protocol BrowserControllerDelegate
54043703
JF
54- (void) retainNetworkActivityIndicator;
55- (void) releaseNetworkActivityIndicator;
028dbd1c 56- (CYViewController *) pageForURL:(NSURL *)url forExternal:(BOOL)external;
43f3d7f6 57@end
ab398adf 58
9b623dac 59@interface BrowserController : CYViewController <
2634b249
JF
60 CYWebViewDelegate,
61 HookProtocol,
62 UIWebViewDelegate
c21004b9 63> {
3931b718
JF
64 _transient CYWebView *webview_;
65 _transient UIScrollView *scroller_;
2634b249 66
7a11fbb9 67 UIActivityIndicatorView *indicator_;
facbc56d 68 IndirectDelegate *indirect_;
0ce617c8 69 NSURLAuthenticationChallenge *challenge_;
fe468f45
JF
70
71 bool error_;
0c7c9052 72 NSURLRequest *request_;
ab398adf 73
3931b718 74 _transient NSNumber *sensitive_;
2634b249 75
ab398adf 76 NSString *title_;
caa427d1 77 NSMutableSet *loading_;
a0376fc1 78
2634b249
JF
79 // XXX: NSString * or UIImage *
80 id custom_;
9fe5e5f8 81 NSString *style_;
caa427d1 82
9fe5e5f8 83 WebScriptObject *function_;
12b59862 84 WebScriptObject *closer_;
3e9c9e85
JF
85
86 float width_;
245cce8a 87 Class class_;
bc11cf5b 88
2634b249
JF
89 UIBarButtonItem *reloaditem_;
90 UIBarButtonItem *loadingitem_;
ab398adf
JF
91}
92
ea173384
JF
93+ (void) _initialize;
94
eb09425a
JF
95- (void) setURL:(NSURL *)url;
96
ab398adf
JF
97- (void) loadURL:(NSURL *)url cachePolicy:(NSURLRequestCachePolicy)policy;
98- (void) loadURL:(NSURL *)url;
99
100- (void) loadRequest:(NSURLRequest *)request;
101- (void) reloadURL;
12b59862 102- (bool) isLoading;
ab398adf 103
b5e7eebb 104- (id) init;
eb09425a 105- (id) initWithURL:(NSURL *)url;
b5e7eebb
GP
106- (id) initWithWidth:(float)width;
107- (id) initWithWidth:(float)width ofClass:(Class)_class;
ab398adf 108
caa427d1
JF
109- (void) callFunction:(WebScriptObject *)function;
110
2634b249
JF
111- (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame;
112- (NSURLRequest *) webView:(WebView *)view resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source;
43f3d7f6 113
3e9c9e85
JF
114+ (float) defaultWidth;
115
caa427d1
JF
116- (void) setButtonImage:(NSString *)button withStyle:(NSString *)style toFunction:(id)function;
117- (void) setButtonTitle:(NSString *)button withStyle:(NSString *)style toFunction:(id)function;
caa427d1
JF
118- (void) setPopupHook:(id)function;
119
c21004b9 120- (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)button;
a5938ea5 121- (void) customButtonClicked;
c21004b9
JF
122- (void) applyRightButton;
123
2634b249
JF
124- (void) _didStartLoading;
125- (void) _didFinishLoading;
126
c21004b9
JF
127- (void) close;
128
f196b921
JF
129- (void) dispatchEvent:(NSString *)event;
130
a5938ea5 131@end