1 #import <UICaboodle/RVPage.h>
2 #import <UICaboodle/RVBook.h>
4 #import <UIKit/UIKit.h>
6 #include <WebKit/DOMNodeList.h>
7 #include <WebKit/WebFrame.h>
8 #include <WebKit/WebScriptObject.h>
9 #include <WebKit/WebView.h>
11 #import <JavaScriptCore/JavaScriptCore.h>
13 #include "substrate.h"
15 @
class NSMutableArray
;
21 @
class UIDocumentWebView
;
26 @
class IndirectDelegate
;
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
;
46 @interface CYWebView
: UIWebView
47 - (id
<CYWebViewDelegate
>) delegate
;
50 @interface
WebScriptObject (UICaboodle
)
52 - (id
) objectAtIndex
:(unsigned)index
;
55 @protocol BrowserControllerDelegate
56 - (void) retainNetworkActivityIndicator
;
57 - (void) releaseNetworkActivityIndicator
;
58 - (CYViewController
*) pageForURL
:(NSURL
*)url forExternal
:(BOOL
)external
;
61 @interface BrowserController
: CYViewController
<
66 _transient CYWebView
*webview_
;
67 _transient UIScrollView
*scroller_
;
69 UIActivityIndicatorView
*indicator_
;
70 IndirectDelegate
*indirect_
;
71 NSURLAuthenticationChallenge
*challenge_
;
74 NSURLRequest
*request_
;
76 _transient NSNumber
*sensitive_
;
79 NSMutableSet
*loading_
;
81 // XXX: NSString * or UIImage *
85 _H
<WebScriptObject
> function_
;
86 WebScriptObject
*closer_
;
91 UIBarButtonItem
*reloaditem_
;
92 UIBarButtonItem
*loadingitem_
;
97 - (void) setURL
:(NSURL
*)url
;
99 - (void) loadURL
:(NSURL
*)url cachePolicy
:(NSURLRequestCachePolicy
)policy
;
100 - (void) loadURL
:(NSURL
*)url
;
102 - (void) loadRequest
:(NSURLRequest
*)request
;
105 - (void) reloadURLWithCache
:(BOOL
)cache
;
109 - (id
) initWithURL
:(NSURL
*)url
;
110 - (id
) initWithWidth
:(float)width
;
111 - (id
) initWithWidth
:(float)width ofClass
:(Class
)_class
;
113 - (void) callFunction
:(WebScriptObject
*)function
;
115 - (void) webView
:(WebView
*)view didClearWindowObject
:(WebScriptObject
*)window forFrame
:(WebFrame
*)frame
;
116 - (NSURLRequest
*) webView
:(WebView
*)view resource
:(id
)identifier willSendRequest
:(NSURLRequest
*)request redirectResponse
:(NSURLResponse
*)response fromDataSource
:(WebDataSource
*)source
;
118 + (float) defaultWidth
;
120 - (void) setButtonImage
:(NSString
*)button withStyle
:(NSString
*)style toFunction
:(id
)function
;
121 - (void) setButtonTitle
:(NSString
*)button withStyle
:(NSString
*)style toFunction
:(id
)function
;
122 - (void) setPopupHook
:(id
)function
;
124 - (void) alertView
:(UIAlertView
*)alert clickedButtonAtIndex
:(NSInteger
)button
;
125 - (void) customButtonClicked
;
126 - (void) applyRightButton
;
128 - (void) _didStartLoading
;
129 - (void) _didFinishLoading
;
133 - (void) dispatchEvent
:(NSString
*)event
;
135 - (void) setViewportWidthOnMainThread
:(float)value
;