]> git.saurik.com Git - cydia.git/blob - iPhonePrivate.h
Use modified URL during willSendRequest:.
[cydia.git] / iPhonePrivate.h
1 #ifndef CYDIA_UIKITPRIVATE_H
2 #define CYDIA_UIKITPRIVATE_H
3
4 // #include <*> {{{
5 #include <GraphicsServices/GraphicsServices.h>
6 // }}}
7 // typedef enum {*} *; {{{
8 typedef enum {
9 UIGestureAttributeMinDegrees, /*float*/
10 UIGestureAttributeMaxDegrees, /*float*/
11 UIGestureAttributeMinScale, /*float*/
12 UIGestureAttributeMaxScale, /*float*/
13 UIGestureAttributeIsZoomRubberBandEnabled, /*BOOL*/
14 UIGestureAttributeZoomsFromCurrentToMinOrMax, /*BOOL*/
15 UIGestureAttributeVisibleSize, /*CGSize*/
16 UIGestureAttributeUpdatesScroller, /*BOOL*/
17 } UIGestureAttribute;
18
19 typedef enum {
20 UINavigationButtonStyleNormal,
21 UINavigationButtonStyleBack,
22 UINavigationButtonStyleHighlighted,
23 UINavigationButtonStyleDestructive
24 } UINavigationButtonStyle;
25
26 typedef enum {
27 UIProgressIndicatorStyleLargeWhite,
28 UIProgressIndicatorStyleMediumWhite,
29 UIProgressIndicatorStyleMediumBrown,
30 UIProgressIndicatorStyleSmallWhite,
31 UIProgressIndicatorStyleSmallBlack,
32 UIProgressIndicatorStyleTinyWhite,
33 } UIProgressIndicatorStyle;
34 // }}}
35 // #define * * {{{
36 #define UIDataDetectorTypeAutomatic 0x80000000
37 // }}}
38 // @class Web*; {{{
39 @class WebDataSource;
40 @class WebScriptObject;
41 @class WebView;
42 // }}}
43 // @protocol *; {{{
44 @protocol WebPolicyDecisionListener;
45 // }}}
46
47 // @interface * : UIView {{{
48 @interface UIFormAssistant : UIView
49 + (UIFormAssistant *) sharedFormAssistant;
50 - (CGRect) peripheralFrame;
51 @end
52
53 @interface UIKeyboard : UIView
54 + (void) initImplementationNow;
55 @end
56
57 @interface UIProgressBar : UIView
58 + (CGSize) defaultSize;
59 - (void) setProgress:(float)progress;
60 - (void) setStyle:(NSInteger)style;
61 @end
62
63 @interface UIProgressHUD : UIView
64 - (void) hide;
65 - (void) setText:(NSString *)text;
66 - (void) showInView:(UIView *)view;
67 @end
68
69 @interface UIProgressIndicator : UIView
70 + (CGSize) defaultSizeForStyle:(NSUInteger)style;
71 - (NSUInteger) activityIndicatorViewStyle;
72 - (void) setStyle:(UIProgressIndicatorStyle)style;
73 - (void) startAnimation;
74 @end
75
76 @interface UIScroller : UIView
77 - (CGSize) contentSize;
78 - (void) setDirectionalScrolling:(BOOL)directional;
79 - (void) setEventMode:(NSInteger)mode;
80 - (void) setOffset:(CGPoint)offset;
81 - (void) setScrollDecelerationFactor:(float)factor;
82 - (void) setScrollHysteresis:(float)hysteresis;
83 - (void) setScrollerIndicatorStyle:(UIScrollViewIndicatorStyle)style;
84 - (void) setThumbDetectionEnabled:(BOOL)enabled;
85 @end
86
87 @interface UITextLabel : UIView
88 - (void) setCentersHorizontally:(BOOL)centers;
89 - (void) setColor:(UIColor *)color;
90 - (void) setFont:(UIFont *)font;
91 - (void) setText:(NSString *)text;
92 @end
93
94 @interface UITransitionView : UIView
95 @end
96
97 @interface UIWebDocumentView : UIView
98 - (CGRect) documentBounds;
99 - (void) enableReachability;
100 - (void) loadRequest:(NSURLRequest *)request;
101 - (void) redrawScaledDocument;
102 - (void) setAllowsImageSheet:(BOOL)allows;
103 - (void) setAllowsMessaging:(BOOL)allows;
104 - (void) setAutoresizes:(BOOL)autoresizes;
105 - (void) setContentsPosition:(NSInteger)position;
106 - (void) setDrawsBackground:(BOOL)draws;
107 - (void) _setDocumentType:(NSInteger)type;
108 - (void) setDrawsGrid:(BOOL)draws;
109 - (void) setInitialScale:(float)scale forDocumentTypes:(NSInteger)types;
110 - (void) setLogsTilingChanges:(BOOL)logs;
111 - (void) setMinimumScale:(float)scale forDocumentTypes:(NSInteger)types;
112 - (void) setMinimumSize:(CGSize)size;
113 - (void) setMaximumScale:(float)scale forDocumentTypes:(NSInteger)tpyes;
114 - (void) setSmoothsFonts:(BOOL)smooths;
115 - (void) setTileMinificationFilter:(NSString *)filter;
116 - (void) setTileSize:(CGSize)size;
117 - (void) setTilingEnabled:(BOOL)enabled;
118 - (void) setViewportSize:(CGSize)size forDocumentTypes:(NSInteger)types;
119 - (void) setZoomsFocusedFormControl:(BOOL)zooms;
120 - (void) useSelectionAssistantWithMode:(NSInteger)mode;
121 - (WebView *) webView;
122 @end
123
124 @interface UIWebViewWebViewDelegate : NSObject {
125 @public UIWebView *uiWebView;
126 }
127
128 - (void) _clearUIWebView;
129
130 @end
131 // }}}
132 // @interface *Button : * {{{
133 @interface UINavigationButton : UIButton
134 - (id) initWithTitle:(NSString *)title style:(UINavigationButtonStyle)style;
135 - (void) setBarStyle:(UIBarStyle)style;
136 @end
137
138 @interface UIPushButton : UIControl
139 - (id) backgroundForState:(NSUInteger)state;
140 - (void) setAutosizesToFit:(BOOL)autosizes;
141 - (void) setBackground:(id)background forState:(NSUInteger)state;
142 - (void) setDrawsShadow:(BOOL)draws;
143 - (void) setStretchBackground:(BOOL)stretch;
144 - (void) setTitle:(NSString *)title;
145 - (void) setTitleFont:(UIFont *)font;
146 @end
147
148 @interface UIThreePartButton : UIPushButton
149 @end
150 // }}}
151 // @interface * : NS* {{{
152 @interface WebDefaultUIKitDelegate : NSObject
153 + (WebDefaultUIKitDelegate *) sharedUIKitDelegate;
154 @end
155 // }}}
156 // @interface UIWeb* : * {{{
157 @interface UIWebBrowserView : UIWebDocumentView
158 @end
159
160 @interface UIWebTouchEventsGestureRecognizer : UIGestureRecognizer
161 - (int) type;
162 - (NSString *) _typeDescription;
163 @end
164 // }}}
165
166 // @interface NS* (*) {{{
167 @interface NSMutableURLRequest (Apple)
168 - (void) setHTTPShouldUsePipelining:(BOOL)pipelining;
169 @end
170
171 @interface NSString (Apple)
172 - (NSString *) stringByAddingPercentEscapes;
173 - (NSString *) stringByReplacingCharacter:(UniChar)from withCharacter:(UniChar)to;
174 @end
175
176 @interface NSURL (Apple)
177 - (BOOL) isGoogleMapsURL;
178 - (BOOL) isSpringboardHandledURL;
179 // XXX: make this an enum
180 - (NSURL *) itmsURL:(NSInteger *)store;
181 - (NSURL *) mapsURL;
182 - (NSURL *) phobosURL;
183 - (NSURL *) youTubeURL;
184 @end
185
186 @interface NSURLRequest (Apple)
187 + (BOOL) allowsAnyHTTPSCertificateForHost:(NSString *)host;
188 + (void) setAllowsAnyHTTPSCertificate:(BOOL)allow forHost:(NSString *)host;
189 @end
190
191 @interface NSValue (Apple)
192 + (NSValue *) valueWithSize:(CGSize)size;
193 @end
194 // }}}
195 // @interface UI* (*) {{{
196 @interface UIActionSheet (Apple)
197 - (void) setContext:(NSString *)context;
198 - (NSString *) context;
199 @end
200
201 @interface UIAlertView (Apple)
202 - (void) addTextFieldWithValue:(NSString *)value label:(NSString *)label;
203 - (id) buttons;
204 - (NSString *) context;
205 - (void) setContext:(NSString *)context;
206 - (void) setNumberOfRows:(int)rows;
207 - (void) setRunsModal:(BOOL)modal;
208 - (UITextField *) textField;
209 - (UITextField *) textFieldAtIndex:(NSUInteger)index;
210 - (void) _updateFrameForDisplay;
211 @end
212
213 @interface UIApplication (Apple)
214 - (void) applicationSuspend:(GSEventRef)event;
215 - (void) _animateSuspension:(BOOL)suspend duration:(double)duration startTime:(double)start scale:(float)scale;
216 - (void) applicationOpenURL:(NSURL *)url;
217 - (void) applicationWillResignActive:(UIApplication *)application;
218 - (void) applicationWillSuspend;
219 - (void) launchApplicationWithIdentifier:(NSString *)identifier suspended:(BOOL)suspended;
220 - (void) openURL:(NSURL *)url asPanel:(BOOL)panel;
221 - (void) setStatusBarShowsProgress:(BOOL)shows;
222 - (void) _setSuspended:(BOOL)suspended;
223 - (void) terminateWithSuccess;
224 @end
225
226 @interface UIBarButtonItem (Apple)
227 - (UIView *) view;
228 @end
229
230 @interface UIColor (Apple)
231 + (UIColor *) pinStripeColor;
232 @end
233
234 @interface UIControl (Apple)
235 - (void) addTarget:(id)target action:(SEL)action forEvents:(NSInteger)events;
236 @end
237
238 @interface UIDevice (Apple)
239 - (BOOL) isWildcat;
240 @end
241
242 @interface UIImage (Apple)
243 + (UIImage *) applicationImageNamed:(NSString *)name;
244 + (UIImage *) imageAtPath:(NSString *)path;
245 @end
246
247 @interface UINavigationBar (Apple)
248 + (CGSize) defaultSize;
249 - (UIBarStyle) _barStyle:(BOOL)style;
250 @end
251
252 @interface UIScrollView (Apple)
253 - (void) setScrollingEnabled:(BOOL)enabled;
254 - (void) setShowBackgroundShadow:(BOOL)show;
255 @end
256
257 @interface UISearchBar (Apple)
258 - (UITextField *) searchField;
259 @end
260
261 @interface UITabBarController (Apple)
262 - (UITransitionView *) _transitionView;
263 - (void) concealTabBarSelection;
264 - (void) revealTabBarSelection;
265 @end
266
267 @interface UITabBarItem (Apple)
268 - (void) setAnimatedBadge:(BOOL)animated;
269 @end
270
271 @interface UITableViewCell (Apple)
272 - (float) selectionPercent;
273 - (void) _updateHighlightColorsForView:(id)view highlighted:(BOOL)highlighted;
274 @end
275
276 @interface UITextField (Apple)
277 - (UITextInputTraits *) textInputTraits;
278 @end
279
280 @interface UITextView (Apple)
281 - (UIFont *) font;
282 - (void) setAllowsRubberBanding:(BOOL)rubberbanding;
283 - (void) setFont:(UIFont *)font;
284 - (void) setMarginTop:(int)margin;
285 - (void) setTextColor:(UIColor *)color;
286 @end
287
288 @interface UIView (Apple)
289 - (UIScroller *) _scroller;
290 - (void) setClipsSubviews:(BOOL)clips;
291 - (void) setEnabledGestures:(NSInteger)gestures;
292 - (void) setFixedBackgroundPattern:(BOOL)fixed;
293 - (void) setGestureDelegate:(id)delegate;
294 - (void) setNeedsDisplayOnBoundsChange:(BOOL)needs;
295 - (void) setValue:(NSValue *)value forGestureAttribute:(NSInteger)attribute;
296 - (void) setZoomScale:(float)scale duration:(double)duration;
297 - (void) _setZoomScale:(float)scale duration:(double)duration;
298 @end
299
300 @interface UIViewController (Apple)
301 - (void) _updateLayoutForStatusBarAndInterfaceOrientation;
302 - (void) unloadView;
303 @end
304
305 @interface UIWindow (Apple)
306 - (UIResponder *) firstResponder;
307 - (void) makeKey:(UIApplication *)application;
308 - (void) orderFront:(UIApplication *)application;
309 @end
310
311 @interface UIWebView (Apple)
312 - (UIWebDocumentView *) _documentView;
313 - (UIScrollView *) _scrollView;
314 - (UIScroller *) _scroller;
315 - (void) _updateViewSettings;
316 - (void) webView:(WebView *)view addMessageToConsole:(NSDictionary *)message;
317 //- (WebView *) webView:(WebView *)view createWebViewWithRequest:(NSURLRequest *)request;
318 - (void) webView:(WebView *)view decidePolicyForNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener;
319 - (void) webView:(WebView *)view decidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)name decisionListener:(id<WebPolicyDecisionListener>)listener;
320 - (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame;
321 - (void) webView:(WebView *)view didCommitLoadForFrame:(WebFrame *)frame;
322 - (void) webView:(WebView *)view didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
323 - (void) webView:(WebView *)view didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
324 - (void) webView:(WebView *)view didFinishLoadForFrame:(WebFrame *)frame;
325 - (void) webView:(WebView *)view didReceiveTitle:(id)title forFrame:(id)frame;
326 - (void) webView:(WebView *)view didStartProvisionalLoadForFrame:(WebFrame *)frame;
327 - (NSURLRequest *) webView:(WebView *)view resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source;
328 - (void) webView:(WebView *)view runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;
329 - (BOOL) webView:(WebView *)view runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;
330 - (NSString *) webView:(WebView *)view runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)text initiatedByFrame:(WebFrame *)frame;
331 - (void) webViewClose:(WebView *)view;
332 @end
333 // }}}
334
335 // #ifndef AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER {{{
336 #ifndef AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
337 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
338 // XXX: this is a random jumble of garbage
339
340 typedef enum {
341 UIModalPresentationFullScreen,
342 UIModalPresentationPageSheet,
343 UIModalPresentationFormSheet,
344 UIModalPresentationCurrentContext,
345 } UIModalPresentationStyle;
346
347 #define kSCNetworkReachabilityFlagsConnectionOnTraffic kSCNetworkReachabilityFlagsConnectionAutomatic
348
349 #define UIBarStyleBlack UIBarStyleBlackOpaque
350
351 @class NSUndoManager;
352 @class UIPasteboard;
353
354 @interface UIActionSheet (iPad)
355 - (void) showFromBarButtonItem:(UIBarButtonItem *)item animated:(BOOL)animated;
356 @end
357
358 @interface UIViewController (iPad)
359 - (void) setModalPresentationStyle:(UIModalPresentationStyle)style;
360 @end
361
362 @interface UIApplication (iOS_3_0)
363 @property(nonatomic) BOOL applicationSupportsShakeToEdit;
364 @end
365
366 @interface UIScrollView (iOS_3_0)
367 @property(assign,nonatomic) float decelerationRate;
368 @end
369
370 @interface UIWebView (iOS_3_0)
371 @property(assign,nonatomic) NSUInteger dataDetectorTypes;
372 @end
373
374 extern float const UIScrollViewDecelerationRateNormal;
375
376 #endif//AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
377 // }}}
378 // #if __IPHONE_OS_VERSION_MIN_REQUIRED < 30000 {{{
379 #if __IPHONE_OS_VERSION_MIN_REQUIRED < 30000
380
381 #define kSCNetworkReachabilityFlagsConnectionOnDemand (1 << 5)
382 #define kCFCoreFoundationVersionNumber_iPhoneOS_3_0 478.47
383
384 #endif
385 // }}}
386
387 #ifndef kCFCoreFoundationVersionNumber_iPhoneOS_4_0
388 #define kCFCoreFoundationVersionNumber_iPhoneOS_4_0 550.32
389 #endif
390
391 @interface UIScreen (iOS_4_0)
392 @property(nonatomic,readonly) CGFloat scale;
393 @end
394
395 // extern *; {{{
396 extern CFStringRef const kGSDisplayIdentifiersCapability;
397 extern float const UIWebViewGrowsAndShrinksToFitHeight;
398 extern float const UIWebViewScalesToFitScale;
399 // }}}
400 // extern "C" *(); {{{
401 extern "C" void *reboot2(uint64_t flags);
402 extern "C" mach_port_t SBSSpringBoardServerPort();
403 extern "C" UIImage *_UIImageWithName(NSString *name);
404 extern "C" void UISetColor(CGColorRef color);
405 // }}}
406
407 #endif//CYDIA_UIKITPRIVATE_H