iOS file upload panel menu items need icons
[WebKit-https.git] / Source / WebKit2 / Platform / spi / ios / UIKitSPI.h
1 /*
2  * Copyright (C) 2014 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #import <UIKit/UIKit.h>
27
28 #if USE(APPLE_INTERNAL_SDK)
29
30 #import <UIKit/UIAlertController_Private.h>
31 #import <UIKit/UIApplication_Private.h>
32 #import <UIKit/UIBarButtonItem_Private.h>
33 #import <UIKit/UIDatePicker_Private.h>
34 #import <UIKit/UIDevice_Private.h>
35 #import <UIKit/UIFont_Private.h>
36 #import <UIKit/UIGeometry_Private.h>
37 #import <UIKit/UIGestureRecognizer_Private.h>
38 #import <UIKit/UIImagePickerController_Private.h>
39 #import <UIKit/UIImage_Private.h>
40 #import <UIKit/UIInterface_Private.h>
41 #import <UIKit/UIKeyboardImpl.h>
42 #import <UIKit/UIKeyboardIntl.h>
43 #import <UIKit/UIKeyboard_Private.h>
44 #import <UIKit/UILongPressGestureRecognizer_Private.h>
45 #import <UIKit/UIPeripheralHost.h>
46 #import <UIKit/UIPeripheralHost_Private.h>
47 #import <UIKit/UIPickerContentView_Private.h>
48 #import <UIKit/UIPickerView_Private.h>
49 #import <UIKit/UIScrollView_Private.h>
50 #import <UIKit/UIStringDrawing_Private.h>
51 #import <UIKit/UITableViewCell_Private.h>
52 #import <UIKit/UITapGestureRecognizer_Private.h>
53 #import <UIKit/UITextInput_Private.h>
54 #import <UIKit/UITextInteractionAssistant_Private.h>
55 #import <UIKit/UIViewControllerTransitioning_Private.h>
56 #import <UIKit/UIViewController_Private.h>
57 #import <UIKit/UIView_Private.h>
58 #import <UIKit/UIWKSelectionAssistant.h>
59 #import <UIKit/UIWKTextInteractionAssistant.h>
60 #import <UIKit/UIWebBrowserView.h>
61 #import <UIKit/UIWebDocumentView.h>
62 #import <UIKit/UIWebFormAccessory.h>
63 #import <UIKit/UIWebGeolocationPolicyDecider.h>
64 #import <UIKit/UIWebScrollView.h>
65 #import <UIKit/UIWebTiledView.h>
66 #import <UIKit/UIWebTouchEventsGestureRecognizer.h>
67 #import <UIKit/UIWindow_Private.h>
68 #import <UIKit/_UIBackdropView_Private.h>
69 #import <UIKit/_UIHighlightView.h>
70 #import <UIKit/_UINavigationInteractiveTransition.h>
71 #import <UIKit/_UINavigationParallaxTransition.h>
72
73 // FIXME: Unconditionally include this file when a new SDK is available. <rdar://problem/20150072>
74 #if defined(__has_include) && __has_include(<UIKit/UIDocumentMenuViewController_Private.h>)
75 #import <UIKit/UIDocumentMenuViewController_Private.h>
76 #else
77 @interface UIDocumentMenuViewController (Details)
78 @property (nonatomic, assign, setter = _setIgnoreApplicationEntitlementForImport:, getter = _ignoreApplicationEntitlementForImport) BOOL _ignoreApplicationEntitlementForImport;
79 @end
80 #endif
81
82 #else
83
84 @interface UIAlertController (Details)
85 - (void)_addActionWithTitle:(NSString *)title style:(UIAlertActionStyle)style handler:(void (^)(void))handler;
86 - (void)_addActionWithTitle:(NSString *)title style:(UIAlertActionStyle)style handler:(void (^)(void))handler shouldDismissHandler:(BOOL (^)(void))shouldDismissHandler;
87 @property (nonatomic) UIAlertControllerStyle preferredStyle;
88 @end
89
90 @interface UIApplication (Details)
91 - (UIInterfaceOrientation)interfaceOrientation;
92 - (void)_cancelAllTouches;
93 - (CGFloat)statusBarHeight;
94 @end
95
96 typedef NS_ENUM(NSInteger, UIDatePickerPrivateMode)  {
97     UIDatePickerModeYearAndMonth = 4269,
98 };
99
100 @interface UIDatePicker (Details)
101 @property (nonatomic, readonly, getter=_contentWidth) CGFloat contentWidth;
102 @end
103
104 #define UICurrentUserInterfaceIdiomIsPad() ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
105
106 @interface UIDevice (Details)
107 @property (nonatomic, readonly, retain) NSString *buildVersion;
108 @end
109
110 typedef enum {
111     UIFontTraitPlain = 0x00000000,
112 } UIFontTrait;
113
114 @interface UIFont (Details)
115 + (UIFont *)fontWithFamilyName:(NSString *)familyName traits:(UIFontTrait)traits size:(CGFloat)fontSize;
116 @end
117
118 typedef enum {
119     UIAllCorners = 0xFF,
120 } UIRectCorners;
121
122 @interface UIImagePickerController (Details)
123 @property (nonatomic, setter=_setAllowsMultipleSelection:) BOOL _allowsMultipleSelection;
124 @end
125
126 @interface UIImage (Details)
127 - (id)initWithCGImage:(CGImageRef)CGImage imageOrientation:(UIImageOrientation)imageOrientation;
128 @end
129
130 @protocol UIKeyboardImplGeometryDelegate
131 @property (nonatomic, readwrite, getter=isMinimized) BOOL minimized;
132 - (void)prepareForImplBoundsHeightChange:(CGFloat)endDelta suppressNotification:(BOOL)suppressNotification;
133 - (void)implBoundsHeightChangeDone:(CGFloat)endDelta suppressNotification:(BOOL)suppressNotification;
134 - (BOOL)shouldSaveMinimizationState;
135 - (BOOL)canDismiss;
136 - (BOOL)isActive;
137 @end
138
139 @protocol UIKeyboardCandidateListDelegate <NSObject>
140 @optional
141 - (void)setCandidateList:(id)candidateList updateCandidateView:(BOOL)updateCandidateView;
142 - (void)candidateListAcceptCandidate:(id)candidateList;
143 - (void)candidateListSelectionDidChange:(id)candidateList;
144 - (void)candidateListShouldBeDismissed:(id)candidateList;
145 @end
146
147 @interface UIKeyboard : UIView <UIKeyboardImplGeometryDelegate>
148 @end
149
150 @interface UIKeyboard (Details)
151 + (CGSize)defaultSizeForInterfaceOrientation:(UIInterfaceOrientation)orientation;
152 - (void)activate;
153 - (void)geometryChangeDone:(BOOL)keyboardVisible;
154 - (void)prepareForGeometryChange;
155 @end
156
157 @interface UIKeyboardImpl : UIView <UIKeyboardCandidateListDelegate>
158 @end
159
160 @interface UIKeyboardImpl (Details)
161 + (UIKeyboardImpl *)activeInstance;
162 + (UIKeyboardImpl *)sharedInstance;
163 + (CGSize)defaultSizeForInterfaceOrientation:(UIInterfaceOrientation)orientation;
164 - (void)addInputString:(NSString *)string withFlags:(NSUInteger)flags;
165 - (BOOL)autocorrectSpellingEnabled;
166 - (void)deleteFromInput;
167 - (void)deleteFromInputWithFlags:(NSUInteger)flags;
168 - (void)replaceText:(id)replacement;
169 @property (nonatomic, readwrite, retain) UIResponder <UIKeyInput> *delegate;
170 @end
171
172 @interface UIGestureRecognizer (Details)
173 - (void)requireOtherGestureToFail:(UIGestureRecognizer *)gestureRecognizer;
174 @end
175
176 @interface UILongPressGestureRecognizer (Details)
177 @property (nonatomic) CFTimeInterval delay;
178 @property (nonatomic, readonly) CGPoint startPoint;
179 @end
180
181 @interface _UIWebHighlightLongPressGestureRecognizer : UILongPressGestureRecognizer
182 @end
183
184 @interface _UIWebHighlightLongPressGestureRecognizer (Details)
185 - (void)cancel;
186 @end
187
188 @interface UIPeripheralHost : NSObject <UIGestureRecognizerDelegate>
189 @end
190
191 @class UIKeyboardRotationState;
192
193 @interface UIPeripheralHost (Details)
194 + (UIPeripheralHost *)sharedInstance;
195 + (UIPeripheralHost *)activeInstance;
196 - (BOOL)isOnScreen;
197 - (UIKeyboardRotationState *)rotationState;
198 @end
199
200 @interface UIPickerContentView : UIView
201 @end
202
203 @interface UIPickerContentView (Details)
204 +(CGFloat)_checkmarkOffset;
205 -(CGFloat)labelWidthForBounds:(CGRect)bounds;
206 @property (nonatomic, getter=isChecked) BOOL checked;
207 @property (nonatomic, readonly) UILabel *titleLabel;
208 @end
209
210 @interface UIPickerView (Details)
211 + (CGSize)defaultSizeForCurrentOrientation;
212 - (void)_setUsesCheckedSelection:(BOOL)usesCheckedSelection;
213 @property (nonatomic, setter=_setMagnifierEnabled:) BOOL _magnifierEnabled;
214 @end
215
216 @interface UIScrollView (Details)
217 - (void)_stopScrollingAndZoomingAnimations;
218 - (void)_zoomToCenter:(CGPoint)center scale:(CGFloat)scale duration:(CFTimeInterval)duration force:(BOOL)force;
219 - (void)_zoomToCenter:(CGPoint)center scale:(CGFloat)scale duration:(CFTimeInterval)duration;
220 @property (nonatomic, getter=isZoomEnabled) BOOL zoomEnabled;
221 @property (nonatomic, readonly, getter=_isAnimatingZoom) BOOL isAnimatingZoom;
222 @property (nonatomic) CGFloat horizontalScrollDecelerationFactor;
223 @property (nonatomic) CGFloat verticalScrollDecelerationFactor;
224 @end
225
226 @interface NSString (UIKitDetails)
227 - (CGSize)_legacy_sizeWithFont:(UIFont *)font forWidth:(CGFloat)width lineBreakMode:(NSLineBreakMode)lineBreakMode;
228 - (CGSize)_legacy_sizeWithFont:(UIFont *)font minFontSize:(CGFloat)minFontSize actualFontSize:(CGFloat *)actualFontSize forWidth:(CGFloat)width lineBreakMode:(NSLineBreakMode)lineBreakMode;
229 @end
230
231 @interface UITapGestureRecognizer (Details)
232 @property (nonatomic, readonly) CGPoint location;
233 @end
234
235 @class WebEvent;
236
237 typedef enum {
238     UITextShortcutConversionTypeDefault = 0,
239     UITextShortcutConversionTypeNo = 1,
240     UITextShortcutConversionTypeYes = 2,
241 } UITextShortcutConversionType;
242
243 @protocol UITextInputTraits_Private <NSObject, UITextInputTraits>
244 - (void)takeTraitsFrom:(id <UITextInputTraits>)traits;
245 @optional
246 @property (nonatomic) UITextShortcutConversionType shortcutConversionType;
247 @end
248
249 @class UITextInputArrowKeyHistory;
250
251 @protocol UITextInputPrivate <UITextInput, UITextInputTokenizer, UITextInputTraits_Private>
252 @optional
253 - (BOOL)requiresKeyEvents;
254 - (NSArray *)metadataDictionariesForDictationResults;
255 - (UIColor *)textColorForCaretSelection;
256 - (UIFont *)fontForCaretSelection;
257 - (UIView *)automaticallySelectedOverlay;
258 - (void)handleKeyWebEvent:(WebEvent *)event;
259 - (void)insertDictationResult:(NSArray *)dictationResult withCorrectionIdentifier:(id)correctionIdentifier;
260 - (void)replaceRangeWithTextWithoutClosingTyping:(UITextRange *)range replacementText:(NSString *)text;
261 - (void)setBottomBufferHeight:(CGFloat)bottomBuffer;
262 @property (nonatomic) UITextGranularity selectionGranularity;
263 @required
264 - (BOOL)hasContent;
265 - (BOOL)hasSelection;
266 - (void)selectAll;
267 @end
268
269 @interface UITextInputTraits : NSObject <UITextInputTraits, UITextInputTraits_Private, NSCopying>
270 @end
271
272 @interface UITextInteractionAssistant : NSObject
273 @end
274
275 @interface UITextInteractionAssistant (Details)
276 - (void)activateSelection;
277 - (void)deactivateSelection;
278 - (void)didEndScrollingOverflow;
279 - (void)selectionChanged;
280 - (void)setGestureRecognizers;
281 - (void)willStartScrollingOverflow;
282 @end
283
284 @interface UIViewController (Details)
285 + (UIViewController *)_viewControllerForFullScreenPresentationFromView:(UIView *)view;
286 + (UIViewController *)viewControllerForView:(UIView *)view;
287 @end
288
289 @protocol UIViewControllerContextTransitioningEx <UIViewControllerContextTransitioning>
290 - (void)__runAlongsideAnimations;
291 - (void)_interactivityDidChange:(BOOL)isInteractive;
292 @property (nonatomic, assign, setter=_setAllowUserInteraction:, getter=_allowUserInteraction) BOOL _allowUserInteraction;
293 @property (nonatomic, assign, setter=_setPercentOffset:) CGFloat _percentOffset;
294 @property (nonatomic, retain, setter=_setContainerViews:) NSArray *_containerViews;
295 @end
296
297 @interface _UIViewControllerTransitionContext : NSObject <UIViewControllerContextTransitioningEx>
298 @end
299
300 @interface _UIViewControllerTransitionContext (Details)
301 - (void) _setTransitionIsInFlight:(BOOL)flag;
302 @property (nonatomic, assign, setter=_setAllowUserInteraction:, getter=_allowUserInteraction) BOOL _allowUserInteraction;
303 @property (nonatomic, assign, setter=_setAnimator:) id <UIViewControllerAnimatedTransitioning> _animator;
304 @property (nonatomic, assign, setter=_setContainerView:) UIView *containerView;
305 @property (nonatomic, assign, setter=_setInteractor:) id <UIViewControllerInteractiveTransitioning> _interactor;
306 @property (nonatomic, assign, setter=_setPercentOffset:) CGFloat _percentOffset;
307 @property (nonatomic, copy, setter=_setCompletionHandler:)  void (^_completionHandler)(_UIViewControllerTransitionContext *context, BOOL transitionCompleted);
308 @property (nonatomic, retain, setter=_setContainerViews:) NSArray *_containerViews;
309 @end
310
311 @interface _UIViewControllerOneToOneTransitionContext : _UIViewControllerTransitionContext
312 @end
313
314 @interface _UIViewControllerOneToOneTransitionContext (Details)
315 @property (nonatomic, assign, setter=_setFromEndFrame:) CGRect fromEndFrame;
316 @property (nonatomic, assign, setter=_setFromStartFrame:) CGRect fromStartFrame;
317 @property (nonatomic, assign, setter=_setToEndFrame:) CGRect toEndFrame;
318 @property (nonatomic, assign, setter=_setToStartFrame:) CGRect toStartFrame;
319 @property (nonatomic, retain, setter=_setFromViewController:) UIViewController *fromViewController;
320 @property (nonatomic, retain, setter=_setToViewController:) UIViewController *toViewController;
321 @end
322
323 @protocol UIViewControllerAnimatedTransitioningEx <UIViewControllerAnimatedTransitioning>
324 - (BOOL)interactionAborted;
325 - (UINavigationControllerOperation) operation;
326 - (UIPercentDrivenInteractiveTransition *)interactionController;
327 - (void)setInteractionAborted:(BOOL)aborted;
328 - (void)setInteractionController:(UIPercentDrivenInteractiveTransition *)controller;
329 - (void)setOperation:(UINavigationControllerOperation)operation;
330 @optional
331 - (UIWindow *)window;
332 @end
333
334 typedef NS_ENUM (NSInteger, _UIBackdropMaskViewFlags) {
335     _UIBackdropMaskViewNone = 0,
336     _UIBackdropMaskViewGrayscaleTint = 1 << 0,
337     _UIBackdropMaskViewColorTint = 1 << 1,
338     _UIBackdropMaskViewFilters = 1 << 2,
339     _UIBackdropMaskViewAll = _UIBackdropMaskViewGrayscaleTint | _UIBackdropMaskViewColorTint | _UIBackdropMaskViewFilters,
340 };
341
342 @interface UIView (Details)
343 + (BOOL)_isInAnimationBlock;
344 - (CGSize)size;
345 - (void)setFrameOrigin:(CGPoint)origin;
346 - (void)setSize:(CGSize)size;
347 @property (nonatomic, assign, setter=_setBackdropMaskViewFlags:) NSInteger _backdropMaskViewFlags;
348 @end
349
350 @interface UIWebSelectionAssistant : NSObject <UIGestureRecognizerDelegate>
351 @end
352
353 @interface UIWebSelectionAssistant (Details)
354 - (BOOL)isSelectionGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer;
355 - (id)initWithView:(UIView *)view;
356 - (void)clearSelection;
357 - (void)didEndScrollingOrZoomingPage;
358 - (void)didEndScrollingOverflow;
359 - (void)resignedFirstResponder;
360 - (void)selectionChanged;
361 - (void)setGestureRecognizers;
362 - (void)willStartScrollingOrZoomingPage;
363 - (void)willStartScrollingOverflow;
364 @property (nonatomic, readonly) CGRect selectionFrame;
365 @end
366
367 typedef NS_ENUM(NSInteger, UIWKSelectionTouch) {
368     UIWKSelectionTouchStarted = 0,
369     UIWKSelectionTouchMoved = 1,
370     UIWKSelectionTouchEnded = 2,
371     UIWKSelectionTouchEndedMovingForward = 3,
372     UIWKSelectionTouchEndedMovingBackward = 4,
373     UIWKSelectionTouchEndedNotMoving = 5,
374 };
375
376 typedef NS_ENUM(NSInteger, UIWKSelectionFlags) {
377     UIWKNone = 0,
378     UIWKWordIsNearTap = 1,
379     UIWKIsBlockSelection = 2,
380     UIWKPhraseBoundaryChanged = 4,
381 };
382
383 typedef NS_ENUM(NSInteger, UIWKGestureType) {
384     UIWKGestureLoupe = 0,
385     UIWKGestureOneFingerTap = 1,
386     UIWKGestureTapAndAHalf = 2,
387     UIWKGestureDoubleTap = 3,
388     UIWKGestureTapAndHalf = 4,
389     UIWKGestureDoubleTapInUneditable = 5,
390     UIWKGestureOneFingerTapInUneditable = 6,
391     UIWKGestureOneFingerTapSelectsAll = 7,
392     UIWKGestureOneFingerDoubleTap = 8,
393     UIWKGestureOneFingerTripleTap = 9,
394     UIWKGestureTwoFingerSingleTap = 10,
395     UIWKGestureTwoFingerRangedSelectGesture = 11,
396     UIWKGestureTapOnLinkWithGesture = 12,
397     UIWKGestureMakeWebSelection = 13,
398     UIWKGesturePhraseBoundary = 14,
399 };
400
401 @interface UIWKSelectionAssistant : UIWebSelectionAssistant
402 @end
403
404 @interface UIWKSelectionAssistant (Details)
405 - (BOOL)shouldHandleSingleTapAtPoint:(CGPoint)point;
406 - (void)blockSelectionChangedWithTouch:(UIWKSelectionTouch)touch withFlags:(UIWKSelectionFlags)flags growThreshold:(CGFloat)grow shrinkThreshold:(CGFloat)shrink;
407 - (void)selectionChangedWithGestureAt:(CGPoint)point withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)gestureState withFlags:(UIWKSelectionFlags)flags;
408 - (void)selectionChangedWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch withFlags:(UIWKSelectionFlags)flags;
409 - (void)selectionChangedWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch;
410 - (void)showDictionaryFor:(NSString *)selectedTerm fromRect:(CGRect)presentationRect;
411 @property (nonatomic, readonly) UILongPressGestureRecognizer *selectionLongPressRecognizer;
412 @end
413
414 typedef NS_ENUM(NSInteger, UIWKHandlePosition) {
415     UIWKHandleTop = 0,
416     UIWKHandleRight = 1,
417     UIWKHandleBottom = 2,
418     UIWKHandleLeft = 3,
419 };
420
421 @interface UIWKAutocorrectionRects : NSObject
422 @end
423
424 @interface UIWKAutocorrectionRects (UIWKAutocorrectionRectsDetails)
425 @property (nonatomic, assign) CGRect firstRect;
426 @property (nonatomic, assign) CGRect lastRect;
427 @end
428
429 @interface UIWKAutocorrectionContext : NSObject
430 @end
431
432 @interface UIWKAutocorrectionContext (UIWKAutocorrectionContextDetails)
433 @property (nonatomic, copy) NSString *contextBeforeSelection;
434 @property (nonatomic, copy) NSString *selectedText;
435 @property (nonatomic, copy) NSString *contextAfterSelection;
436 @property (nonatomic, copy) NSString *markedText;
437 @property (nonatomic, assign) NSRange rangeInMarkedText;
438 @end
439
440 @interface UIWKTextInteractionAssistant : UITextInteractionAssistant
441 @end
442
443 @interface UIWKTextInteractionAssistant (UIWKTextInteractionAssistantDetails)
444 - (void)selectionChangedWithGestureAt:(CGPoint)point withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)gestureState withFlags:(UIWKSelectionFlags)flags;
445 - (void)showDictionaryFor:(NSString *)selectedTerm fromRect:(CGRect)presentationRect;
446 - (void)selectionChangedWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch;
447 - (void)showTextStyleOptions;
448 - (void)hideTextStyleOptions;
449
450 @property (nonatomic, readonly, retain) UITapGestureRecognizer *singleTapGesture;
451 @property (nonatomic, readonly, retain) UILongPressGestureRecognizer *loupeGesture;
452 @end
453
454 @protocol UIWKInteractionViewProtocol
455 - (void)changeSelectionWithGestureAt:(CGPoint)point withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)state;
456
457 - (void)changeSelectionWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch baseIsStart:(BOOL)baseIsStart;
458 - (void)changeSelectionWithTouchesFrom:(CGPoint)from to:(CGPoint)to withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)gestureState;
459 - (CGRect)textFirstRect;
460 - (CGRect)textLastRect;
461
462 - (void)requestAutocorrectionContextWithCompletionHandler:(void (^)(UIWKAutocorrectionContext *autocorrectionContext))completionHandler;
463
464 - (void)requestAutocorrectionRectsForString:(NSString *)input withCompletionHandler:(void (^)(UIWKAutocorrectionRects *rectsForInput))completionHandler;
465
466 - (void)applyAutocorrection:(NSString *)correction toString:(NSString *)input withCompletionHandler:(void (^)(UIWKAutocorrectionRects *rectsForCorrection))completionHandler;
467
468 - (NSString *)markedText;
469 - (BOOL)hasMarkedText;
470
471 - (BOOL)hasSelectablePositionAtPoint:(CGPoint)point;
472 - (BOOL)pointIsInAssistedNode:(CGPoint)point;
473 - (NSArray *)webSelectionRects;
474 - (void)_cancelLongPressGestureRecognizer;
475
476 @optional
477 - (void)changeSelectionWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch baseIsStart:(BOOL)baseIsStart withFlags:(UIWKSelectionFlags)flags;
478 - (void)changeBlockSelectionWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch forHandle:(UIWKHandlePosition)handle;
479 - (void)clearSelection;
480 - (void)replaceDictatedText:(NSString *)oldText withText:(NSString *)newText;
481 - (void)requestDictationContext:(void (^)(NSString *selectedText, NSString *prefixText, NSString *postfixText))completionHandler;
482 - (BOOL)pointIsNearMarkedText:(CGPoint)point;
483 - (NSString *)selectedText;
484 - (void)replaceText:(NSString *)text withText:(NSString *)word;
485 - (void)selectWordForReplacement;
486 - (BOOL)isReplaceAllowed;
487 - (void)selectWordBackward;
488 - (UIView *)unscaledView;
489 - (CGFloat)inverseScale;
490 - (CGRect)unobscuredContentRect;
491 @end
492
493 typedef enum {
494     UIWebSelectionModeWeb = 0,
495     UIWebSelectionModeTextOnly = 1,
496 } UIWebSelectionMode;
497
498 @protocol UIWebFormAccessoryDelegate;
499
500 @interface UIWebFormAccessory : UIInputView
501 @end
502
503 @interface UIWebFormAccessory (Details)
504 - (void)hideAutoFillButton;
505 - (void)setClearVisible:(BOOL)flag;
506 - (void)showAutoFillButtonWithTitle:(NSString *)title;
507 @property (nonatomic, retain) UIBarButtonItem *_autofill;
508 @property (nonatomic, assign) id <UIWebFormAccessoryDelegate> delegate;
509
510 @property (nonatomic, assign, getter=isNextEnabled) BOOL nextEnabled;
511 @property (nonatomic, assign, getter=isPreviousEnabled) BOOL previousEnabled;
512 @end
513
514 @protocol UIWebFormAccessoryDelegate
515 - (void)accessoryAutoFill;
516 - (void)accessoryClear;
517 - (void)accessoryDone;
518 - (void)accessoryTab:(BOOL)isNext;
519 @end
520
521 @interface UIWebGeolocationPolicyDecider : NSObject
522 @end
523
524 @interface UIWebGeolocationPolicyDecider (Details)
525 + (instancetype)sharedPolicyDecider;
526 - (void)decidePolicyForGeolocationRequestFromOrigin:(id)securityOrigin requestingURL:(NSURL *)requestingURL window:(UIWindow *)window listener:(id)listener;
527 @end
528
529 typedef enum {
530     UIWebTouchEventTouchBegin = 0,
531     UIWebTouchEventTouchChange = 1,
532     UIWebTouchEventTouchEnd = 2,
533     UIWebTouchEventTouchCancel = 3,
534 } UIWebTouchEventType;
535
536 struct _UIWebTouchPoint {
537     CGPoint locationInScreenCoordinates;
538     CGPoint locationInDocumentCoordinates;
539     unsigned identifier;
540     UITouchPhase phase;
541     CGFloat majorRadiusInScreenCoordinates;
542 };
543
544 struct _UIWebTouchEvent {
545     UIWebTouchEventType type;
546     NSTimeInterval timestamp;
547     CGPoint locationInScreenCoordinates;
548     CGPoint locationInDocumentCoordinates;
549     CGFloat scale;
550     CGFloat rotation;
551
552     bool inJavaScriptGesture;
553
554     struct _UIWebTouchPoint* touchPoints;
555     unsigned touchPointCount;
556 };
557
558 @protocol UIWebTouchEventsGestureRecognizerDelegate
559 - (BOOL)isAnyTouchOverActiveArea:(NSSet *)touches;
560 - (BOOL)shouldIgnoreWebTouch;
561 @end
562
563 @interface UIWebTouchEventsGestureRecognizer : UIGestureRecognizer
564 @end
565
566 @interface UIWebTouchEventsGestureRecognizer (Details)
567 - (id)initWithTarget:(id)target action:(SEL)action touchDelegate:(id <UIWebTouchEventsGestureRecognizerDelegate>)delegate;
568 @property (nonatomic, getter=isDefaultPrevented) BOOL defaultPrevented;
569 @property (nonatomic, readonly) BOOL inJavaScriptGesture;
570 @property (nonatomic, readonly) CGPoint locationInWindow;
571 @property (nonatomic, readonly) UIWebTouchEventType type;
572 @property (nonatomic, readonly) const struct _UIWebTouchEvent *lastTouchEvent;
573 @end
574
575 typedef NS_ENUM(NSInteger, _UIBackdropViewStylePrivate) {
576     _UIBackdropViewStyle_Light = 2020,
577     _UIBackdropViewStyle_Dark = 2030
578 };
579
580 @interface _UIBackdropView : UIView
581 @end
582
583 @interface _UIBackdropView (_UIBackdropViewDetails)
584 - (instancetype)initWithPrivateStyle:(_UIBackdropViewStylePrivate)style;
585 - (instancetype)initWithFrame:(CGRect)frame privateStyle:(_UIBackdropViewStylePrivate)style;
586 @property (nonatomic, strong, readonly) UIView *contentView;
587 @end
588
589 @interface _UIHighlightView : UIView
590 @end
591
592 @interface _UIHighlightView (Details)
593 - (void)setColor:(UIColor *)aColor;
594 - (void)setCornerRadii:(NSArray *)cornerRadii;
595 - (void)setCornerRadius:(CGFloat)aCornerRadius;
596 - (void)setFrames:(NSArray *)frames boundaryRect:(CGRect)aBoundarRect;
597 - (void)setQuads:(NSArray *)quads boundaryRect:(CGRect)aBoundaryRect;
598 @end
599
600 @interface _UINavigationParallaxTransition : NSObject <UIViewControllerAnimatedTransitioningEx>
601 @end
602
603 @interface _UINavigationParallaxTransition (Details)
604 - (instancetype) initWithCurrentOperation:(UINavigationControllerOperation)operation;
605 @end
606
607 @protocol _UINavigationInteractiveTransitionBaseDelegate;
608
609 @interface _UINavigationInteractiveTransitionBase : UIPercentDrivenInteractiveTransition <UIGestureRecognizerDelegate>
610 @end
611
612 @interface _UINavigationInteractiveTransitionBase (Details)
613 - (id)initWithGestureRecognizerView:(UIView *)gestureRecognizerView animator:(id<UIViewControllerAnimatedTransitioning>)animator delegate:(id<_UINavigationInteractiveTransitionBaseDelegate>)delegate;
614 @property (nonatomic, assign) BOOL shouldReverseTranslation;
615 @property (nonatomic, retain) _UINavigationParallaxTransition *animationController;
616 @end
617
618 @protocol _UINavigationInteractiveTransitionBaseDelegate <NSObject>
619 - (void)startInteractiveTransition:(_UINavigationInteractiveTransitionBase *)interactiveTransition;
620 - (BOOL)shouldBeginInteractiveTransition:(_UINavigationInteractiveTransitionBase *)interactiveTransition;
621 - (BOOL)interactiveTransition:(_UINavigationInteractiveTransitionBase *)interactiveTransition gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;
622 - (BOOL)interactiveTransition:(_UINavigationInteractiveTransitionBase *)interactiveTransition gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch;
623 - (UIPanGestureRecognizer *)gestureRecognizerForInteractiveTransition:(_UINavigationInteractiveTransitionBase *)interactiveTransition WithTarget:(id)target action:(SEL)action;
624 @end
625
626 @interface UIWindow (Details)
627 + (mach_port_t)_synchronizeDrawingAcrossProcesses;
628 @end
629
630 @interface UIWebScrollView : UIScrollView
631 @end
632
633 @interface UIWebTiledView : UIView
634 @end
635
636 @class WAKWindow;
637
638 @interface UIWebTiledView (Details)
639 - (void)setWAKWindow:(WAKWindow *)window;
640 @end
641
642 @interface UIWebDocumentView : UIWebTiledView
643 @end
644
645 typedef enum {
646     UIEveryDocumentMask = 0xFFFFFF,
647 } UIDocumentMask;
648
649 @interface UIWebDocumentView (Details)
650 - (void)setDelegate:(id)delegate;
651 - (void)setAutoresizes:(BOOL)flag;
652 - (void)setMinimumSize:(CGSize)aSize;
653 - (void)setInitialScale:(float)aScale forDocumentTypes:(UIDocumentMask)aDocumentMask;
654 - (void)setViewportSize:(CGSize)aSize forDocumentTypes:(UIDocumentMask)aDocumentMask;
655 - (void)setMinimumScale:(float)aScale forDocumentTypes:(UIDocumentMask)aDocumentMask;
656 - (void)setMaximumScale:(float)aScale forDocumentTypes:(UIDocumentMask)aDocumentMask;
657 @end
658
659 @interface UIWebBrowserView : UIWebDocumentView
660 @end
661
662 @class WebView;
663
664 @interface UIWebBrowserView (Details)
665 - (WebView *)webView;
666 - (void)setPaused:(BOOL)paused;
667 - (void)sendScrollEventIfNecessaryWasUserScroll:(BOOL)userScroll;
668 @property (nonatomic) BOOL inputViewObeysDOMFocus;
669 @end
670
671 @interface UIDocumentMenuViewController (Details)
672 @property (nonatomic, assign, setter = _setIgnoreApplicationEntitlementForImport:, getter = _ignoreApplicationEntitlementForImport) BOOL _ignoreApplicationEntitlementForImport;
673 @end
674
675 #endif // USE(APPLE_INTERNAL_SDK)
676
677 @interface UIView (IPI)
678 - (UIScrollView *)_scroller;
679 - (CGPoint)accessibilityConvertPointFromSceneReferenceCoordinates:(CGPoint)point;
680 - (CGRect)accessibilityConvertRectToSceneReferenceCoordinates:(CGRect)rect;
681 @end
682
683 WTF_EXTERN_C_BEGIN
684
685 BOOL UIKeyboardEnabledInputModesAllowOneToManyShortcuts();
686 BOOL UIKeyboardEnabledInputModesAllowChineseTransliterationForText(NSString *);
687 BOOL UIKeyboardCurrentInputModeAllowsChineseOrJapaneseReanalysisForText(NSString *);
688
689 extern const float UITableCellDefaultFontSize;
690 extern const float UITableViewCellDefaultFontSize;
691
692 extern NSString * const UIWindowDidMoveToScreenNotification;
693 extern NSString * const UIWindowDidRotateNotification;
694 extern NSString * const UIWindowNewScreenUserInfoKey;
695 extern NSString * const UIWindowWillRotateNotification;
696
697 extern UIApplication *UIApp;
698 void _UIApplicationLoadWebKit(void);
699 BOOL _UIApplicationUsesLegacyUI(void);
700
701 void UIImageDataWriteToSavedPhotosAlbum(NSData *imageData, id completionTarget, SEL completionSelector, void *contextInfo);
702
703 UIImage* _UIImageGetWebKitPhotoLibraryIcon(void);
704 UIImage* _UIImageGetWebKitTakePhotoOrVideoIcon(void);
705
706 extern const float UIWebViewGrowsAndShrinksToFitHeight;
707 extern const float UIWebViewScalesToFitScale;
708 extern const float UIWebViewStandardViewportWidth;
709
710 WTF_EXTERN_C_END