]> 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
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
18@class UIProgressIndicator;
19@class UIScroller;
facbc56d 20@class UIDocumentWebView;
ab398adf 21
a9543575
JF
22@class WebView;
23
ab398adf 24@class Database;
facbc56d 25@class IndirectDelegate;
43f3d7f6 26
2634b249
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
43f3d7f6 47@interface WebScriptObject (UICaboodle)
96f3833b 48- (NSUInteger) count;
43f3d7f6
JF
49- (id) objectAtIndex:(unsigned)index;
50@end
51
2e6c1426 52@protocol BrowserControllerDelegate
9b623dac 53- (CYViewController *) pageForURL:(NSURL *)url hasTag:(int *)tag;
43f3d7f6 54@end
ab398adf 55
9b623dac 56@interface BrowserController : CYViewController <
2634b249
JF
57 CYWebViewDelegate,
58 HookProtocol,
59 UIWebViewDelegate
c21004b9 60> {
2634b249
JF
61 CYWebView *webview_;
62 UIScrollView *scroller_;
63
ab398adf 64 UIProgressIndicator *indicator_;
facbc56d 65 IndirectDelegate *indirect_;
0ce617c8 66 NSURLAuthenticationChallenge *challenge_;
fe468f45
JF
67
68 bool error_;
0c7c9052 69 NSURLRequest *request_;
ab398adf 70
0dceb29b 71 NSNumber *sensitive_;
2634b249 72
ab398adf 73 NSString *title_;
caa427d1 74 NSMutableSet *loading_;
a0376fc1 75
2634b249
JF
76 // XXX: NSString * or UIImage *
77 id custom_;
9fe5e5f8 78 NSString *style_;
caa427d1 79
9fe5e5f8 80 WebScriptObject *function_;
12b59862 81 WebScriptObject *closer_;
3e9c9e85
JF
82
83 float width_;
245cce8a 84 Class class_;
bc11cf5b 85
2634b249
JF
86 UIBarButtonItem *reloaditem_;
87 UIBarButtonItem *loadingitem_;
ab398adf
JF
88}
89
ea173384
JF
90+ (void) _initialize;
91
ab398adf
JF
92- (void) loadURL:(NSURL *)url cachePolicy:(NSURLRequestCachePolicy)policy;
93- (void) loadURL:(NSURL *)url;
94
95- (void) loadRequest:(NSURLRequest *)request;
96- (void) reloadURL;
12b59862 97- (bool) isLoading;
ab398adf 98
b5e7eebb
GP
99- (id) init;
100- (id) initWithWidth:(float)width;
101- (id) initWithWidth:(float)width ofClass:(Class)_class;
ab398adf 102
caa427d1
JF
103- (void) callFunction:(WebScriptObject *)function;
104
2634b249
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;
43f3d7f6 107
3e9c9e85
JF
108+ (float) defaultWidth;
109
caa427d1
JF
110- (void) setButtonImage:(NSString *)button withStyle:(NSString *)style toFunction:(id)function;
111- (void) setButtonTitle:(NSString *)button withStyle:(NSString *)style toFunction:(id)function;
caa427d1
JF
112- (void) setPopupHook:(id)function;
113
c21004b9 114- (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)button;
a5938ea5 115- (void) customButtonClicked;
c21004b9
JF
116- (void) applyRightButton;
117
2634b249
JF
118- (void) _didStartLoading;
119- (void) _didFinishLoading;
120
c21004b9
JF
121- (void) close;
122
a5938ea5 123@end