]> git.saurik.com Git - cydia.git/blob - CyteKit/WebViewController.h
61c4c1af69cb199942635d5d5f61a9bdd4ecb031
[cydia.git] / CyteKit / WebViewController.h
1 /* Cydia - iPhone UIKit Front-End for Debian APT
2 * Copyright (C) 2008-2015 Jay Freeman (saurik)
3 */
4
5 /* GNU General Public License, Version 3 {{{ */
6 /*
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.
11 *
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.
16 *
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 **/
20 /* }}} */
21
22 #ifndef CyteKit_WebViewController_H
23 #define CyteKit_WebViewController_H
24
25 #include "CyteKit/ViewController.h"
26 #include "CyteKit/WebView.h"
27
28 #include <UIKit/UIKit.h>
29 #include <MessageUI/MessageUI.h>
30
31 @class IndirectDelegate;
32
33 @protocol CyteWebViewControllerDelegate
34 - (void) retainNetworkActivityIndicator;
35 - (void) releaseNetworkActivityIndicator;
36 - (CyteViewController *) pageForURL:(NSURL *)url forExternal:(BOOL)external withReferrer:(NSString *)referrer;
37 - (void) unloadData;
38 @end
39
40 @interface CyteWebViewController : CyteViewController <
41 CyteWebViewDelegate,
42 MFMailComposeViewControllerDelegate,
43 UIWebViewDelegate
44 >
45
46 + (void) _initialize;
47
48 - (CyteWebView *) webView;
49 - (CyteWebViewController *) indirect;
50
51 - (void) setRequest:(NSURLRequest *)request;
52 - (NSURLRequest *) request;
53
54 - (void) setURL:(NSURL *)url;
55 - (void) setURL:(NSURL *)url withReferrer:(NSString *)referrer;
56
57 - (void) loadURL:(NSURL *)url cachePolicy:(NSURLRequestCachePolicy)policy;
58 - (void) loadURL:(NSURL *)url;
59
60 - (void) loadRequest:(NSURLRequest *)request;
61 - (bool) isLoading;
62
63 - (id) init;
64
65 - (id) initWithURL:(NSURL *)url;
66 - (id) initWithRequest:(NSURLRequest *)request;
67
68 - (id) initWithWidth:(float)width;
69 - (id) initWithWidth:(float)width ofClass:(Class)_class;
70
71 - (void) callFunction:(WebScriptObject *)function;
72 - (void) reloadURLWithCache:(BOOL)cache;
73
74 - (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame;
75
76 - (NSURLRequest *) webView:(WebView *)view resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source;
77 - (NSURLRequest *) webThreadWebView:(WebView *)view resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source;
78
79 + (float) defaultWidth;
80
81 - (void) setButtonImage:(NSString *)button withStyle:(NSString *)style toFunction:(id)function;
82 - (void) setButtonTitle:(NSString *)button withStyle:(NSString *)style toFunction:(id)function;
83 - (void) setHidesNavigationBar:(bool)value;
84
85 - (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)button;
86 - (void) customButtonClicked;
87
88 - (void) applyRightButton;
89 - (UIBarButtonItem *) rightButton;
90
91 - (void) applyLeftButton;
92 - (UIBarButtonItem *) leftButton;
93
94 - (void) removeButton;
95
96 - (void) _didStartLoading;
97 - (void) _didFinishLoading;
98
99 - (void) close;
100
101 - (void) dispatchEvent:(NSString *)event;
102
103 - (void) setViewportWidthOnMainThread:(float)value;
104
105 - (void) setScrollAlwaysBounceVertical:(bool)value;
106 - (void) setScrollIndicatorStyle:(UIScrollViewIndicatorStyle)style;
107
108 - (void) registerFrame:(WebFrame *)frame;
109
110 @end
111
112 #endif//CyteKit_WebViewController_H