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
UIDevice (Apple
)
253 @interface
UIImage (Apple
)
254 + (UIImage
*) applicationImageNamed
:(NSString
*)name
;
255 + (UIImage
*) imageAtPath
:(NSString
*)path
;
258 @interface
UINavigationBar (Apple
)
259 + (CGSize
) defaultSize
;
260 - (UIBarStyle
) _barStyle
:(BOOL
)style
;
263 @interface
UIScrollView (Apple
)
264 - (void) setScrollingEnabled
:(BOOL
)enabled
;
265 - (void) setShowBackgroundShadow
:(BOOL
)show
;
268 @interface
UISearchBar (Apple
)
269 - (UITextField
*) searchField
;
272 @interface
UITabBarController (Apple
)
273 - (UITransitionView
*) _transitionView
;
274 - (void) concealTabBarSelection
;
275 - (void) revealTabBarSelection
;
278 @interface
UITabBarItem (Apple
)
279 - (void) setAnimatedBadge
:(BOOL
)animated
;
282 @interface
UITableViewCell (Apple
)
283 - (float) selectionPercent
;
284 - (void) _updateHighlightColorsForView
:(id
)view highlighted
:(BOOL
)highlighted
;
287 @interface
UITextField (Apple
)
288 - (UITextInputTraits
*) textInputTraits
;
291 @interface
UITextView (Apple
)
293 - (void) setAllowsRubberBanding
:(BOOL
)rubberbanding
;
294 - (void) setFont
:(UIFont
*)font
;
295 - (void) setMarginTop
:(int)margin
;
296 - (void) setTextColor
:(UIColor
*)color
;
299 @interface
UIView (Apple
)
300 - (UIScroller
*) _scroller
;
301 - (void) setClipsSubviews
:(BOOL
)clips
;
302 - (void) setEnabledGestures
:(NSInteger
)gestures
;
303 - (void) setFixedBackgroundPattern
:(BOOL
)fixed
;
304 - (void) setGestureDelegate
:(id
)delegate
;
305 - (void) setNeedsDisplayOnBoundsChange
:(BOOL
)needs
;
306 - (void) setValue
:(NSValue
*)value forGestureAttribute
:(NSInteger
)attribute
;
307 - (void) setZoomScale
:(float)scale duration
:(double)duration
;
308 - (void) _setZoomScale
:(float)scale duration
:(double)duration
;
311 @interface
UIViewController (Apple
)
312 - (void) _updateLayoutForStatusBarAndInterfaceOrientation
;
316 @interface
UIWindow (Apple
)
317 - (UIResponder
*) firstResponder
;
318 - (void) makeKey
:(UIApplication
*)application
;
319 - (void) orderFront
:(UIApplication
*)application
;
322 @interface
UIWebView (Apple
)
323 - (UIWebDocumentView
*) _documentView
;
324 - (UIScrollView
*) _scrollView
;
325 - (UIScroller
*) _scroller
;
326 - (void) _updateViewSettings
;
327 - (void) webView
:(WebView
*)view addMessageToConsole
:(NSDictionary
*)message
;
328 //- (WebView *) webView:(WebView *)view createWebViewWithRequest:(NSURLRequest *)request;
329 - (void) webView
:(WebView
*)view decidePolicyForNavigationAction
:(NSDictionary
*)action request
:(NSURLRequest
*)request frame
:(WebFrame
*)frame decisionListener
:(id
<WebPolicyDecisionListener
>)listener
;
330 - (void) webView
:(WebView
*)view decidePolicyForNewWindowAction
:(NSDictionary
*)action request
:(NSURLRequest
*)request newFrameName
:(NSString
*)name decisionListener
:(id
<WebPolicyDecisionListener
>)listener
;
331 - (void) webView
:(WebView
*)view didClearWindowObject
:(WebScriptObject
*)window forFrame
:(WebFrame
*)frame
;
332 - (void) webView
:(WebView
*)view didCommitLoadForFrame
:(WebFrame
*)frame
;
333 - (void) webView
:(WebView
*)view didFailLoadWithError
:(NSError
*)error forFrame
:(WebFrame
*)frame
;
334 - (void) webView
:(WebView
*)view didFailProvisionalLoadWithError
:(NSError
*)error forFrame
:(WebFrame
*)frame
;
335 - (void) webView
:(WebView
*)view didFinishLoadForFrame
:(WebFrame
*)frame
;
336 - (void) webView
:(WebView
*)view didReceiveTitle
:(id
)title forFrame
:(id
)frame
;
337 - (void) webView
:(WebView
*)view didStartProvisionalLoadForFrame
:(WebFrame
*)frame
;
338 - (NSURLRequest
*) webView
:(WebView
*)view resource
:(id
)identifier willSendRequest
:(NSURLRequest
*)request redirectResponse
:(NSURLResponse
*)response fromDataSource
:(WebDataSource
*)source
;
339 - (void) webView
:(WebView
*)view runJavaScriptAlertPanelWithMessage
:(NSString
*)message initiatedByFrame
:(WebFrame
*)frame
;
340 - (BOOL
) webView
:(WebView
*)view runJavaScriptConfirmPanelWithMessage
:(NSString
*)message initiatedByFrame
:(WebFrame
*)frame
;
341 - (NSString
*) webView
:(WebView
*)view runJavaScriptTextInputPanelWithPrompt
:(NSString
*)prompt defaultText
:(NSString
*)text initiatedByFrame
:(WebFrame
*)frame
;
342 - (void) webViewClose
:(WebView
*)view
;
345 // @interface Web* (*) {{{
346 @interface
WebFrame (Apple
)
347 - (void) setNeedsLayout
;
350 @interface
WebPreferences (Apple
)
351 + (void) _setInitialDefaultTextEncodingToSystemEncoding
;
352 - (void) _setLayoutInterval
:(NSInteger
)interval
;
353 - (void) setOfflineWebApplicationCacheEnabled
:(BOOL
)enabled
;
357 // #ifndef AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER {{{
358 #ifndef AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
359 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
360 // XXX: this is a random jumble of garbage
363 UIModalPresentationFullScreen
,
364 UIModalPresentationPageSheet
,
365 UIModalPresentationFormSheet
,
366 UIModalPresentationCurrentContext
,
367 } UIModalPresentationStyle
;
369 #define kSCNetworkReachabilityFlagsConnectionOnTraffic kSCNetworkReachabilityFlagsConnectionAutomatic
371 #define UIBarStyleBlack UIBarStyleBlackOpaque
373 @
class NSUndoManager
;
376 @interface
UIActionSheet (iPad
)
377 - (void) showFromBarButtonItem
:(UIBarButtonItem
*)item animated
:(BOOL
)animated
;
380 @interface
UIViewController (iPad
)
381 - (void) setModalPresentationStyle
:(UIModalPresentationStyle
)style
;
384 @interface
UIApplication (iOS_3_0
)
385 @
property(nonatomic
) BOOL applicationSupportsShakeToEdit
;
388 @interface
UIScrollView (iOS_3_0
)
389 @
property(assign
,nonatomic
) float decelerationRate
;
392 @interface
UIWebView (iOS_3_0
)
393 @
property(assign
,nonatomic
) NSUInteger dataDetectorTypes
;
396 extern float const UIScrollViewDecelerationRateNormal
;
398 #endif//AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
400 // #if __IPHONE_OS_VERSION_MIN_REQUIRED < 30000 {{{
401 #if __IPHONE_OS_VERSION_MIN_REQUIRED < 30000
403 #define kSCNetworkReachabilityFlagsConnectionOnDemand (1 << 5)
404 #define kCFCoreFoundationVersionNumber_iPhoneOS_3_0 478.47
409 #ifndef kCFCoreFoundationVersionNumber_iPhoneOS_4_0
410 #define kCFCoreFoundationVersionNumber_iPhoneOS_4_0 550.32
413 @interface
UIScreen (iOS_4_0
)
414 @
property(nonatomic
,readonly
) CGFloat scale
;
417 @interface
DOMHTMLIFrameElement (IDL
)
418 - (WebFrame
*) contentFrame
;
422 extern CFStringRef
const kGSDisplayIdentifiersCapability
;
423 extern float const UIWebViewGrowsAndShrinksToFitHeight
;
424 extern float const UIWebViewScalesToFitScale
;
426 // extern "C" *(); {{{
427 extern "C" void *reboot2(uint64_t flags
);
428 extern "C" mach_port_t
SBSSpringBoardServerPort();
429 extern "C" UIImage
*_UIImageWithName(NSString
*name
);
430 extern "C" void UISetColor(CGColorRef color
);
433 #endif//CYDIA_UIKITPRIVATE_H