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