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