]>
Commit | Line | Data |
---|---|---|
aa35fd7b | 1 | /* Cydia - iPhone UIKit Front-End for Debian APT |
4c66fad9 | 2 | * Copyright (C) 2008-2015 Jay Freeman (saurik) |
aa35fd7b JF |
3 | */ |
4 | ||
6d9696a5 | 5 | /* GNU General Public License, Version 3 {{{ */ |
aa35fd7b | 6 | /* |
6d9696a5 JF |
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. | |
aa35fd7b | 11 | * |
6d9696a5 JF |
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. | |
aa35fd7b | 16 | * |
6d9696a5 JF |
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/>. | |
19 | **/ | |
aa35fd7b JF |
20 | /* }}} */ |
21 | ||
22 | #ifndef CyteKit_CydiaBrowser_H | |
23 | #define CyteKit_CydiaBrowser_H | |
24 | ||
25 | #include <UIKit/UIKit.h> | |
26 | ||
63755c48 | 27 | @protocol WebPolicyDecisionListener; |
aa35fd7b | 28 | |
63755c48 JF |
29 | @class WebDataSource; |
30 | @class WebFrame; | |
31 | @class WebScriptObject; | |
32 | @class WebView; | |
aa35fd7b | 33 | |
d323285e JF |
34 | enum CYWebPolicyDecision { |
35 | CYWebPolicyDecisionUnknown, | |
36 | CYWebPolicyDecisionDownload, | |
37 | CYWebPolicyDecisionIgnore, | |
38 | CYWebPolicyDecisionUse, | |
39 | }; | |
40 | ||
1ee69bb4 | 41 | @protocol CyteWebViewDelegate <UIWebViewDelegate> |
4cc9e99a | 42 | @optional |
aa35fd7b JF |
43 | - (void) webView:(WebView *)view addMessageToConsole:(NSDictionary *)message; |
44 | - (void) webView:(WebView *)view decidePolicyForNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener; | |
45 | - (void) webView:(WebView *)view decidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)name decisionListener:(id<WebPolicyDecisionListener>)listener; | |
46 | - (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame; | |
64ffa332 | 47 | - (void) webView:(WebView *)view didCommitLoadForFrame:(WebFrame *)frame; |
d323285e | 48 | - (void) webView:(WebView *)view didDecidePolicy:(CYWebPolicyDecision)decision forNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request frame:(WebFrame *)frame; |
aa35fd7b JF |
49 | - (void) webView:(WebView *)view didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame; |
50 | - (void) webView:(WebView *)view didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame; | |
51 | - (void) webView:(WebView *)view didFinishLoadForFrame:(WebFrame *)frame; | |
52 | - (void) webView:(WebView *)view didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame; | |
53 | - (void) webView:(WebView *)view didStartProvisionalLoadForFrame:(WebFrame *)frame; | |
754456f5 JF |
54 | - (void) webView:(WebView *)view resource:(id)identifier didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)source; |
55 | - (void) webView:(WebView *)view resource:(id)identifier didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)source; | |
aa35fd7b | 56 | - (NSURLRequest *) webView:(WebView *)view resource:(id)resource willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source; |
92de61aa | 57 | - (NSURLRequest *) webThreadWebView:(WebView *)view resource:(id)resource willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source; |
aa35fd7b JF |
58 | - (void) webViewClose:(WebView *)view; |
59 | - (bool) webView:(WebView *)view shouldRunJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame; | |
60 | - (bool) webView:(WebView *)view shouldRunJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame; | |
61 | - (bool) webView:(WebView *)view shouldRunJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)text initiatedByFrame:(WebFrame *)frame; | |
62 | - (void) webViewUpdateViewSettings:(UIWebView *)view; | |
63 | @end | |
64 | ||
f8c9fd4c | 65 | @interface CyteWebView : UIWebView |
aa35fd7b | 66 | |
1ee69bb4 | 67 | - (id<CyteWebViewDelegate>) delegate; |
4cc9e99a JF |
68 | - (void) setDelegate:(id<CyteWebViewDelegate>)delegate; |
69 | ||
4bcafc01 | 70 | - (void) dispatchEvent:(NSString *)event; |
a713fcd3 | 71 | - (void) reloadFromOrigin; |
d821ecc1 | 72 | - (UIScrollView *) scrollView; |
09865663 | 73 | - (NSURLRequest *) request; |
aa35fd7b JF |
74 | |
75 | @end | |
76 | ||
77 | #endif//CyteKit_CydiaBrowser_H |