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
;
32 static const UIActivityIndicatorViewStyle
UIActivityIndicatorViewStyleWhiteSmall(static_cast<UIActivityIndicatorViewStyle
>(3));
33 static const UIActivityIndicatorViewStyle
UIActivityIndicatorViewStyleGraySmall(static_cast<UIActivityIndicatorViewStyle
>(4));
34 static const UIActivityIndicatorViewStyle
UIActivityIndicatorViewStyleWhiteTiny(static_cast<UIActivityIndicatorViewStyle
>(5));
37 #define UIDataDetectorTypeAutomatic 0x80000000
41 @
class WebScriptObject
;
45 @protocol WebPolicyDecisionListener
;
48 // @interface * : UIView {{{
49 @interface UIFormAssistant
: UIView
50 + (UIFormAssistant
*) sharedFormAssistant
;
51 - (CGRect
) peripheralFrame
;
54 @interface UIKeyboard
: UIView
55 + (void) initImplementationNow
;
58 @interface UIProgressBar
: UIView
59 + (CGSize
) defaultSize
;
60 - (void) setProgress
:(float)progress
;
61 - (void) setStyle
:(NSInteger
)style
;
64 @interface UIProgressHUD
: UIView
66 - (void) setText
:(NSString
*)text
;
67 - (void) showInView
:(UIView
*)view
;
70 @interface UIScroller
: UIView
71 - (CGSize
) contentSize
;
72 - (void) setDirectionalScrolling
:(BOOL
)directional
;
73 - (void) setEventMode
:(NSInteger
)mode
;
74 - (void) setOffset
:(CGPoint
)offset
;
75 - (void) setScrollDecelerationFactor
:(float)factor
;
76 - (void) setScrollHysteresis
:(float)hysteresis
;
77 - (void) setScrollerIndicatorStyle
:(UIScrollViewIndicatorStyle
)style
;
78 - (void) setThumbDetectionEnabled
:(BOOL
)enabled
;
81 @interface UITextLabel
: UIView
82 - (void) setCentersHorizontally
:(BOOL
)centers
;
83 - (void) setColor
:(UIColor
*)color
;
84 - (void) setFont
:(UIFont
*)font
;
85 - (void) setText
:(NSString
*)text
;
88 @interface UITransitionView
: UIView
91 @interface UIWebDocumentView
: UIView
92 - (CGRect
) documentBounds
;
93 - (void) enableReachability
;
94 - (void) loadRequest
:(NSURLRequest
*)request
;
95 - (void) redrawScaledDocument
;
96 - (void) setAllowsImageSheet
:(BOOL
)allows
;
97 - (void) setAllowsMessaging
:(BOOL
)allows
;
98 - (void) setAutoresizes
:(BOOL
)autoresizes
;
99 - (void) setContentsPosition
:(NSInteger
)position
;
100 - (void) setDrawsBackground
:(BOOL
)draws
;
101 - (void) _setDocumentType
:(NSInteger
)type
;
102 - (void) setDrawsGrid
:(BOOL
)draws
;
103 - (void) setInitialScale
:(float)scale forDocumentTypes
:(NSInteger
)types
;
104 - (void) setLogsTilingChanges
:(BOOL
)logs
;
105 - (void) setMinimumScale
:(float)scale forDocumentTypes
:(NSInteger
)types
;
106 - (void) setMinimumSize
:(CGSize
)size
;
107 - (void) setMaximumScale
:(float)scale forDocumentTypes
:(NSInteger
)tpyes
;
108 - (void) setSmoothsFonts
:(BOOL
)smooths
;
109 - (void) setTileMinificationFilter
:(NSString
*)filter
;
110 - (void) setTileSize
:(CGSize
)size
;
111 - (void) setTilingEnabled
:(BOOL
)enabled
;
112 - (void) setViewportSize
:(CGSize
)size forDocumentTypes
:(NSInteger
)types
;
113 - (void) setZoomsFocusedFormControl
:(BOOL
)zooms
;
114 - (void) useSelectionAssistantWithMode
:(NSInteger
)mode
;
115 - (WebView
*) webView
;
118 @interface UIWebViewWebViewDelegate
: NSObject
{
119 @
public UIWebView
*uiWebView
;
122 - (void) _clearUIWebView
;
126 // @interface *Button : * {{{
127 @interface UINavigationButton
: UIButton
128 - (id
) initWithTitle
:(NSString
*)title style
:(UINavigationButtonStyle
)style
;
129 - (void) setBarStyle
:(UIBarStyle
)style
;
132 @interface UIPushButton
: UIControl
133 - (id
) backgroundForState
:(NSUInteger
)state
;
134 - (void) setAutosizesToFit
:(BOOL
)autosizes
;
135 - (void) setBackground
:(id
)background forState
:(NSUInteger
)state
;
136 - (void) setDrawsShadow
:(BOOL
)draws
;
137 - (void) setStretchBackground
:(BOOL
)stretch
;
138 - (void) setTitle
:(NSString
*)title
;
139 - (void) setTitleFont
:(UIFont
*)font
;
142 @interface UIThreePartButton
: UIPushButton
145 // @interface * : NS* {{{
146 @interface WebDefaultUIKitDelegate
: NSObject
147 + (WebDefaultUIKitDelegate
*) sharedUIKitDelegate
;
150 // @interface UIWeb* : * {{{
151 @interface UIWebBrowserView
: UIWebDocumentView
154 @interface UIWebTouchEventsGestureRecognizer
: UIGestureRecognizer
156 - (NSString
*) _typeDescription
;
159 // @interface WAK* : * {{{
160 @interface WAKWindow
: NSObject
161 + (BOOL
) hasLandscapeOrientation
;
165 // @interface NS* (*) {{{
166 @interface
NSMutableURLRequest (Apple
)
167 - (void) setHTTPShouldUsePipelining
:(BOOL
)pipelining
;
170 @interface
NSString (Apple
)
171 - (NSString
*) stringByAddingPercentEscapes
;
172 - (NSString
*) stringByReplacingCharacter
:(UniChar
)from withCharacter
:(UniChar
)to
;
175 @interface
NSURL (Apple
)
176 - (BOOL
) isGoogleMapsURL
;
177 - (BOOL
) isSpringboardHandledURL
;
178 // XXX: make this an enum
179 - (NSURL
*) itmsURL
:(NSInteger
*)store
;
181 - (NSURL
*) phobosURL
;
182 - (NSURL
*) youTubeURL
;
185 @interface
NSURLRequest (Apple
)
186 + (BOOL
) allowsAnyHTTPSCertificateForHost
:(NSString
*)host
;
187 + (void) setAllowsAnyHTTPSCertificate
:(BOOL
)allow forHost
:(NSString
*)host
;
190 @interface
NSValue (Apple
)
191 + (NSValue
*) valueWithSize
:(CGSize
)size
;
194 // @interface UI* (*) {{{
195 @interface
UIActionSheet (Apple
)
196 - (void) setContext
:(NSString
*)context
;
197 - (NSString
*) context
;
200 @interface
UIAlertView (Apple
)
201 - (void) addTextFieldWithValue
:(NSString
*)value label
:(NSString
*)label
;
203 - (NSString
*) context
;
204 - (void) setContext
:(NSString
*)context
;
205 - (void) setNumberOfRows
:(int)rows
;
206 - (void) setRunsModal
:(BOOL
)modal
;
207 - (UITextField
*) textField
;
208 - (UITextField
*) textFieldAtIndex
:(NSUInteger
)index
;
209 - (void) _updateFrameForDisplay
;
212 @interface
UIApplication (Apple
)
213 - (void) applicationSuspend
:(GSEventRef
)event
;
214 - (void) _animateSuspension
:(BOOL
)suspend duration
:(double)duration startTime
:(double)start scale
:(float)scale
;
215 - (void) applicationOpenURL
:(NSURL
*)url
;
216 - (void) applicationWillResignActive
:(UIApplication
*)application
;
217 - (void) applicationWillSuspend
;
218 - (void) launchApplicationWithIdentifier
:(NSString
*)identifier suspended
:(BOOL
)suspended
;
219 - (void) openURL
:(NSURL
*)url asPanel
:(BOOL
)panel
;
220 - (void) setStatusBarShowsProgress
:(BOOL
)shows
;
221 - (void) _setSuspended
:(BOOL
)suspended
;
222 - (void) terminateWithSuccess
;
225 @interface
UIBarButtonItem (Apple
)
229 @interface
UIColor (Apple
)
230 + (UIColor
*) pinStripeColor
;
233 @interface
UIControl (Apple
)
234 - (void) addTarget
:(id
)target action
:(SEL
)action forEvents
:(NSInteger
)events
;
237 @interface
UIImage (Apple
)
238 + (UIImage
*) applicationImageNamed
:(NSString
*)name
;
239 + (UIImage
*) imageAtPath
:(NSString
*)path
;
242 @interface
UINavigationBar (Apple
)
243 + (CGSize
) defaultSize
;
244 - (UIBarStyle
) _barStyle
:(BOOL
)style
;
247 @interface
UIScrollView (Apple
)
248 - (void) setScrollingEnabled
:(BOOL
)enabled
;
249 - (void) setShowBackgroundShadow
:(BOOL
)show
;
252 @interface
UISearchBar (Apple
)
253 - (UITextField
*) searchField
;
256 @interface
UITabBarController (Apple
)
257 - (UITransitionView
*) _transitionView
;
258 - (void) concealTabBarSelection
;
259 - (void) revealTabBarSelection
;
262 @interface
UITabBarItem (Apple
)
263 - (void) setAnimatedBadge
:(BOOL
)animated
;
267 @interface
UITableViewCell (Apple
)
268 - (float) selectionPercent
;
269 - (void) _updateHighlightColorsForView
:(id
)view highlighted
:(BOOL
)highlighted
;
272 @interface
UITextField (Apple
)
273 - (UITextInputTraits
*) textInputTraits
;
276 @interface
UITextView (Apple
)
278 - (void) setAllowsRubberBanding
:(BOOL
)rubberbanding
;
279 - (void) setFont
:(UIFont
*)font
;
280 - (void) setMarginTop
:(int)margin
;
281 - (void) setTextColor
:(UIColor
*)color
;
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 - (void) setOrigin
:(CGPoint
)origin
;
297 @interface
UIViewController (Apple
)
298 - (void) _updateLayoutForStatusBarAndInterfaceOrientation
;
302 @interface
UIWindow (Apple
)
303 - (UIResponder
*) firstResponder
;
304 - (void) makeKey
:(UIApplication
*)application
;
305 - (void) orderFront
:(UIApplication
*)application
;
308 @interface
UIWebView (Apple
)
309 - (UIWebDocumentView
*) _documentView
;
310 - (UIScrollView
*) _scrollView
;
311 - (UIScroller
*) _scroller
;
312 - (void) _updateViewSettings
;
313 - (void) webView
:(WebView
*)view addMessageToConsole
:(NSDictionary
*)message
;
314 //- (WebView *) webView:(WebView *)view createWebViewWithRequest:(NSURLRequest *)request;
315 - (void) webView
:(WebView
*)view decidePolicyForNavigationAction
:(NSDictionary
*)action request
:(NSURLRequest
*)request frame
:(WebFrame
*)frame decisionListener
:(id
<WebPolicyDecisionListener
>)listener
;
316 - (void) webView
:(WebView
*)view decidePolicyForNewWindowAction
:(NSDictionary
*)action request
:(NSURLRequest
*)request newFrameName
:(NSString
*)name decisionListener
:(id
<WebPolicyDecisionListener
>)listener
;
317 - (void) webView
:(WebView
*)view didClearWindowObject
:(WebScriptObject
*)window forFrame
:(WebFrame
*)frame
;
318 - (void) webView
:(WebView
*)view didCommitLoadForFrame
:(WebFrame
*)frame
;
319 - (void) webView
:(WebView
*)view didFailLoadWithError
:(NSError
*)error forFrame
:(WebFrame
*)frame
;
320 - (void) webView
:(WebView
*)view didFailProvisionalLoadWithError
:(NSError
*)error forFrame
:(WebFrame
*)frame
;
321 - (void) webView
:(WebView
*)view didFinishLoadForFrame
:(WebFrame
*)frame
;
322 - (void) webView
:(WebView
*)view didReceiveTitle
:(id
)title forFrame
:(id
)frame
;
323 - (void) webView
:(WebView
*)view didStartProvisionalLoadForFrame
:(WebFrame
*)frame
;
324 - (NSURLRequest
*) webView
:(WebView
*)view resource
:(id
)identifier willSendRequest
:(NSURLRequest
*)request redirectResponse
:(NSURLResponse
*)response fromDataSource
:(WebDataSource
*)source
;
325 - (void) webView
:(WebView
*)view runJavaScriptAlertPanelWithMessage
:(NSString
*)message initiatedByFrame
:(WebFrame
*)frame
;
326 - (BOOL
) webView
:(WebView
*)view runJavaScriptConfirmPanelWithMessage
:(NSString
*)message initiatedByFrame
:(WebFrame
*)frame
;
327 - (NSString
*) webView
:(WebView
*)view runJavaScriptTextInputPanelWithPrompt
:(NSString
*)prompt defaultText
:(NSString
*)text initiatedByFrame
:(WebFrame
*)frame
;
328 - (void) webViewClose
:(WebView
*)view
;
331 // @interface Web* (*) {{{
332 @interface
WebFrame (Apple
)
333 - (void) setNeedsLayout
;
336 @interface
WebPreferences (Apple
)
337 + (void) _setInitialDefaultTextEncodingToSystemEncoding
;
338 - (void) _setLayoutInterval
:(NSInteger
)interval
;
339 - (void) setOfflineWebApplicationCacheEnabled
:(BOOL
)enabled
;
343 // #ifndef AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER {{{
344 #ifndef AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
345 #define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
346 // XXX: this is a random jumble of garbage
349 UIModalPresentationFullScreen
,
350 UIModalPresentationPageSheet
,
351 UIModalPresentationFormSheet
,
352 UIModalPresentationCurrentContext
,
353 } UIModalPresentationStyle
;
355 #define kSCNetworkReachabilityFlagsConnectionOnTraffic kSCNetworkReachabilityFlagsConnectionAutomatic
357 #define UIBarStyleBlack UIBarStyleBlackOpaque
359 @
class NSUndoManager
;
362 @interface
UIActionSheet (iPad
)
363 - (void) showFromBarButtonItem
:(UIBarButtonItem
*)item animated
:(BOOL
)animated
;
366 @interface
UIViewController (iPad
)
367 - (void) setModalPresentationStyle
:(UIModalPresentationStyle
)style
;
370 @interface
UIApplication (iOS_3_0
)
371 @
property(nonatomic
) BOOL applicationSupportsShakeToEdit
;
374 @interface
UIScrollView (iOS_3_0
)
375 @
property(assign
,nonatomic
) float decelerationRate
;
378 @interface
UIWebView (iOS_3_0
)
379 @
property(assign
,nonatomic
) NSUInteger dataDetectorTypes
;
382 extern float const UIScrollViewDecelerationRateNormal
;
384 #endif//AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
386 // #if __IPHONE_OS_VERSION_MIN_REQUIRED < 30000 {{{
387 #if __IPHONE_OS_VERSION_MIN_REQUIRED < 30000
389 #define kSCNetworkReachabilityFlagsConnectionOnDemand (1 << 5)
390 #define kCFCoreFoundationVersionNumber_iPhoneOS_3_0 478.47
395 #ifndef kCFCoreFoundationVersionNumber_iPhoneOS_4_0
396 #define kCFCoreFoundationVersionNumber_iPhoneOS_4_0 550.32
399 @interface
UITabBarItem (iOS_7_0
)
400 - (id
) initWithTitle
:(NSString
*)title image
:(UIImage
*)image selectedImage
:(UIImage
*)selectedImage
;
403 @interface
UIScreen (iOS_4_0
)
404 @
property(nonatomic
,readonly
) CGFloat scale
;
407 @interface
DOMHTMLIFrameElement (IDL
)
408 - (WebFrame
*) contentFrame
;
412 UIInterfaceOrientationMaskPortrait
= (1 << UIInterfaceOrientationPortrait
),
413 UIInterfaceOrientationMaskLandscapeLeft
= (1 << UIInterfaceOrientationLandscapeLeft
),
414 UIInterfaceOrientationMaskLandscapeRight
= (1 << UIInterfaceOrientationLandscapeRight
),
415 UIInterfaceOrientationMaskPortraitUpsideDown
= (1 << UIInterfaceOrientationPortraitUpsideDown
),
416 UIInterfaceOrientationMaskLandscape
= (UIInterfaceOrientationMaskLandscapeLeft
| UIInterfaceOrientationMaskLandscapeRight
),
417 UIInterfaceOrientationMaskAll
= (UIInterfaceOrientationMaskPortrait
| UIInterfaceOrientationMaskLandscapeLeft
|
418 UIInterfaceOrientationMaskLandscapeRight
| UIInterfaceOrientationMaskPortraitUpsideDown
),
419 UIInterfaceOrientationMaskAllButUpsideDown
= (UIInterfaceOrientationMaskPortrait
| UIInterfaceOrientationMaskLandscapeLeft
| UIInterfaceOrientationMaskLandscapeRight
),
420 } UIInterfaceOrientationMask
;
423 extern CFStringRef
const kGSDisplayIdentifiersCapability
;
424 extern float const UIWebViewGrowsAndShrinksToFitHeight
;
425 extern float const UIWebViewScalesToFitScale
;
427 // extern "C" *(); {{{
428 extern "C" void *reboot2(uint64_t flags
);
429 extern "C" mach_port_t
SBSSpringBoardServerPort();
430 extern "C" int SBBundlePathForDisplayIdentifier(mach_port_t port
, const char *identifier
, char *path
);
431 extern "C" UIImage
*_UIImageWithName(NSString
*name
);
432 extern "C" void UISetColor(CGColorRef color
);
435 #endif//CYDIA_UIKITPRIVATE_H