]> git.saurik.com Git - cydia.git/blame - UICaboodle/BrowserView.h
Use actual types for fields rather than id (UISwitch and *TabBarController).
[cydia.git] / UICaboodle / BrowserView.h
CommitLineData
a2ae332e
JF
1#import <UICaboodle/RVPage.h>
2#import <UICaboodle/RVBook.h>
3
4#import <UIKit/UIKit.h>
59efd93a 5
bde2d79b 6#include <WebKit/DOMNodeList.h>
bde2d79b 7#include <WebKit/WebFrame.h>
bde2d79b 8#include <WebKit/WebScriptObject.h>
1e4922b8 9#include <WebKit/WebView.h>
bde2d79b
JF
10
11#import <JavaScriptCore/JavaScriptCore.h>
12
59efd93a
JF
13@class NSMutableArray;
14@class NSString;
15@class NSURL;
16@class NSURLRequest;
17
18@class UIProgressIndicator;
19@class UIScroller;
20b8724d 20@class UIDocumentWebView;
59efd93a 21
d210b85d
JF
22@class WebView;
23
59efd93a 24@class Database;
20b8724d 25@class IndirectDelegate;
61b13cae 26
c2292b80
JF
27@protocol CYWebViewDelegate <UIWebViewDelegate>
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;
41@end
42
43@interface CYWebView : UIWebView
44- (id<CYWebViewDelegate>) delegate;
45@end
46
61b13cae 47@interface WebScriptObject (UICaboodle)
485f16d6 48- (NSUInteger) count;
61b13cae
JF
49- (id) objectAtIndex:(unsigned)index;
50@end
51
c8e3b4b3 52@protocol BrowserControllerDelegate
881fe77f 53- (CYViewController *) pageForURL:(NSURL *)url hasTag:(int *)tag;
61b13cae 54@end
59efd93a 55
881fe77f 56@interface BrowserController : CYViewController <
c2292b80
JF
57 CYWebViewDelegate,
58 HookProtocol,
59 UIWebViewDelegate
1e4922b8 60> {
c2292b80
JF
61 CYWebView *webview_;
62 UIScrollView *scroller_;
63
59efd93a 64 UIProgressIndicator *indicator_;
20b8724d 65 IndirectDelegate *indirect_;
67c04058 66 NSURLAuthenticationChallenge *challenge_;
f4772bd1
JF
67
68 bool error_;
2c3974c5 69 NSURLRequest *request_;
59efd93a 70
0fc560b6 71 NSNumber *sensitive_;
c2292b80 72
59efd93a 73 NSString *title_;
9d7f5e2d 74 NSMutableSet *loading_;
48c0461e 75
c2292b80
JF
76 // XXX: NSString * or UIImage *
77 id custom_;
a99d2808 78 NSString *style_;
9d7f5e2d 79
a99d2808 80 WebScriptObject *function_;
1ce016d4 81 WebScriptObject *closer_;
7b00c562
JF
82
83 float width_;
85021801 84 Class class_;
f99f86e2 85
c2292b80
JF
86 UIBarButtonItem *reloaditem_;
87 UIBarButtonItem *loadingitem_;
59efd93a
JF
88}
89
4825688a
JF
90+ (void) _initialize;
91
59efd93a
JF
92- (void) loadURL:(NSURL *)url cachePolicy:(NSURLRequestCachePolicy)policy;
93- (void) loadURL:(NSURL *)url;
94
95- (void) loadRequest:(NSURLRequest *)request;
96- (void) reloadURL;
1ce016d4 97- (bool) isLoading;
59efd93a 98
9ae52960
GP
99- (id) init;
100- (id) initWithWidth:(float)width;
101- (id) initWithWidth:(float)width ofClass:(Class)_class;
59efd93a 102
9d7f5e2d
JF
103- (void) callFunction:(WebScriptObject *)function;
104
c2292b80
JF
105- (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame;
106- (NSURLRequest *) webView:(WebView *)view resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source;
61b13cae 107
7b00c562
JF
108+ (float) defaultWidth;
109
9d7f5e2d
JF
110- (void) setButtonImage:(NSString *)button withStyle:(NSString *)style toFunction:(id)function;
111- (void) setButtonTitle:(NSString *)button withStyle:(NSString *)style toFunction:(id)function;
9d7f5e2d
JF
112- (void) setPopupHook:(id)function;
113
1e4922b8 114- (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)button;
3db9f43c 115- (void) customButtonClicked;
1e4922b8
JF
116- (void) applyRightButton;
117
c2292b80
JF
118- (void) _didStartLoading;
119- (void) _didFinishLoading;
120
1e4922b8
JF
121- (void) close;
122
3db9f43c 123@end