]> git.saurik.com Git - cydia.git/blame - UICaboodle/BrowserView.h
Add _unlikely() to conditions in -[Package unfiltered].
[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
59efd93a 18@class UIScroller;
20b8724d 19@class UIDocumentWebView;
59efd93a 20
d210b85d
JF
21@class WebView;
22
59efd93a 23@class Database;
20b8724d 24@class IndirectDelegate;
61b13cae 25
c2292b80
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;
9297d5d5 40- (void) webViewUpdateViewSettings:(UIWebView *)view;
c2292b80
JF
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
935e634f
JF
53- (void) retainNetworkActivityIndicator;
54- (void) releaseNetworkActivityIndicator;
881fe77f 55- (CYViewController *) pageForURL:(NSURL *)url hasTag:(int *)tag;
61b13cae 56@end
59efd93a 57
881fe77f 58@interface BrowserController : CYViewController <
c2292b80
JF
59 CYWebViewDelegate,
60 HookProtocol,
61 UIWebViewDelegate
1e4922b8 62> {
a591888a
JF
63 _transient CYWebView *webview_;
64 _transient UIScrollView *scroller_;
c2292b80 65
beb5da99 66 UIActivityIndicatorView *indicator_;
20b8724d 67 IndirectDelegate *indirect_;
67c04058 68 NSURLAuthenticationChallenge *challenge_;
f4772bd1
JF
69
70 bool error_;
2c3974c5 71 NSURLRequest *request_;
59efd93a 72
a591888a 73 _transient NSNumber *sensitive_;
c2292b80 74
59efd93a 75 NSString *title_;
9d7f5e2d 76 NSMutableSet *loading_;
48c0461e 77
c2292b80
JF
78 // XXX: NSString * or UIImage *
79 id custom_;
a99d2808 80 NSString *style_;
9d7f5e2d 81
a99d2808 82 WebScriptObject *function_;
1ce016d4 83 WebScriptObject *closer_;
7b00c562
JF
84
85 float width_;
85021801 86 Class class_;
f99f86e2 87
c2292b80
JF
88 UIBarButtonItem *reloaditem_;
89 UIBarButtonItem *loadingitem_;
59efd93a
JF
90}
91
4825688a
JF
92+ (void) _initialize;
93
59efd93a
JF
94- (void) loadURL:(NSURL *)url cachePolicy:(NSURLRequestCachePolicy)policy;
95- (void) loadURL:(NSURL *)url;
96
97- (void) loadRequest:(NSURLRequest *)request;
98- (void) reloadURL;
1ce016d4 99- (bool) isLoading;
59efd93a 100
9ae52960
GP
101- (id) init;
102- (id) initWithWidth:(float)width;
103- (id) initWithWidth:(float)width ofClass:(Class)_class;
59efd93a 104
9d7f5e2d
JF
105- (void) callFunction:(WebScriptObject *)function;
106
c2292b80
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;
61b13cae 109
7b00c562
JF
110+ (float) defaultWidth;
111
9d7f5e2d
JF
112- (void) setButtonImage:(NSString *)button withStyle:(NSString *)style toFunction:(id)function;
113- (void) setButtonTitle:(NSString *)button withStyle:(NSString *)style toFunction:(id)function;
9d7f5e2d
JF
114- (void) setPopupHook:(id)function;
115
1e4922b8 116- (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)button;
3db9f43c 117- (void) customButtonClicked;
1e4922b8
JF
118- (void) applyRightButton;
119
c2292b80
JF
120- (void) _didStartLoading;
121- (void) _didFinishLoading;
122
1e4922b8
JF
123- (void) close;
124
3db9f43c 125@end