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