1 #ifndef CYDIA_UIKITPRIVATE_H
2 #define CYDIA_UIKITPRIVATE_H
5 #include <GraphicsServices/GraphicsServices.h>
6 #include <UIKit/UIKit.h>
9 #import <WebKit/DOMHTMLIFrameElement.h>
10 #import <WebKit/WebFrame.h>
11 #import <WebKit/WebPreferences.h>
13 // 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*/
26 UINavigationButtonStyleNormal
,
27 UINavigationButtonStyleBack
,
28 UINavigationButtonStyleHighlighted
,
29 UINavigationButtonStyleDestructive
30 } UINavigationButtonStyle
;
33 UIProgressIndicatorStyleLargeWhite
,
34 UIProgressIndicatorStyleMediumWhite
,
35 UIProgressIndicatorStyleMediumBrown
,
36 UIProgressIndicatorStyleSmallWhite
,
37 UIProgressIndicatorStyleSmallBlack
,
38 UIProgressIndicatorStyleTinyWhite
,
39 } UIProgressIndicatorStyle
;
42 #define UIDataDetectorTypeAutomatic 0x80000000
46 @
class WebScriptObject
;
50 @protocol WebPolicyDecisionListener
;
53 // @interface * : UIView {{{
54 @interface UIFormAssistant
: UIView
55 + (UIFormAssistant
*) sharedFormAssistant
;
56 - (CGRect
) peripheralFrame
;
59 @interface UIKeyboard
: UIView
60 + (void) initImplementationNow
;
63 @interface UIProgressBar
: UIView
64 + (CGSize
) defaultSize
;
65 - (void) setProgress
:(float)progress
;
66 - (void) setStyle
:(NSInteger
)style
;
69 @interface UIProgressHUD
: UIView
71 - (void) setText
:(NSString
*)text
;
72 - (void) showInView
:(UIView
*)view
;
75 @interface UIProgressIndicator
: UIView
76 + (CGSize
) defaultSizeForStyle
:(NSUInteger
)style
;
77 - (NSUInteger
) activityIndicatorViewStyle
;
78 - (void) setStyle
:(UIProgressIndicatorStyle
)style
;
79 - (void) startAnimation
;
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
;
93 @interface UITextLabel
: UIView
94 - (void) setCentersHorizontally
:(BOOL
)centers
;
95 - (void) setColor
:(UIColor
*)color
;
96 - (void) setFont
:(UIFont
*)font
;
97 - (void) setText
:(NSString
*)text
;
100 @interface UITransitionView
: UIView
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
;
130 @interface UIWebViewWebViewDelegate
: NSObject
{
131 @
public UIWebView
*uiWebView
;
134 - (void) _clearUIWebView
;
138 // @interface *Button : * {{{
139 @interface UINavigationButton
: UIButton
140 - (id
) initWithTitle
:(NSString
*)title style
:(UINavigationButtonStyle
)style
;
141 - (void) setBarStyle
:(UIBarStyle
)style
;
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
;
154 @interface UIThreePartButton
: UIPushButton
157 // @interface * : NS* {{{
158 @interface WebDefaultUIKitDelegate
: NSObject
159 + (WebDefaultUIKitDelegate
*) sharedUIKitDelegate
;
162 // @interface UIWeb* : * {{{
163 @interface UIWebBrowserView
: UIWebDocumentView
166 @interface UIWebTouchEventsGestureRecognizer
: UIGestureRecognizer
168 - (NSString
*) _typeDescription
;
171 // @interface WAK* : * {{{
172 @interface WAKWindow
: NSObject
173 + (BOOL
) hasLandscapeOrientation
;
177 // @interface NS* (*) {{{
178 @interface
NSMutableURLRequest (Apple
)
179 - (void) setHTTPShouldUsePipelining
:(BOOL
)pipelining
;
182 @interface
NSString (Apple
)
183 - (NSString
*) stringByAddingPercentEscapes
;
184 - (NSString
*) stringByReplacingCharacter
:(UniChar
)from withCharacter
:(UniChar
)to
;
187 @interface
NSURL (Apple
)
188 - (BOOL
) isGoogleMapsURL
;
189 - (BOOL
) isSpringboardHandledURL
;
190 // XXX: make this an enum
191 - (NSURL
*) itmsURL
:(NSInteger
*)store
;
193 - (NSURL
*) phobosURL
;
194 - (NSURL
*) youTubeURL
;
197 @interface
NSURLRequest (Apple
)
198 + (BOOL
) allowsAnyHTTPSCertificateForHost
:(NSString
*)host
;
199 + (void) setAllowsAnyHTTPSCertificate
:(BOOL
)allow forHost
:(NSString
*)host
;
202 @interface
NSValue (Apple
)
203 + (NSValue
*) valueWithSize
:(CGSize
)size
;
206 // @interface UI* (*) {{{
207 @interface
UIActionSheet (Apple
)
208 - (void) setContext
:(NSString
*)context
;
209 - (NSString
*) context
;
212 @interface
UIAlertView (Apple
)
213 - (void) addTextFieldWithValue
:(NSString
*)value label
:(NSString
*)label
;
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
;
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
;
237 @interface
UIBarButtonItem (Apple
)
241 @interface
UIColor (Apple
)
242 + (UIColor
*) pinStripeColor
;
245 @interface
UIControl (Apple
)
246 - (void) addTarget
:(id
)target action
:(SEL
)action forEvents
:(NSInteger
)events
;
249 @interface
UIImage (Apple
)
250 + (UIImage
*) applicationImageNamed
:(NSString
*)name
;
251 + (UIImage
*) imageAtPath
:(NSString
*)path
;
254 @interface
UINavigationBar (Apple
)
255 + (CGSize
) defaultSize
;
256 - (UIBarStyle
) _barStyle
:(BOOL
)style
;
259 @interface
UIScrollView (Apple
)
260 - (void) setScrollingEnabled
:(BOOL
)enabled
;
261 - (void) setShowBackgroundShadow
:(BOOL
)show
;
264 @interface
UISearchBar (Apple
)
265 - (UITextField
*) searchField
;
268 @interface
UITabBarController (Apple
)
269 - (UITransitionView
*) _transitionView
;
270 - (void) concealTabBarSelection
;
271 - (void) revealTabBarSelection
;
274 @interface
UITabBarItem (Apple
)
275 - (void) setAnimatedBadge
:(BOOL
)animated
;
278 @interface
UITableViewCell (Apple
)
279 - (float) selectionPercent
;
280 - (void) _updateHighlightColorsForView
:(id
)view highlighted
:(BOOL
)highlighted
;
283 @interface
UITextField (Apple
)
284 - (UITextInputTraits
*) textInputTraits
;
287 @interface
UITextView (Apple
)
289 - (void) setAllowsRubberBanding
:(BOOL
)rubberbanding
;
290 - (void) setFont
:(UIFont
*)font
;
291 - (void) setMarginTop
:(int)margin
;
292 - (void) setTextColor
:(UIColor
*)color
;
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
;
307 @interface
UIViewController (Apple
)
308 - (void) _updateLayoutForStatusBarAndInterfaceOrientation
;
312 @interface
UIWindow (Apple
)
313 - (UIResponder
*) firstResponder
;
314 - (void) makeKey
:(UIApplication
*)application
;
315 - (void) orderFront
:(UIApplication
*)application
;
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
;
341 // @interface Web* (*) {{{
342 @interface
WebFrame (Apple
)
343 - (void) setNeedsLayout
;
346 @interface
WebPreferences (Apple
)
347 + (void) _setInitialDefaultTextEncodingToSystemEncoding
;
348 - (void) _setLayoutInterval
:(NSInteger
)interval
;
349 - (void) setOfflineWebApplicationCacheEnabled
:(BOOL
)enabled
;
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
359 UIModalPresentationFullScreen
,
360 UIModalPresentationPageSheet
,
361 UIModalPresentationFormSheet
,
362 UIModalPresentationCurrentContext
,
363 } UIModalPresentationStyle
;
365 #define kSCNetworkReachabilityFlagsConnectionOnTraffic kSCNetworkReachabilityFlagsConnectionAutomatic
367 #define UIBarStyleBlack UIBarStyleBlackOpaque
369 @
class NSUndoManager
;
372 @interface
UIActionSheet (iPad
)
373 - (void) showFromBarButtonItem
:(UIBarButtonItem
*)item animated
:(BOOL
)animated
;
376 @interface
UIViewController (iPad
)
377 - (void) setModalPresentationStyle
:(UIModalPresentationStyle
)style
;
380 @interface
UIApplication (iOS_3_0
)
381 @
property(nonatomic
) BOOL applicationSupportsShakeToEdit
;
384 @interface
UIScrollView (iOS_3_0
)
385 @
property(assign
,nonatomic
) float decelerationRate
;
388 @interface
UIWebView (iOS_3_0
)
389 @
property(assign
,nonatomic
) NSUInteger dataDetectorTypes
;
392 extern float const UIScrollViewDecelerationRateNormal
;
394 #endif//AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
396 // #if __IPHONE_OS_VERSION_MIN_REQUIRED < 30000 {{{
397 #if __IPHONE_OS_VERSION_MIN_REQUIRED < 30000
399 #define kSCNetworkReachabilityFlagsConnectionOnDemand (1 << 5)
400 #define kCFCoreFoundationVersionNumber_iPhoneOS_3_0 478.47
405 #ifndef kCFCoreFoundationVersionNumber_iPhoneOS_4_0
406 #define kCFCoreFoundationVersionNumber_iPhoneOS_4_0 550.32
409 @interface
UITabBarItem (iOS_7_0
)
410 - (id
) initWithTitle
:(NSString
*)title image
:(UIImage
*)image selectedImage
:(UIImage
*)selectedImage
;
413 @interface
UIScreen (iOS_4_0
)
414 @
property(nonatomic
,readonly
) CGFloat scale
;
417 @interface
DOMHTMLIFrameElement (IDL
)
418 - (WebFrame
*) contentFrame
;
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
;
433 extern CFStringRef
const kGSDisplayIdentifiersCapability
;
434 extern float const UIWebViewGrowsAndShrinksToFitHeight
;
435 extern float const UIWebViewScalesToFitScale
;
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
);
445 #endif//CYDIA_UIKITPRIVATE_H