]> git.saurik.com Git - cydia.git/blob - UICaboodle/BrowserView.h
Update firmware.ver to 4.
[cydia.git] / UICaboodle / BrowserView.h
1 #import <UICaboodle/RVPage.h>
2 #import <UICaboodle/RVBook.h>
3
4 #import <UIKit/UIKit.h>
5
6 #include <WebKit/DOMNodeList.h>
7 #include <WebKit/WebFrame.h>
8 #include <WebKit/WebScriptObject.h>
9 #include <WebKit/WebView.h>
10
11 #import <JavaScriptCore/JavaScriptCore.h>
12
13 #include "substrate.h"
14
15 @class NSMutableArray;
16 @class NSString;
17 @class NSURL;
18 @class NSURLRequest;
19
20 @class UIScroller;
21 @class UIDocumentWebView;
22
23 @class WebView;
24
25 @class Database;
26 @class IndirectDelegate;
27
28 @protocol CYWebViewDelegate <UIWebViewDelegate>
29 - (void) webView:(WebView *)view addMessageToConsole:(NSDictionary *)message;
30 - (void) webView:(WebView *)view decidePolicyForNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener;
31 - (void) webView:(WebView *)view decidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)name decisionListener:(id<WebPolicyDecisionListener>)listener;
32 - (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame;
33 - (void) webView:(WebView *)view didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
34 - (void) webView:(WebView *)view didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
35 - (void) webView:(WebView *)view didFinishLoadForFrame:(WebFrame *)frame;
36 - (void) webView:(WebView *)view didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame;
37 - (void) webView:(WebView *)view didStartProvisionalLoadForFrame:(WebFrame *)frame;
38 - (NSURLRequest *) webView:(WebView *)view resource:(id)resource willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source;
39 - (void) webViewClose:(WebView *)view;
40 - (bool) webView:(WebView *)view shouldRunJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;
41 - (bool) webView:(WebView *)view shouldRunJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;
42 - (bool) webView:(WebView *)view shouldRunJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)text initiatedByFrame:(WebFrame *)frame;
43 - (void) webViewUpdateViewSettings:(UIWebView *)view;
44 @end
45
46 @interface CYWebView : UIWebView
47 - (id<CYWebViewDelegate>) delegate;
48 @end
49
50 @interface WebScriptObject (UICaboodle)
51 - (NSUInteger) count;
52 - (id) objectAtIndex:(unsigned)index;
53 @end
54
55 @protocol BrowserControllerDelegate
56 - (void) retainNetworkActivityIndicator;
57 - (void) releaseNetworkActivityIndicator;
58 - (CYViewController *) pageForURL:(NSURL *)url forExternal:(BOOL)external;
59 @end
60
61 @interface BrowserController : CYViewController <
62 CYWebViewDelegate,
63 HookProtocol,
64 UIWebViewDelegate
65 > {
66 _transient CYWebView *webview_;
67 _transient UIScrollView *scroller_;
68
69 UIActivityIndicatorView *indicator_;
70 IndirectDelegate *indirect_;
71 NSURLAuthenticationChallenge *challenge_;
72
73 bool error_;
74 _H<NSURLRequest> request_;
75
76 _transient NSNumber *sensitive_;
77
78 NSString *title_;
79 NSMutableSet *loading_;
80
81 // XXX: NSString * or UIImage *
82 _H<NSObject> custom_;
83 _H<NSString> style_;
84
85 _H<WebScriptObject> function_;
86 WebScriptObject *closer_;
87
88 float width_;
89 Class class_;
90
91 UIBarButtonItem *reloaditem_;
92 UIBarButtonItem *loadingitem_;
93
94 bool visible_;
95 bool hidesNavigationBar_;
96 bool allowsNavigationAction_;
97 }
98
99 + (void) _initialize;
100
101 - (void) setURL:(NSURL *)url;
102
103 - (void) loadURL:(NSURL *)url cachePolicy:(NSURLRequestCachePolicy)policy;
104 - (void) loadURL:(NSURL *)url;
105
106 - (void) loadRequest:(NSURLRequest *)request;
107 - (bool) isLoading;
108
109 - (void) reloadURLWithCache:(BOOL)cache;
110 - (void) reloadURL;
111
112 - (id) init;
113 - (id) initWithURL:(NSURL *)url;
114 - (id) initWithWidth:(float)width;
115 - (id) initWithWidth:(float)width ofClass:(Class)_class;
116
117 - (void) callFunction:(WebScriptObject *)function;
118
119 - (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame;
120 - (NSURLRequest *) webView:(WebView *)view resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source;
121
122 + (float) defaultWidth;
123
124 - (void) setButtonImage:(NSString *)button withStyle:(NSString *)style toFunction:(id)function;
125 - (void) setButtonTitle:(NSString *)button withStyle:(NSString *)style toFunction:(id)function;
126 - (void) setPopupHook:(id)function;
127 - (void) setHidesNavigationBar:(bool)value;
128
129 - (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)button;
130 - (void) customButtonClicked;
131 - (void) applyRightButton;
132
133 - (void) _didStartLoading;
134 - (void) _didFinishLoading;
135
136 - (void) close;
137
138 - (void) dispatchEvent:(NSString *)event;
139
140 - (void) setViewportWidthOnMainThread:(float)value;
141
142 @end