]> git.saurik.com Git - cydia.git/blob - iPhonePrivate.h
Work around stupid 2.x UINavigationController behavior.
[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 @end
128 // }}}
129 // @interface *Button : * {{{
130 @interface UINavigationButton : UIButton
131 - (id) initWithTitle:(NSString *)title style:(UINavigationButtonStyle)style;
132 - (void) setBarStyle:(UIBarStyle)style;
133 @end
134
135 @interface UIPushButton : UIControl
136 - (id) backgroundForState:(NSUInteger)state;
137 - (void) setAutosizesToFit:(BOOL)autosizes;
138 - (void) setBackground:(id)background forState:(NSUInteger)state;
139 - (void) setDrawsShadow:(BOOL)draws;
140 - (void) setStretchBackground:(BOOL)stretch;
141 - (void) setTitle:(NSString *)title;
142 - (void) setTitleFont:(UIFont *)font;
143 @end
144
145 @interface UIThreePartButton : UIPushButton
146 @end
147 // }}}
148 // @interface * : NS* {{{
149 @interface WebDefaultUIKitDelegate : NSObject
150 + (WebDefaultUIKitDelegate *) sharedUIKitDelegate;
151 @end
152 // }}}
153 // @interface UIWeb* : * {{{
154 @interface UIWebBrowserView : UIWebDocumentView
155 @end
156
157 @interface UIWebTouchEventsGestureRecognizer : UIGestureRecognizer
158 - (int) type;
159 - (NSString *) _typeDescription;
160 @end
161 // }}}
162
163 // @interface NS* (*) {{{
164 @interface NSMutableURLRequest (Apple)
165 - (void) setHTTPShouldUsePipelining:(BOOL)pipelining;
166 @end
167
168 @interface NSString (Apple)
169 - (NSString *) stringByAddingPercentEscapes;
170 - (NSString *) stringByReplacingCharacter:(UniChar)from withCharacter:(UniChar)to;
171 @end
172
173 @interface NSURL (Apple)
174 - (BOOL) isGoogleMapsURL;
175 - (BOOL) isSpringboardHandledURL;
176 // XXX: make this an enum
177 - (NSURL *) itmsURL:(NSInteger *)store;
178 - (NSURL *) mapsURL;
179 - (NSURL *) phobosURL;
180 - (NSURL *) youTubeURL;
181 @end
182
183 @interface NSURLRequest (Apple)
184 + (BOOL) allowsAnyHTTPSCertificateForHost:(NSString *)host;
185 + (void) setAllowsAnyHTTPSCertificate:(BOOL)allow forHost:(NSString *)host;
186 @end
187
188 @interface NSValue (Apple)
189 + (NSValue *) valueWithSize:(CGSize)size;
190 @end
191 // }}}
192 // @interface UI* (*) {{{
193 @interface UIActionSheet (Apple)
194 - (void) setContext:(NSString *)context;
195 - (NSString *) context;
196 @end
197
198 @interface UIAlertView (Apple)
199 - (void) addTextFieldWithValue:(NSString *)value label:(NSString *)label;
200 - (id) buttons;
201 - (NSString *) context;
202 - (void) setContext:(NSString *)context;
203 - (void) setNumberOfRows:(int)rows;
204 - (void) setRunsModal:(BOOL)modal;
205 - (UITextField *) textField;
206 - (UITextField *) textFieldAtIndex:(NSUInteger)index;
207 - (void) _updateFrameForDisplay;
208 @end
209
210 @interface UIApplication (Apple)
211 - (void) applicationSuspend:(GSEventRef)event;
212 - (void) _animateSuspension:(BOOL)suspend duration:(double)duration startTime:(double)start scale:(float)scale;
213 - (void) applicationOpenURL:(NSURL *)url;
214 - (void) applicationWillResignActive:(UIApplication *)application;
215 - (void) applicationWillSuspend;
216 - (void) launchApplicationWithIdentifier:(NSString *)identifier suspended:(BOOL)suspended;
217 - (void) openURL:(NSURL *)url asPanel:(BOOL)panel;
218 - (void) setStatusBarShowsProgress:(BOOL)shows;
219 - (void) _setSuspended:(BOOL)suspended;
220 - (void) terminateWithSuccess;
221 @end
222
223 @interface UIBarButtonItem (Apple)
224 - (UIView *) view;
225 @end
226
227 @interface UIColor (Apple)
228 + (UIColor *) pinStripeColor;
229 @end
230
231 @interface UIControl (Apple)
232 - (void) addTarget:(id)target action:(SEL)action forEvents:(NSInteger)events;
233 @end
234
235 @interface UIDevice (Apple)
236 - (BOOL) isWildcat;
237 @end
238
239 @interface UIImage (Apple)
240 + (UIImage *) applicationImageNamed:(NSString *)name;
241 + (UIImage *) imageAtPath:(NSString *)path;
242 @end
243
244 @interface UINavigationBar (Apple)
245 + (CGSize) defaultSize;
246 - (UIBarStyle) _barStyle:(BOOL)style;
247 @end
248
249 @interface UIScrollView (Apple)
250 - (void) setScrollingEnabled:(BOOL)enabled;
251 - (void) setShowBackgroundShadow:(BOOL)show;
252 @end
253
254 @interface UISearchBar (Apple)
255 - (UITextField *) searchField;
256 @end
257
258 @interface UITabBarController (Apple)
259 - (UITransitionView *) _transitionView;
260 - (void) concealTabBarSelection;
261 - (void) revealTabBarSelection;
262 @end
263
264 @interface UITabBarItem (Apple)
265 - (void) setAnimatedBadge:(BOOL)animated;
266 @end
267
268 @interface UITableViewCell (Apple)
269 - (float) selectionPercent;
270 - (void) _updateHighlightColorsForView:(id)view highlighted:(BOOL)highlighted;
271 @end
272
273 @interface UITextField (Apple)
274 - (UITextInputTraits *) textInputTraits;
275 @end
276
277 @interface UITextView (Apple)
278 - (UIFont *) font;
279 - (void) setAllowsRubberBanding:(BOOL)rubberbanding;
280 - (void) setFont:(UIFont *)font;
281 - (void) setMarginTop:(int)margin;
282 - (void) setTextColor:(UIColor *)color;
283 @end
284
285 @interface UIView (Apple)
286 - (UIScroller *) _scroller;
287 - (void) setClipsSubviews:(BOOL)clips;
288 - (void) setEnabledGestures:(NSInteger)gestures;
289 - (void) setFixedBackgroundPattern:(BOOL)fixed;
290 - (void) setGestureDelegate:(id)delegate;
291 - (void) setNeedsDisplayOnBoundsChange:(BOOL)needs;
292 - (void) setValue:(NSValue *)value forGestureAttribute:(NSInteger)attribute;
293 - (void) setZoomScale:(float)scale duration:(double)duration;
294 - (void) _setZoomScale:(float)scale duration:(double)duration;
295 @end
296
297 @interface UIViewController (Apple)
298 - (void) _updateLayoutForStatusBarAndInterfaceOrientation;
299 - (void) unloadView;
300 @end
301
302 @interface UIWindow (Apple)
303 - (UIResponder *) firstResponder;
304 - (void) makeKey:(UIApplication *)application;
305 - (void) orderFront:(UIApplication *)application;
306 @end
307
308 @interface UIWebView (Apple)
309 - (UIWebDocumentView *) _documentView;
310 - (UIScrollView *) _scrollView;
311 - (UIScroller *) _scroller;
312 - (void) _updateViewSettings;
313 - (void) webView:(WebView *)view addMessageToConsole:(NSDictionary *)message;
314 //- (WebView *) webView:(WebView *)view createWebViewWithRequest:(NSURLRequest *)request;
315 - (void) webView:(WebView *)view decidePolicyForNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener;
316 - (void) webView:(WebView *)view decidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)name decisionListener:(id<WebPolicyDecisionListener>)listener;
317 - (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame;
318 - (void) webView:(WebView *)view didCommitLoadForFrame:(WebFrame *)frame;
319 - (void) webView:(WebView *)view didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
320 - (void) webView:(WebView *)view didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
321 - (void) webView:(WebView *)view didFinishLoadForFrame:(WebFrame *)frame;
322 - (void) webView:(WebView *)view didReceiveTitle:(id)title forFrame:(id)frame;
323 - (void) webView:(WebView *)view didStartProvisionalLoadForFrame:(WebFrame *)frame;
324 - (NSURLRequest *) webView:(WebView *)view resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source;
325 - (void) webView:(WebView *)view runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;
326 - (BOOL) webView:(WebView *)view runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;
327 - (NSString *) webView:(WebView *)view runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)text initiatedByFrame:(WebFrame *)frame;
328 - (void) webViewClose:(WebView *)view;
329 @end
330 // }}}
331
332 // #ifndef AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER {{{
333 #ifndef AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
334 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
335 // XXX: this is a random jumble of garbage
336
337 typedef enum {
338 UIModalPresentationFullScreen,
339 UIModalPresentationPageSheet,
340 UIModalPresentationFormSheet,
341 UIModalPresentationCurrentContext,
342 } UIModalPresentationStyle;
343
344 #define kSCNetworkReachabilityFlagsConnectionOnTraffic kSCNetworkReachabilityFlagsConnectionAutomatic
345
346 #define UIBarStyleBlack UIBarStyleBlackOpaque
347
348 @class NSUndoManager;
349 @class UIPasteboard;
350
351 @interface UIActionSheet (iPad)
352 - (void) showFromBarButtonItem:(UIBarButtonItem *)item animated:(BOOL)animated;
353 @end
354
355 @interface UIViewController (iPad)
356 - (void) setModalPresentationStyle:(UIModalPresentationStyle)style;
357 @end
358
359 @interface UIApplication (iOS_3_0)
360 @property(nonatomic) BOOL applicationSupportsShakeToEdit;
361 @end
362
363 @interface UIScrollView (iOS_3_0)
364 @property(assign,nonatomic) float decelerationRate;
365 @end
366
367 @interface UIWebView (iOS_3_0)
368 @property(assign,nonatomic) NSUInteger dataDetectorTypes;
369 @end
370
371 extern float const UIScrollViewDecelerationRateNormal;
372
373 #endif//AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
374 // }}}
375 // #if __IPHONE_OS_VERSION_MIN_REQUIRED < 30000 {{{
376 #if __IPHONE_OS_VERSION_MIN_REQUIRED < 30000
377
378 #define kSCNetworkReachabilityFlagsConnectionOnDemand (1 << 5)
379 #define kCFCoreFoundationVersionNumber_iPhoneOS_3_0 478.47
380
381 #endif
382 // }}}
383
384 #ifndef kCFCoreFoundationVersionNumber_iPhoneOS_4_0
385 #define kCFCoreFoundationVersionNumber_iPhoneOS_4_0 550.32
386 #endif
387
388 @interface UIScreen (iOS_4_0)
389 @property(nonatomic,readonly) CGFloat scale;
390 @end
391
392 // extern *; {{{
393 extern CFStringRef const kGSDisplayIdentifiersCapability;
394 extern float const UIWebViewGrowsAndShrinksToFitHeight;
395 extern float const UIWebViewScalesToFitScale;
396 // }}}
397 // extern "C" *(); {{{
398 extern "C" void *reboot2(uint64_t flags);
399 extern "C" mach_port_t SBSSpringBoardServerPort();
400 extern "C" UIImage *_UIImageWithName(NSString *name);
401 extern "C" void UISetColor(CGColorRef color);
402 // }}}
403
404 #endif//CYDIA_UIKITPRIVATE_H