1 /* Cydia - iPhone UIKit Front-End for Debian APT
2 * Copyright (C) 2008-2013 Jay Freeman (saurik)
5 /* GNU General Public License, Version 3 {{{ */
7 * Cydia is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published
9 * by the Free Software Foundation, either version 3 of the License,
10 * or (at your option) any later version.
12 * Cydia is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Cydia. If not, see <http://www.gnu.org/licenses/>.
22 #ifndef CyteKit_CydiaBrowser_H
23 #define CyteKit_CydiaBrowser_H
25 #include <UIKit/UIKit.h>
27 #include <WebKit/DOMNodeList.h>
28 #include <WebKit/WebFrame.h>
29 #include <WebKit/WebPolicyDelegate.h>
30 #include <WebKit/WebScriptObject.h>
31 #include <WebKit/WebView.h>
33 #include <JavaScriptCore/JavaScriptCore.h>
35 enum CYWebPolicyDecision
{
36 CYWebPolicyDecisionUnknown
,
37 CYWebPolicyDecisionDownload
,
38 CYWebPolicyDecisionIgnore
,
39 CYWebPolicyDecisionUse
,
42 @protocol CyteWebViewDelegate
<UIWebViewDelegate
>
44 - (void) webView
:(WebView
*)view addMessageToConsole
:(NSDictionary
*)message
;
45 - (void) webView
:(WebView
*)view decidePolicyForNavigationAction
:(NSDictionary
*)action request
:(NSURLRequest
*)request frame
:(WebFrame
*)frame decisionListener
:(id
<WebPolicyDecisionListener
>)listener
;
46 - (void) webView
:(WebView
*)view decidePolicyForNewWindowAction
:(NSDictionary
*)action request
:(NSURLRequest
*)request newFrameName
:(NSString
*)name decisionListener
:(id
<WebPolicyDecisionListener
>)listener
;
47 - (void) webView
:(WebView
*)view didClearWindowObject
:(WebScriptObject
*)window forFrame
:(WebFrame
*)frame
;
48 - (void) webView
:(WebView
*)view didCommitLoadForFrame
:(WebFrame
*)frame
;
49 - (void) webView
:(WebView
*)view didDecidePolicy
:(CYWebPolicyDecision
)decision forNavigationAction
:(NSDictionary
*)action request
:(NSURLRequest
*)request frame
:(WebFrame
*)frame
;
50 - (void) webView
:(WebView
*)view didFailLoadWithError
:(NSError
*)error forFrame
:(WebFrame
*)frame
;
51 - (void) webView
:(WebView
*)view didFailProvisionalLoadWithError
:(NSError
*)error forFrame
:(WebFrame
*)frame
;
52 - (void) webView
:(WebView
*)view didFinishLoadForFrame
:(WebFrame
*)frame
;
53 - (void) webView
:(WebView
*)view didReceiveTitle
:(NSString
*)title forFrame
:(WebFrame
*)frame
;
54 - (void) webView
:(WebView
*)view didStartProvisionalLoadForFrame
:(WebFrame
*)frame
;
55 - (NSURLRequest
*) webView
:(WebView
*)view resource
:(id
)resource willSendRequest
:(NSURLRequest
*)request redirectResponse
:(NSURLResponse
*)response fromDataSource
:(WebDataSource
*)source
;
56 - (void) webViewClose
:(WebView
*)view
;
57 - (bool) webView
:(WebView
*)view shouldRunJavaScriptAlertPanelWithMessage
:(NSString
*)message initiatedByFrame
:(WebFrame
*)frame
;
58 - (bool) webView
:(WebView
*)view shouldRunJavaScriptConfirmPanelWithMessage
:(NSString
*)message initiatedByFrame
:(WebFrame
*)frame
;
59 - (bool) webView
:(WebView
*)view shouldRunJavaScriptTextInputPanelWithPrompt
:(NSString
*)prompt defaultText
:(NSString
*)text initiatedByFrame
:(WebFrame
*)frame
;
60 - (void) webViewUpdateViewSettings
:(UIWebView
*)view
;
63 @interface CyteWebView
: UIWebView
{
66 - (id
<CyteWebViewDelegate
>) delegate
;
67 - (void) setDelegate
:(id
<CyteWebViewDelegate
>)delegate
;
69 - (void) dispatchEvent
:(NSString
*)event
;
70 - (void) reloadFromOrigin
;
71 - (UIScrollView
*) scrollView
;
72 - (NSURLRequest
*) request
;
76 #endif//CyteKit_CydiaBrowser_H