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