]>
Commit | Line | Data |
---|---|---|
819a0ab1 | 1 | /* Cydia - iPhone UIKit Front-End for Debian APT |
323746d3 | 2 | * Copyright (C) 2008-2013 Jay Freeman (saurik) |
819a0ab1 JF |
3 | */ |
4 | ||
6d9696a5 | 5 | /* GNU General Public License, Version 3 {{{ */ |
819a0ab1 | 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. | |
819a0ab1 | 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. | |
819a0ab1 | 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 | **/ | |
819a0ab1 JF |
20 | /* }}} */ |
21 | ||
d458596e JF |
22 | #ifndef CyteKit_WebViewController_H |
23 | #define CyteKit_WebViewController_H | |
819a0ab1 | 24 | |
d458596e JF |
25 | #include "CyteKit/ViewController.h" |
26 | #include "CyteKit/WebView.h" | |
819a0ab1 JF |
27 | |
28 | #include <UIKit/UIKit.h> | |
2b2a4e33 | 29 | #include <MessageUI/MessageUI.h> |
ab398adf | 30 | |
bf7c998c | 31 | #include <Menes/ObjectHandle.h> |
46d3a5cf | 32 | |
facbc56d | 33 | @class IndirectDelegate; |
43f3d7f6 | 34 | |
09e89a8a | 35 | @protocol CyteWebViewControllerDelegate |
54043703 JF |
36 | - (void) retainNetworkActivityIndicator; |
37 | - (void) releaseNetworkActivityIndicator; | |
f050e4d9 | 38 | - (CyteViewController *) pageForURL:(NSURL *)url forExternal:(BOOL)external withReferrer:(NSString *)referrer; |
302bf91c | 39 | - (void) unloadData; |
43f3d7f6 | 40 | @end |
ab398adf | 41 | |
cd79e8cf | 42 | @interface CyteWebViewController : CyteViewController < |
1ee69bb4 | 43 | CyteWebViewDelegate, |
2b2a4e33 | 44 | MFMailComposeViewControllerDelegate, |
2634b249 | 45 | UIWebViewDelegate |
c21004b9 | 46 | > { |
bf7c998c | 47 | _H<CyteWebView, 1> webview_; |
3931b718 | 48 | _transient UIScrollView *scroller_; |
2634b249 | 49 | |
7b33d201 | 50 | _H<UIActivityIndicatorView> indicator_; |
bf7c998c | 51 | _H<IndirectDelegate, 1> indirect_; |
7b33d201 | 52 | _H<NSURLAuthenticationChallenge> challenge_; |
fe468f45 JF |
53 | |
54 | bool error_; | |
a374f380 | 55 | _H<NSURLRequest> request_; |
d9fc1d37 | 56 | bool ready_; |
ab398adf | 57 | |
3931b718 | 58 | _transient NSNumber *sensitive_; |
2634b249 | 59 | |
7b33d201 JF |
60 | _H<NSString> title_; |
61 | _H<NSMutableSet> loading_; | |
a0376fc1 | 62 | |
aa1e1906 JF |
63 | _H<NSMutableSet> registered_; |
64 | _H<NSTimer> timer_; | |
65 | ||
2634b249 | 66 | // XXX: NSString * or UIImage * |
46d3a5cf JF |
67 | _H<NSObject> custom_; |
68 | _H<NSString> style_; | |
caa427d1 | 69 | |
46d3a5cf | 70 | _H<WebScriptObject> function_; |
3e9c9e85 JF |
71 | |
72 | float width_; | |
245cce8a | 73 | Class class_; |
bc11cf5b | 74 | |
7b33d201 JF |
75 | _H<UIBarButtonItem> reloaditem_; |
76 | _H<UIBarButtonItem> loadingitem_; | |
5cdfcd6f JF |
77 | |
78 | bool visible_; | |
79 | bool hidesNavigationBar_; | |
8366df5e | 80 | bool allowsNavigationAction_; |
ab398adf JF |
81 | } |
82 | ||
ea173384 JF |
83 | + (void) _initialize; |
84 | ||
6f837280 JF |
85 | - (CyteWebView *) webView; |
86 | ||
e8eda555 | 87 | - (void) setRequest:(NSURLRequest *)request; |
eb09425a | 88 | - (void) setURL:(NSURL *)url; |
f050e4d9 | 89 | - (void) setURL:(NSURL *)url withReferrer:(NSString *)referrer; |
eb09425a | 90 | |
ab398adf JF |
91 | - (void) loadURL:(NSURL *)url cachePolicy:(NSURLRequestCachePolicy)policy; |
92 | - (void) loadURL:(NSURL *)url; | |
93 | ||
94 | - (void) loadRequest:(NSURLRequest *)request; | |
12b59862 | 95 | - (bool) isLoading; |
ab398adf | 96 | |
b5e7eebb | 97 | - (id) init; |
68bd7c60 | 98 | |
eb09425a | 99 | - (id) initWithURL:(NSURL *)url; |
68bd7c60 JF |
100 | - (id) initWithRequest:(NSURLRequest *)request; |
101 | ||
b5e7eebb GP |
102 | - (id) initWithWidth:(float)width; |
103 | - (id) initWithWidth:(float)width ofClass:(Class)_class; | |
ab398adf | 104 | |
caa427d1 JF |
105 | - (void) callFunction:(WebScriptObject *)function; |
106 | ||
2634b249 JF |
107 | - (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame; |
108 | - (NSURLRequest *) webView:(WebView *)view resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source; | |
43f3d7f6 | 109 | |
3e9c9e85 JF |
110 | + (float) defaultWidth; |
111 | ||
caa427d1 JF |
112 | - (void) setButtonImage:(NSString *)button withStyle:(NSString *)style toFunction:(id)function; |
113 | - (void) setButtonTitle:(NSString *)button withStyle:(NSString *)style toFunction:(id)function; | |
5cdfcd6f | 114 | - (void) setHidesNavigationBar:(bool)value; |
caa427d1 | 115 | |
c21004b9 | 116 | - (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)button; |
a5938ea5 | 117 | - (void) customButtonClicked; |
d53628b6 | 118 | |
c21004b9 | 119 | - (void) applyRightButton; |
29756674 | 120 | - (UIBarButtonItem *) customButton; |
d53628b6 | 121 | - (UIBarButtonItem *) rightButton; |
c21004b9 | 122 | |
e6124cb6 JF |
123 | - (void) applyLeftButton; |
124 | - (UIBarButtonItem *) leftButton; | |
125 | ||
4cc9e99a JF |
126 | - (void) removeButton; |
127 | ||
2634b249 JF |
128 | - (void) _didStartLoading; |
129 | - (void) _didFinishLoading; | |
130 | ||
c21004b9 JF |
131 | - (void) close; |
132 | ||
f196b921 JF |
133 | - (void) dispatchEvent:(NSString *)event; |
134 | ||
8dbdaafa JF |
135 | - (void) setViewportWidthOnMainThread:(float)value; |
136 | ||
db698f42 | 137 | - (void) setScrollAlwaysBounceVertical:(bool)value; |
4886cc81 JF |
138 | - (void) setScrollIndicatorStyle:(UIScrollViewIndicatorStyle)style; |
139 | ||
aa1e1906 JF |
140 | - (void) registerFrame:(WebFrame *)frame; |
141 | ||
a5938ea5 | 142 | @end |
819a0ab1 | 143 | |
d458596e | 144 | #endif//CyteKit_WebViewController_H |