]> git.saurik.com Git - cydia.git/blame_incremental - iPhonePrivate.h
Add more parts of Cydia that need to run as root.
[cydia.git] / iPhonePrivate.h
... / ...
CommitLineData
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 {*} *; {{{
14typedef 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
25typedef enum {
26 UINavigationButtonStyleNormal,
27 UINavigationButtonStyleBack,
28 UINavigationButtonStyleHighlighted,
29 UINavigationButtonStyleDestructive
30} UINavigationButtonStyle;
31
32static const UIActivityIndicatorViewStyle UIActivityIndicatorViewStyleWhiteSmall(static_cast<UIActivityIndicatorViewStyle>(3));
33static const UIActivityIndicatorViewStyle UIActivityIndicatorViewStyleGraySmall(static_cast<UIActivityIndicatorViewStyle>(4));
34static const UIActivityIndicatorViewStyle UIActivityIndicatorViewStyleWhiteTiny(static_cast<UIActivityIndicatorViewStyle>(5));
35// }}}
36// #define * * {{{
37#define UIDataDetectorTypeAutomatic 0x80000000
38// }}}
39// @class Web*; {{{
40@class WebDataSource;
41@class WebScriptObject;
42@class WebView;
43// }}}
44// @protocol *; {{{
45@protocol WebPolicyDecisionListener;
46// }}}
47
48// @interface * : UIView {{{
49@interface UIFormAssistant : UIView
50+ (UIFormAssistant *) sharedFormAssistant;
51- (CGRect) peripheralFrame;
52@end
53
54@interface UIKeyboard : UIView
55+ (void) initImplementationNow;
56@end
57
58@interface UIProgressBar : UIView
59+ (CGSize) defaultSize;
60- (void) setProgress:(float)progress;
61- (void) setStyle:(NSInteger)style;
62@end
63
64@interface UIProgressHUD : UIView
65- (void) hide;
66- (void) setText:(NSString *)text;
67- (void) showInView:(UIView *)view;
68@end
69
70@interface UIScroller : UIView
71- (CGSize) contentSize;
72- (void) setDirectionalScrolling:(BOOL)directional;
73- (void) setEventMode:(NSInteger)mode;
74- (void) setOffset:(CGPoint)offset;
75- (void) setScrollDecelerationFactor:(float)factor;
76- (void) setScrollHysteresis:(float)hysteresis;
77- (void) setScrollerIndicatorStyle:(UIScrollViewIndicatorStyle)style;
78- (void) setThumbDetectionEnabled:(BOOL)enabled;
79@end
80
81@interface UITextLabel : UIView
82- (void) setCentersHorizontally:(BOOL)centers;
83- (void) setColor:(UIColor *)color;
84- (void) setFont:(UIFont *)font;
85- (void) setText:(NSString *)text;
86@end
87
88@interface UITransitionView : UIView
89@end
90
91@interface UIWebDocumentView : UIView
92- (CGRect) documentBounds;
93- (void) enableReachability;
94- (void) loadRequest:(NSURLRequest *)request;
95- (void) redrawScaledDocument;
96- (void) setAllowsImageSheet:(BOOL)allows;
97- (void) setAllowsMessaging:(BOOL)allows;
98- (void) setAutoresizes:(BOOL)autoresizes;
99- (void) setContentsPosition:(NSInteger)position;
100- (void) setDrawsBackground:(BOOL)draws;
101- (void) _setDocumentType:(NSInteger)type;
102- (void) setDrawsGrid:(BOOL)draws;
103- (void) setInitialScale:(float)scale forDocumentTypes:(NSInteger)types;
104- (void) setLogsTilingChanges:(BOOL)logs;
105- (void) setMinimumScale:(float)scale forDocumentTypes:(NSInteger)types;
106- (void) setMinimumSize:(CGSize)size;
107- (void) setMaximumScale:(float)scale forDocumentTypes:(NSInteger)tpyes;
108- (void) setSmoothsFonts:(BOOL)smooths;
109- (void) setTileMinificationFilter:(NSString *)filter;
110- (void) setTileSize:(CGSize)size;
111- (void) setTilingEnabled:(BOOL)enabled;
112- (void) setViewportSize:(CGSize)size forDocumentTypes:(NSInteger)types;
113- (void) setZoomsFocusedFormControl:(BOOL)zooms;
114- (void) useSelectionAssistantWithMode:(NSInteger)mode;
115- (WebView *) webView;
116@end
117
118@interface UIWebViewWebViewDelegate : NSObject {
119 @public UIWebView *uiWebView;
120}
121
122- (void) _clearUIWebView;
123
124@end
125// }}}
126// @interface *Button : * {{{
127@interface UINavigationButton : UIButton
128- (id) initWithTitle:(NSString *)title style:(UINavigationButtonStyle)style;
129- (void) setBarStyle:(UIBarStyle)style;
130@end
131
132@interface UIPushButton : UIControl
133- (id) backgroundForState:(NSUInteger)state;
134- (void) setAutosizesToFit:(BOOL)autosizes;
135- (void) setBackground:(id)background forState:(NSUInteger)state;
136- (void) setDrawsShadow:(BOOL)draws;
137- (void) setStretchBackground:(BOOL)stretch;
138- (void) setTitle:(NSString *)title;
139- (void) setTitleFont:(UIFont *)font;
140@end
141
142@interface UIThreePartButton : UIPushButton
143@end
144// }}}
145// @interface * : NS* {{{
146@interface WebDefaultUIKitDelegate : NSObject
147+ (WebDefaultUIKitDelegate *) sharedUIKitDelegate;
148@end
149// }}}
150// @interface UIWeb* : * {{{
151@interface UIWebBrowserView : UIWebDocumentView
152@end
153
154@interface UIWebTouchEventsGestureRecognizer : UIGestureRecognizer
155- (int) type;
156- (NSString *) _typeDescription;
157@end
158// }}}
159// @interface WAK* : * {{{
160@interface WAKWindow : NSObject
161+ (BOOL) hasLandscapeOrientation;
162@end
163// }}}
164
165// @interface NS* (*) {{{
166@interface NSMutableURLRequest (Apple)
167- (void) setHTTPShouldUsePipelining:(BOOL)pipelining;
168@end
169
170@interface NSString (Apple)
171- (NSString *) stringByAddingPercentEscapes;
172- (NSString *) stringByReplacingCharacter:(UniChar)from withCharacter:(UniChar)to;
173@end
174
175@interface NSURL (Apple)
176- (BOOL) isGoogleMapsURL;
177- (BOOL) isSpringboardHandledURL;
178// XXX: make this an enum
179- (NSURL *) itmsURL:(NSInteger *)store;
180- (NSURL *) mapsURL;
181- (NSURL *) phobosURL;
182- (NSURL *) youTubeURL;
183@end
184
185@interface NSURLRequest (Apple)
186+ (BOOL) allowsAnyHTTPSCertificateForHost:(NSString *)host;
187+ (void) setAllowsAnyHTTPSCertificate:(BOOL)allow forHost:(NSString *)host;
188@end
189
190@interface NSValue (Apple)
191+ (NSValue *) valueWithSize:(CGSize)size;
192@end
193// }}}
194// @interface UI* (*) {{{
195@interface UIActionSheet (Apple)
196- (void) setContext:(NSString *)context;
197- (NSString *) context;
198@end
199
200@interface UIAlertView (Apple)
201- (void) addTextFieldWithValue:(NSString *)value label:(NSString *)label;
202- (id) buttons;
203- (NSString *) context;
204- (void) setContext:(NSString *)context;
205- (void) setNumberOfRows:(int)rows;
206- (void) setRunsModal:(BOOL)modal;
207- (UITextField *) textField;
208- (UITextField *) textFieldAtIndex:(NSUInteger)index;
209- (void) _updateFrameForDisplay;
210@end
211
212@interface UIApplication (Apple)
213- (void) applicationSuspend:(GSEventRef)event;
214- (void) _animateSuspension:(BOOL)suspend duration:(double)duration startTime:(double)start scale:(float)scale;
215- (void) applicationOpenURL:(NSURL *)url;
216- (void) applicationWillResignActive:(UIApplication *)application;
217- (void) applicationWillSuspend;
218- (void) launchApplicationWithIdentifier:(NSString *)identifier suspended:(BOOL)suspended;
219- (void) openURL:(NSURL *)url asPanel:(BOOL)panel;
220- (void) setStatusBarShowsProgress:(BOOL)shows;
221- (void) _setSuspended:(BOOL)suspended;
222- (void) terminateWithSuccess;
223@end
224
225@interface UIBarButtonItem (Apple)
226- (UIView *) view;
227@end
228
229@interface UIColor (Apple)
230+ (UIColor *) pinStripeColor;
231@end
232
233@interface UIControl (Apple)
234- (void) addTarget:(id)target action:(SEL)action forEvents:(NSInteger)events;
235@end
236
237@interface UIDevice (Apple)
238- (NSString *) uniqueIdentifier;
239@end
240
241@interface UIImage (Apple)
242+ (UIImage *) imageAtPath:(NSString *)path;
243@end
244
245@interface UILocalizedIndexedCollation (Apple)
246- (id) initWithDictionary:(NSDictionary *)dictionary;
247- (NSString *) transformedCollationStringForString:(NSString *)string;
248@end
249
250@interface UINavigationBar (Apple)
251+ (CGSize) defaultSize;
252- (UIBarStyle) _barStyle:(BOOL)style;
253@end
254
255@interface UIScrollView (Apple)
256- (void) setScrollingEnabled:(BOOL)enabled;
257- (void) setShowBackgroundShadow:(BOOL)show;
258@end
259
260@interface UISearchBar (Apple)
261- (UITextField *) searchField;
262@end
263
264@interface UITabBarController (Apple)
265- (UITransitionView *) _transitionView;
266- (void) concealTabBarSelection;
267- (void) revealTabBarSelection;
268@end
269
270@interface UITabBarItem (Apple)
271- (void) setAnimatedBadge:(BOOL)animated;
272- (UIView *) view;
273@end
274
275@interface UITableViewCell (Apple)
276- (float) selectionPercent;
277- (void) _updateHighlightColorsForView:(id)view highlighted:(BOOL)highlighted;
278@end
279
280@interface UITextField (Apple)
281- (UITextInputTraits *) textInputTraits;
282@end
283
284@interface UITextView (Apple)
285- (UIFont *) font;
286- (void) setAllowsRubberBanding:(BOOL)rubberbanding;
287- (void) setFont:(UIFont *)font;
288- (void) setMarginTop:(int)margin;
289- (void) setTextColor:(UIColor *)color;
290@end
291
292@interface UIView (Apple)
293- (UIScroller *) _scroller;
294- (void) setClipsSubviews:(BOOL)clips;
295- (void) setEnabledGestures:(NSInteger)gestures;
296- (void) setFixedBackgroundPattern:(BOOL)fixed;
297- (void) setGestureDelegate:(id)delegate;
298- (void) setNeedsDisplayOnBoundsChange:(BOOL)needs;
299- (void) setValue:(NSValue *)value forGestureAttribute:(NSInteger)attribute;
300- (void) setZoomScale:(float)scale duration:(double)duration;
301- (void) _setZoomScale:(float)scale duration:(double)duration;
302- (void) setOrigin:(CGPoint)origin;
303@end
304
305@interface UIViewController (Apple)
306- (void) _updateLayoutForStatusBarAndInterfaceOrientation;
307- (void) unloadView;
308@end
309
310@interface UIWindow (Apple)
311- (UIResponder *) firstResponder;
312- (void) makeKey:(UIApplication *)application;
313- (void) orderFront:(UIApplication *)application;
314@end
315
316@interface UIWebView (Apple)
317- (UIWebDocumentView *) _documentView;
318- (UIScrollView *) _scrollView;
319- (UIScroller *) _scroller;
320- (void) _updateViewSettings;
321- (void) webView:(WebView *)view addMessageToConsole:(NSDictionary *)message;
322//- (WebView *) webView:(WebView *)view createWebViewWithRequest:(NSURLRequest *)request;
323- (void) webView:(WebView *)view decidePolicyForNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener;
324- (void) webView:(WebView *)view decidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)name decisionListener:(id<WebPolicyDecisionListener>)listener;
325- (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame;
326- (void) webView:(WebView *)view didCommitLoadForFrame:(WebFrame *)frame;
327- (void) webView:(WebView *)view didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
328- (void) webView:(WebView *)view didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
329- (void) webView:(WebView *)view didFinishLoadForFrame:(WebFrame *)frame;
330- (void) webView:(WebView *)view didReceiveTitle:(id)title forFrame:(id)frame;
331- (void) webView:(WebView *)view didStartProvisionalLoadForFrame:(WebFrame *)frame;
332- (void) webView:(WebView *)view resource:(id)identifier didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)source;
333- (void) webView:(WebView *)view resource:(id)identifier didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)source;
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
358typedef 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
392extern 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// extern *; {{{
422extern CFStringRef const kGSDisplayIdentifiersCapability;
423extern float const UIWebViewGrowsAndShrinksToFitHeight;
424extern float const UIWebViewScalesToFitScale;
425// }}}
426// extern "C" *(); {{{
427extern "C" void *reboot2(uint64_t flags);
428extern "C" mach_port_t SBSSpringBoardServerPort();
429extern "C" int SBBundlePathForDisplayIdentifier(mach_port_t port, const char *identifier, char *path);
430extern "C" UIImage *_UIImageWithName(NSString *name);
431extern "C" void UISetColor(CGColorRef color);
432// }}}
433
434#endif//CYDIA_UIKITPRIVATE_H