b5c3e34c21cc09dc0cd3ea8c4d7aff2e58fb45db
[WebKit-https.git] / Source / WebKit / Platform / spi / ios / UIKitSPI.h
1 /*
2  * Copyright (C) 2014-2016 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/UIBlurEffect_Private.h>
34 #import <UIKit/UICalloutBar.h>
35 #import <UIKit/UIColorEffect.h>
36 #import <UIKit/UIDatePicker_Private.h>
37 #import <UIKit/UIDevice_Private.h>
38 #import <UIKit/UIDocumentMenuViewController_Private.h>
39 #import <UIKit/UIDocumentPasswordView.h>
40 #import <UIKit/UIFont_Private.h>
41 #import <UIKit/UIGeometry_Private.h>
42 #import <UIKit/UIGestureRecognizer_Private.h>
43 #import <UIKit/UIImagePickerController_Private.h>
44 #import <UIKit/UIImage_Private.h>
45 #import <UIKit/UIInterface_Private.h>
46 #import <UIKit/UIKeyboardImpl.h>
47 #import <UIKit/UIKeyboardInputModeController.h>
48 #import <UIKit/UIKeyboardIntl.h>
49 #import <UIKit/UIKeyboard_Private.h>
50 #import <UIKit/UILongPressGestureRecognizer_Private.h>
51 #import <UIKit/UIPeripheralHost.h>
52 #import <UIKit/UIPeripheralHost_Private.h>
53 #import <UIKit/UIPickerContentView_Private.h>
54 #import <UIKit/UIPickerView_Private.h>
55 #import <UIKit/UIPopoverPresentationController_Private.h>
56 #import <UIKit/UIPresentationController_Private.h>
57 #import <UIKit/UIResponder_Private.h>
58 #import <UIKit/UIScrollView_Private.h>
59 #import <UIKit/UIStringDrawing_Private.h>
60 #import <UIKit/UITableViewCell_Private.h>
61 #import <UIKit/UITapGestureRecognizer_Private.h>
62 #import <UIKit/UITextChecker_Private.h>
63 #import <UIKit/UITextEffectsWindow.h>
64 #import <UIKit/UITextInput_Private.h>
65 #import <UIKit/UITextInteractionAssistant_Private.h>
66 #import <UIKit/UIViewControllerTransitioning_Private.h>
67 #import <UIKit/UIViewController_Private.h>
68 #import <UIKit/UIViewController_ViewService.h>
69 #import <UIKit/UIView_Private.h>
70 #import <UIKit/UIVisualEffect_Private.h>
71 #import <UIKit/UIWKSelectionAssistant.h>
72 #import <UIKit/UIWKTextInteractionAssistant.h>
73 #import <UIKit/UIWebBrowserView.h>
74 #import <UIKit/UIWebDocumentView.h>
75 #import <UIKit/UIWebFormAccessory.h>
76 #import <UIKit/UIWebGeolocationPolicyDecider.h>
77 #import <UIKit/UIWebScrollView.h>
78 #import <UIKit/UIWebTiledView.h>
79 #import <UIKit/UIWebTouchEventsGestureRecognizer.h>
80 #import <UIKit/UIWindow_Private.h>
81 #import <UIKit/_UIApplicationRotationFollowing.h>
82 #import <UIKit/_UIBackdropViewSettings.h>
83 #import <UIKit/_UIBackdropView_Private.h>
84 #import <UIKit/_UIHighlightView.h>
85 #import <UIKit/_UINavigationInteractiveTransition.h>
86 #import <UIKit/_UINavigationParallaxTransition.h>
87
88 #if HAVE(LINK_PREVIEW)
89 #import <UIKit/UIPreviewItemController.h>
90 #endif
91
92 #if ENABLE(DRAG_SUPPORT)
93 #import <UIKit/NSItemProvider+UIKitAdditions_Private.h>
94 #endif
95
96 #if ENABLE(DRAG_SUPPORT)
97 #import <UIKit/UIDragInteraction.h>
98 #import <UIKit/UIDragInteraction_Private.h>
99 #import <UIKit/UIDragItem_Private.h>
100 #import <UIKit/UIDragPreviewParameters.h>
101 #import <UIKit/UIDragPreview_Private.h>
102 #import <UIKit/UIDragSession.h>
103 #import <UIKit/UIDragging.h>
104 #import <UIKit/UIDropInteraction.h>
105 #import <UIKit/UIPreviewInteraction.h>
106 #import <UIKit/UIURLDragPreviewView.h>
107 #import <UIKit/_UITextDragCaretView.h>
108 #endif
109
110 #else // USE(APPLE_INTERNAL_SDK)
111
112 #if ENABLE(DRAG_SUPPORT)
113 #import <UIKit/NSItemProvider+UIKitAdditions.h>
114 #endif
115
116 #if HAVE(LINK_PREVIEW)
117 typedef NS_ENUM(NSInteger, UIPreviewItemType) {
118     UIPreviewItemTypeNone,
119     UIPreviewItemTypeClientCustom,
120     UIPreviewItemTypeLink,
121     UIPreviewItemTypeImage,
122     UIPreviewItemTypeText,
123     UIPreviewItemTypeAttachment,
124 };
125
126 @class UIPreviewItemController;
127
128 @protocol UIPreviewItemDelegate <NSObject>
129 - (NSDictionary *)_dataForPreviewItemController:(UIPreviewItemController *)controller atPosition:(CGPoint)position type:(UIPreviewItemType *)type;
130 @optional
131 - (BOOL)_interactionShouldBeginFromPreviewItemController:(UIPreviewItemController *)controller forPosition:(CGPoint)position;
132 - (void)_interactionStartedFromPreviewItemController:(UIPreviewItemController *)controller;
133 - (void)_interactionStoppedFromPreviewItemController:(UIPreviewItemController *)controller;
134 - (UIViewController *)_presentedViewControllerForPreviewItemController:(UIPreviewItemController *)controller;
135 - (void)_previewItemController:(UIPreviewItemController *)controller didDismissPreview:(UIViewController *)viewController committing:(BOOL)committing;
136 - (void)_previewItemController:(UIPreviewItemController *)controller commitPreview:(UIViewController *)viewController;
137 - (void)_previewItemControllerDidCancelPreview:(UIPreviewItemController *)controller;
138 - (UIImage *)_presentationSnapshotForPreviewItemController:(UIPreviewItemController *)controller;
139 - (NSArray *)_presentationRectsForPreviewItemController:(UIPreviewItemController *)controller;
140 - (CGRect)_presentationRectForPreviewItemController:(UIPreviewItemController *)controller;
141 @end
142
143 @interface UIPreviewItemController : NSObject
144 - (instancetype)initWithView:(UIView *)view;
145 @property (assign, nonatomic) id<UIPreviewItemDelegate> delegate;
146 @property (assign, nonatomic, readonly) UIPreviewItemType type;
147 @property (strong, nonatomic, readonly) NSDictionary *previewData;
148 @property (strong, nonatomic, readonly) UIGestureRecognizer *presentationGestureRecognizer;
149 @property (strong, nonatomic, readonly) UIGestureRecognizer *presentationSecondaryGestureRecognizer;
150 @end
151 #endif
152
153 @interface UIAlertController ()
154 - (void)_addActionWithTitle:(NSString *)title style:(UIAlertActionStyle)style handler:(void (^)(void))handler;
155 - (void)_addActionWithTitle:(NSString *)title style:(UIAlertActionStyle)style handler:(void (^)(void))handler shouldDismissHandler:(BOOL (^)(void))shouldDismissHandler;
156 @property (nonatomic) UIAlertControllerStyle preferredStyle;
157 @end
158
159 WTF_EXTERN_C_BEGIN
160 typedef struct __IOHIDEvent* IOHIDEventRef;
161 typedef struct __GSKeyboard* GSKeyboardRef;
162 WTF_EXTERN_C_END
163
164 @interface UIApplication ()
165 - (UIInterfaceOrientation)interfaceOrientation;
166 - (void)_cancelAllTouches;
167 - (CGFloat)statusBarHeight;
168 - (BOOL)isSuspendedUnderLock;
169 - (void)_enqueueHIDEvent:(IOHIDEventRef)event;
170 - (void)_handleHIDEvent:(IOHIDEventRef)event;
171 - (void)handleKeyUIEvent:(UIEvent *)event;
172 @end
173
174 typedef NS_ENUM(NSInteger, UIDatePickerPrivateMode)  {
175     UIDatePickerModeYearAndMonth = 4269,
176 };
177
178 @interface UIDatePicker ()
179 @property (nonatomic, readonly, getter=_contentWidth) CGFloat contentWidth;
180 @end
181
182 @interface UIDevice ()
183 - (void)setOrientation:(UIDeviceOrientation)orientation animated:(BOOL)animated;
184 @property (nonatomic, readonly, retain) NSString *buildVersion;
185 @end
186
187 typedef enum {
188     kUIKeyboardInputRepeat                 = 1 << 0,
189     kUIKeyboardInputPopupVariant           = 1 << 1,
190     kUIKeyboardInputMultitap               = 1 << 2,
191     kUIKeyboardInputSkipCandidateSelection = 1 << 3,
192     kUIKeyboardInputDeadKey                = 1 << 4,
193     kUIKeyboardInputModifierFlagsChanged   = 1 << 5,
194     kUIKeyboardInputFlick                  = 1 << 6,
195     kUIKeyboardInputPreProcessed           = 1 << 7,
196 } UIKeyboardInputFlags;
197
198 @interface UIEvent ()
199 - (void *)_hidEvent;
200 - (NSString *)_unmodifiedInput;
201 - (NSString *)_modifiedInput;
202 - (BOOL)_isKeyDown;
203 @end
204
205 typedef enum {
206     UIFontTraitPlain = 0,
207     UIFontTraitItalic = 1 << 0,
208     UIFontTraitBold = 1 << 1,
209 } UIFontTrait;
210
211 @interface UIFont ()
212 + (UIFont *)fontWithFamilyName:(NSString *)familyName traits:(UIFontTrait)traits size:(CGFloat)fontSize;
213 - (UIFontTrait)traits;
214 @end
215
216 typedef enum {
217     UIAllCorners = 0xFF,
218 } UIRectCorners;
219
220 @interface UIImagePickerController ()
221 @property (nonatomic, setter=_setAllowsMultipleSelection:) BOOL _allowsMultipleSelection;
222 @end
223
224 @interface UIImage ()
225 - (id)initWithCGImage:(CGImageRef)CGImage imageOrientation:(UIImageOrientation)imageOrientation;
226 @end
227
228 @interface UIKeyCommand ()
229 @property (nonatomic, readonly) UIEvent *_triggeringEvent;
230 @end
231
232 @protocol UIKeyboardImplGeometryDelegate
233 @property (nonatomic, readwrite, getter=isMinimized) BOOL minimized;
234 - (void)prepareForImplBoundsHeightChange:(CGFloat)endDelta suppressNotification:(BOOL)suppressNotification;
235 - (void)implBoundsHeightChangeDone:(CGFloat)endDelta suppressNotification:(BOOL)suppressNotification;
236 - (BOOL)shouldSaveMinimizationState;
237 - (BOOL)canDismiss;
238 - (BOOL)isActive;
239 @end
240
241 @protocol UIKeyboardCandidateListDelegate <NSObject>
242 @optional
243 - (void)setCandidateList:(id)candidateList updateCandidateView:(BOOL)updateCandidateView;
244 - (void)candidateListAcceptCandidate:(id)candidateList;
245 - (void)candidateListSelectionDidChange:(id)candidateList;
246 - (void)candidateListShouldBeDismissed:(id)candidateList;
247 @end
248
249 @interface UIKeyboard : UIView <UIKeyboardImplGeometryDelegate>
250 @end
251
252 @interface UIKeyboard ()
253 + (CGSize)defaultSizeForInterfaceOrientation:(UIInterfaceOrientation)orientation;
254 - (void)activate;
255 - (void)geometryChangeDone:(BOOL)keyboardVisible;
256 - (void)prepareForGeometryChange;
257 + (BOOL)isInHardwareKeyboardMode;
258 + (void)removeAllDynamicDictionaries;
259 @end
260
261 @interface UIKeyboardImpl : UIView <UIKeyboardCandidateListDelegate>
262 @end
263
264 @interface UIKeyboardImpl ()
265 + (UIKeyboardImpl *)activeInstance;
266 + (UIKeyboardImpl *)sharedInstance;
267 + (CGSize)defaultSizeForInterfaceOrientation:(UIInterfaceOrientation)orientation;
268 - (void)addInputString:(NSString *)string withFlags:(NSUInteger)flags;
269 - (void)addInputString:(NSString *)string withFlags:(NSUInteger)flags withInputManagerHint:(NSString *)hint;
270 - (BOOL)autocorrectSpellingEnabled;
271 - (void)deleteFromInput;
272 - (void)deleteFromInputWithFlags:(NSUInteger)flags;
273 - (void)replaceText:(id)replacement;
274 @property (nonatomic, readwrite, retain) UIResponder <UIKeyInput> *delegate;
275 @end
276
277 @interface UILongPressGestureRecognizer ()
278 @property (nonatomic) CFTimeInterval delay;
279 @property (nonatomic, readonly) CGPoint startPoint;
280 @property (nonatomic, assign, setter=_setRequiresQuietImpulse:) BOOL _requiresQuietImpulse;
281 @end
282
283 @interface _UIWebHighlightLongPressGestureRecognizer : UILongPressGestureRecognizer
284 @end
285
286 @interface _UIWebHighlightLongPressGestureRecognizer ()
287 - (void)cancel;
288 @end
289
290 @interface UIPeripheralHost : NSObject <UIGestureRecognizerDelegate>
291 @end
292
293 @class UIKeyboardRotationState;
294
295 @interface UIPeripheralHost ()
296 + (UIPeripheralHost *)sharedInstance;
297 + (UIPeripheralHost *)activeInstance;
298 + (CGRect)visiblePeripheralFrame;
299 - (BOOL)isOnScreen;
300 - (UIKeyboardRotationState *)rotationState;
301 @end
302
303 @interface UIPickerContentView : UIView
304 @end
305
306 @interface UIPickerContentView ()
307 +(CGFloat)_checkmarkOffset;
308 -(CGFloat)labelWidthForBounds:(CGRect)bounds;
309 @property (nonatomic, getter=isChecked) BOOL checked;
310 @property (nonatomic, readonly) UILabel *titleLabel;
311 @end
312
313 @interface UIPickerView ()
314 + (CGSize)defaultSizeForCurrentOrientation;
315 - (void)_setUsesCheckedSelection:(BOOL)usesCheckedSelection;
316 @property (nonatomic, setter=_setMagnifierEnabled:) BOOL _magnifierEnabled;
317 @end
318
319 @interface UIResponder ()
320 - (void)_handleKeyUIEvent:(UIEvent *)event;
321 - (void)_wheelChangedWithEvent:(UIEvent *)event;
322 @end
323
324 @class FBSDisplayConfiguration;
325 @interface UIScreen ()
326 - (void)_setScale:(CGFloat)scale;
327 @property (nonatomic, readonly, retain) FBSDisplayConfiguration *displayConfiguration;
328 @end
329
330 typedef NS_ENUM(NSInteger, UIScrollViewIndicatorInsetAdjustmentBehavior) {
331     UIScrollViewIndicatorInsetAdjustmentAutomatic,
332     UIScrollViewIndicatorInsetAdjustmentAlways,
333     UIScrollViewIndicatorInsetAdjustmentNever
334 };
335
336 @interface UIScrollView ()
337 - (void)_stopScrollingAndZoomingAnimations;
338 - (void)_zoomToCenter:(CGPoint)center scale:(CGFloat)scale duration:(CFTimeInterval)duration force:(BOOL)force;
339 - (void)_zoomToCenter:(CGPoint)center scale:(CGFloat)scale duration:(CFTimeInterval)duration;
340 - (double)_horizontalVelocity;
341 - (double)_verticalVelocity;
342 @property (nonatomic, getter=isZoomEnabled) BOOL zoomEnabled;
343 @property (nonatomic, readonly, getter=_isAnimatingZoom) BOOL isAnimatingZoom;
344 @property (nonatomic, readonly, getter=_isAnimatingScroll) BOOL isAnimatingScroll;
345 @property (nonatomic) CGFloat horizontalScrollDecelerationFactor;
346 @property (nonatomic) CGFloat verticalScrollDecelerationFactor;
347 @property (nonatomic, readonly) BOOL _isInterruptingDeceleration;
348 @property (nonatomic, getter=_contentScrollInset, setter=_setContentScrollInset:) UIEdgeInsets contentScrollInset;
349 @property (nonatomic, getter=_indicatorInsetAdjustmentBehavior, setter=_setIndicatorInsetAdjustmentBehavior:) UIScrollViewIndicatorInsetAdjustmentBehavior indicatorInsetAdjustmentBehavior;
350 @property (nonatomic, readonly) UIEdgeInsets _systemContentInset;
351 @property (nonatomic, readonly) UIEdgeInsets _effectiveContentInset;
352 @end
353
354 @interface NSString (UIKitDetails)
355 - (CGSize)_legacy_sizeWithFont:(UIFont *)font forWidth:(CGFloat)width lineBreakMode:(NSLineBreakMode)lineBreakMode;
356 - (CGSize)_legacy_sizeWithFont:(UIFont *)font minFontSize:(CGFloat)minFontSize actualFontSize:(CGFloat *)actualFontSize forWidth:(CGFloat)width lineBreakMode:(NSLineBreakMode)lineBreakMode;
357 @end
358
359 @interface UITapGestureRecognizer ()
360 @property (nonatomic, getter=_allowableSeparation, setter=_setAllowableSeparation:) CGFloat allowableSeparation;
361 @property (nonatomic, readonly) CGPoint location;
362 @property (nonatomic) CGFloat allowableMovement;
363 @property (nonatomic, readonly) CGPoint centroid;
364 @end
365
366 @class WebEvent;
367
368 typedef enum {
369     UITextShortcutConversionTypeDefault = 0,
370     UITextShortcutConversionTypeNo = 1,
371     UITextShortcutConversionTypeYes = 2,
372 } UITextShortcutConversionType;
373
374 @protocol UITextInputTraits_Private <NSObject, UITextInputTraits>
375 - (void)takeTraitsFrom:(id <UITextInputTraits>)traits;
376 @optional
377 @property (nonatomic) UITextShortcutConversionType shortcutConversionType;
378 @property (nonatomic, retain) UIColor *insertionPointColor;
379 @property (nonatomic, retain) UIColor *selectionBarColor;
380 @property (nonatomic, retain) UIColor *selectionHighlightColor;
381 @end
382
383 @class UITextInputArrowKeyHistory;
384
385 @protocol UITextInputPrivate <UITextInput, UITextInputTokenizer, UITextInputTraits_Private>
386 @optional
387 - (BOOL)requiresKeyEvents;
388 - (NSArray *)metadataDictionariesForDictationResults;
389 - (UIColor *)textColorForCaretSelection;
390 - (UIFont *)fontForCaretSelection;
391 - (UIView *)automaticallySelectedOverlay;
392 - (void)handleKeyWebEvent:(WebEvent *)event;
393 - (void)insertDictationResult:(NSArray *)dictationResult withCorrectionIdentifier:(id)correctionIdentifier;
394 - (void)replaceRangeWithTextWithoutClosingTyping:(UITextRange *)range replacementText:(NSString *)text;
395 - (void)setBottomBufferHeight:(CGFloat)bottomBuffer;
396 #if USE(UIKIT_KEYBOARD_ADDITIONS)
397 - (void)modifierFlagsDidChangeFrom:(UIKeyModifierFlags)oldFlags to:(UIKeyModifierFlags)newFlags;
398 #endif
399 @property (nonatomic) UITextGranularity selectionGranularity;
400 @required
401 - (BOOL)hasContent;
402 - (BOOL)hasSelection;
403 - (void)selectAll;
404 @end
405
406 @interface UITextInputTraits : NSObject <UITextInputTraits, UITextInputTraits_Private, NSCopying>
407 - (void)_setColorsToMatchTintColor:(UIColor *)tintColor;
408 @end
409
410 @interface UITextInteractionAssistant : NSObject
411 @end
412
413 @interface UITextInteractionAssistant ()
414 - (void)activateSelection;
415 - (void)deactivateSelection;
416 - (void)didEndScrollingOverflow;
417 - (void)selectionChanged;
418 - (void)setGestureRecognizers;
419 - (void)willStartScrollingOverflow;
420 @end
421
422 @interface UITextSuggestion : NSObject
423 + (instancetype)textSuggestionWithInputText:(NSString *)inputText;
424 @property (nonatomic, copy, readonly) NSString *inputText;
425 @end
426
427 @protocol UITextInputSuggestionDelegate <UITextInputDelegate>
428 - (void)setSuggestions:(NSArray <UITextSuggestion*> *)suggestions;
429 @end
430
431 @interface UIViewController ()
432 + (UIViewController *)_viewControllerForFullScreenPresentationFromView:(UIView *)view;
433 + (UIViewController *)viewControllerForView:(UIView *)view;
434 @end
435
436 @interface UIViewController (ViewService)
437 - (pid_t)_hostProcessIdentifier;
438 @property (readonly) NSString *_hostApplicationBundleIdentifier;
439 @end
440
441 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
442 @interface NSURL ()
443 @property (nonatomic, copy, setter=_setTitle:) NSString *_title;
444 @end
445 #endif
446
447 @protocol UIViewControllerContextTransitioningEx <UIViewControllerContextTransitioning>
448 - (void)__runAlongsideAnimations;
449 - (void)_interactivityDidChange:(BOOL)isInteractive;
450 @property (nonatomic, assign, setter=_setAllowUserInteraction:, getter=_allowUserInteraction) BOOL _allowUserInteraction;
451 @property (nonatomic, assign, setter=_setPercentOffset:) CGFloat _percentOffset;
452 @end
453
454 @interface _UIViewControllerTransitionContext : NSObject <UIViewControllerContextTransitioningEx>
455 @end
456
457 // FIXME: Separate the parts we are simply re-declaring from the ones we are overriding.
458 @interface _UIViewControllerTransitionContext (Details)
459 - (void) _setTransitionIsInFlight:(BOOL)flag;
460 @property (nonatomic, assign, setter=_setAllowUserInteraction:, getter=_allowUserInteraction) BOOL _allowUserInteraction;
461 @property (nonatomic, assign, setter=_setAnimator:) id <UIViewControllerAnimatedTransitioning> _animator;
462 @property (nonatomic, assign, setter=_setContainerView:) UIView *containerView;
463 @property (nonatomic, assign, setter=_setInteractor:) id <UIViewControllerInteractiveTransitioning> _interactor;
464 @property (nonatomic, assign, setter=_setPercentOffset:) CGFloat _percentOffset;
465 @property (nonatomic, copy, setter=_setCompletionHandler:)  void (^_completionHandler)(_UIViewControllerTransitionContext *context, BOOL transitionCompleted);
466 @property (nonatomic, retain, setter=_setContainerViews:) NSArray *_containerViews;
467 @end
468
469 @interface _UIViewControllerOneToOneTransitionContext : _UIViewControllerTransitionContext
470 @end
471
472 @interface _UIViewControllerOneToOneTransitionContext ()
473 @property (nonatomic, assign, setter=_setFromEndFrame:) CGRect fromEndFrame;
474 @property (nonatomic, assign, setter=_setFromStartFrame:) CGRect fromStartFrame;
475 @property (nonatomic, assign, setter=_setToEndFrame:) CGRect toEndFrame;
476 @property (nonatomic, assign, setter=_setToStartFrame:) CGRect toStartFrame;
477 @property (nonatomic, retain, setter=_setFromViewController:) UIViewController *fromViewController;
478 @property (nonatomic, retain, setter=_setToViewController:) UIViewController *toViewController;
479 @end
480
481 @protocol UIViewControllerAnimatedTransitioningEx <UIViewControllerAnimatedTransitioning>
482 - (BOOL)interactionAborted;
483 - (UINavigationControllerOperation) operation;
484 - (UIPercentDrivenInteractiveTransition *)interactionController;
485 - (void)setInteractionAborted:(BOOL)aborted;
486 - (void)setInteractionController:(UIPercentDrivenInteractiveTransition *)controller;
487 - (void)setOperation:(UINavigationControllerOperation)operation;
488 @optional
489 - (UIWindow *)window;
490 @end
491
492 typedef NS_ENUM (NSInteger, _UIBackdropMaskViewFlags) {
493     _UIBackdropMaskViewNone = 0,
494     _UIBackdropMaskViewGrayscaleTint = 1 << 0,
495     _UIBackdropMaskViewColorTint = 1 << 1,
496     _UIBackdropMaskViewFilters = 1 << 2,
497     _UIBackdropMaskViewAll = _UIBackdropMaskViewGrayscaleTint | _UIBackdropMaskViewColorTint | _UIBackdropMaskViewFilters,
498 };
499
500 @interface UIView ()
501 + (BOOL)_isInAnimationBlock;
502 - (CGSize)size;
503 - (void)setFrameOrigin:(CGPoint)origin;
504 - (void)setSize:(CGSize)size;
505 @property (nonatomic, assign, setter=_setBackdropMaskViewFlags:) NSInteger _backdropMaskViewFlags;
506 - (void)_populateArchivedSubviews:(NSMutableSet *)encodedViews;
507 - (void)safeAreaInsetsDidChange;
508 @property (nonatomic, setter=_setContinuousCornerRadius:) CGFloat _continuousCornerRadius;
509 - (void)insertSubview:(UIView *)view above:(UIView *)sibling;
510 - (void)viewWillMoveToSuperview:(UIView *)newSuperview;
511 - (CGSize)convertSize:(CGSize)size toView:(UIView *)view;
512 - (void)_removeAllAnimations:(BOOL)includeSubviews;
513 - (UIColor *)_inheritedInteractionTintColor;
514 @end
515
516 @interface UIWebSelectionView : UIView
517 @end
518
519 @interface UIWebSelectionAssistant : NSObject <UIGestureRecognizerDelegate>
520 @end
521
522 @protocol UISelectionInteractionAssistant
523 - (void)showSelectionCommands;
524 @end
525
526 @interface UIWebSelectionAssistant ()
527 - (BOOL)isSelectionGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer;
528 - (id)initWithView:(UIView *)view;
529 - (void)clearSelection;
530 - (void)didEndScrollingOrZoomingPage;
531 - (void)didEndScrollingOverflow;
532 - (void)resignedFirstResponder;
533 - (void)selectionChanged;
534 - (void)setGestureRecognizers;
535 - (void)willStartScrollingOrZoomingPage;
536 - (void)willStartScrollingOverflow;
537 #if !PLATFORM(IOSMAC)
538 @property (nonatomic, retain) UIWebSelectionView *selectionView;
539 #endif
540 @property (nonatomic, readonly) CGRect selectionFrame;
541 @end
542
543 typedef NS_ENUM(NSInteger, UIWKSelectionTouch) {
544     UIWKSelectionTouchStarted = 0,
545     UIWKSelectionTouchMoved = 1,
546     UIWKSelectionTouchEnded = 2,
547     UIWKSelectionTouchEndedMovingForward = 3,
548     UIWKSelectionTouchEndedMovingBackward = 4,
549     UIWKSelectionTouchEndedNotMoving = 5,
550 };
551
552 typedef NS_ENUM(NSInteger, UIWKSelectionFlags) {
553     UIWKNone = 0,
554     UIWKWordIsNearTap = 1,
555     UIWKPhraseBoundaryChanged = 4,
556 };
557
558 typedef NS_ENUM(NSInteger, UIWKGestureType) {
559     UIWKGestureLoupe = 0,
560     UIWKGestureOneFingerTap = 1,
561     UIWKGestureTapAndAHalf = 2,
562     UIWKGestureDoubleTap = 3,
563     UIWKGestureTapAndHalf = 4,
564     UIWKGestureDoubleTapInUneditable = 5,
565     UIWKGestureOneFingerTapInUneditable = 6,
566     UIWKGestureOneFingerTapSelectsAll = 7,
567     UIWKGestureOneFingerDoubleTap = 8,
568     UIWKGestureOneFingerTripleTap = 9,
569     UIWKGestureTwoFingerSingleTap = 10,
570     UIWKGestureTwoFingerRangedSelectGesture = 11,
571     UIWKGestureTapOnLinkWithGesture = 12,
572     UIWKGestureMakeWebSelection = 13,
573     UIWKGesturePhraseBoundary = 14,
574 };
575
576 @interface UIWKSelectionAssistant : UIWebSelectionAssistant
577 @end
578
579 @interface UIWKSelectionAssistant ()
580 - (BOOL)shouldHandleSingleTapAtPoint:(CGPoint)point;
581 - (void)selectionChangedWithGestureAt:(CGPoint)point withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)gestureState withFlags:(UIWKSelectionFlags)flags;
582 - (void)selectionChangedWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch withFlags:(UIWKSelectionFlags)flags;
583 - (void)showDictionaryFor:(NSString *)selectedTerm fromRect:(CGRect)presentationRect;
584 - (void)showShareSheetFor:(NSString *)selectedTerm fromRect:(CGRect)presentationRect;
585 - (void)showTextServiceFor:(NSString *)selectedTerm fromRect:(CGRect)presentationRect;
586 - (void)lookup:(NSString *)textWithContext withRange:(NSRange)range fromRect:(CGRect)presentationRect;
587 @property (nonatomic, readonly) UILongPressGestureRecognizer *selectionLongPressRecognizer;
588 @end
589
590 @interface UIWKAutocorrectionRects : NSObject
591 @end
592
593 @interface UIWKAutocorrectionRects (UIWKAutocorrectionRectsDetails)
594 @property (nonatomic, assign) CGRect firstRect;
595 @property (nonatomic, assign) CGRect lastRect;
596 @end
597
598 @interface UIWKAutocorrectionContext : NSObject
599 @end
600
601 @interface UIWKAutocorrectionContext (UIWKAutocorrectionContextDetails)
602 @property (nonatomic, copy) NSString *contextBeforeSelection;
603 @property (nonatomic, copy) NSString *selectedText;
604 @property (nonatomic, copy) NSString *contextAfterSelection;
605 @property (nonatomic, copy) NSString *markedText;
606 @property (nonatomic, assign) NSRange rangeInMarkedText;
607 @end
608
609 @interface UIWKTextInteractionAssistant : UITextInteractionAssistant <UIResponderStandardEditActions>
610 @end
611
612 @interface UIWKTextInteractionAssistant ()
613 - (void)selectionChangedWithGestureAt:(CGPoint)point withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)gestureState withFlags:(UIWKSelectionFlags)flags;
614 - (void)showDictionaryFor:(NSString *)selectedTerm fromRect:(CGRect)presentationRect;
615 - (void)selectionChangedWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch withFlags:(UIWKSelectionFlags)flags;
616 - (void)showTextStyleOptions;
617 - (void)hideTextStyleOptions;
618 - (void)lookup:(NSString *)textWithContext withRange:(NSRange)range fromRect:(CGRect)presentationRect;
619 - (void)showShareSheetFor:(NSString *)selectedTerm fromRect:(CGRect)presentationRect;
620 - (void)showTextServiceFor:(NSString *)selectedTerm fromRect:(CGRect)presentationRect;
621 - (void)scheduleReplacementsForText:(NSString *)text;
622 - (void)scheduleChineseTransliterationForText:(NSString *)text;
623
624 @property (nonatomic, readonly, assign) UILongPressGestureRecognizer *forcePressGesture;
625 @property (nonatomic, readonly, assign) UILongPressGestureRecognizer *loupeGesture;
626 @property (nonatomic, readonly, assign) UITapGestureRecognizer *singleTapGesture;
627 @end
628
629 @protocol UIWKInteractionViewProtocol
630 - (void)changeSelectionWithGestureAt:(CGPoint)point withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)state;
631 - (void)changeSelectionWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch baseIsStart:(BOOL)baseIsStart withFlags:(UIWKSelectionFlags)flags;
632 - (void)changeSelectionWithTouchesFrom:(CGPoint)from to:(CGPoint)to withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)gestureState;
633 - (CGRect)textFirstRect;
634 - (CGRect)textLastRect;
635
636 - (void)requestAutocorrectionContextWithCompletionHandler:(void (^)(UIWKAutocorrectionContext *autocorrectionContext))completionHandler;
637
638 - (void)requestAutocorrectionRectsForString:(NSString *)input withCompletionHandler:(void (^)(UIWKAutocorrectionRects *rectsForInput))completionHandler;
639
640 - (void)applyAutocorrection:(NSString *)correction toString:(NSString *)input withCompletionHandler:(void (^)(UIWKAutocorrectionRects *rectsForCorrection))completionHandler;
641
642 - (NSString *)markedText;
643 - (BOOL)hasMarkedText;
644
645 - (BOOL)hasSelectablePositionAtPoint:(CGPoint)point;
646 - (NSArray *)webSelectionRects;
647 - (void)_cancelLongPressGestureRecognizer;
648
649 @optional
650 - (void)clearSelection;
651 - (void)replaceDictatedText:(NSString *)oldText withText:(NSString *)newText;
652 - (void)requestDictationContext:(void (^)(NSString *selectedText, NSString *prefixText, NSString *postfixText))completionHandler;
653 - (BOOL)pointIsNearMarkedText:(CGPoint)point;
654 - (NSString *)selectedText;
655 - (void)replaceText:(NSString *)text withText:(NSString *)word;
656 - (void)selectWordForReplacement;
657 - (BOOL)isReplaceAllowed;
658 - (void)selectWordBackward;
659 - (UIView *)unscaledView;
660 - (CGFloat)inverseScale;
661 - (CGRect)unobscuredContentRect;
662 @end
663
664 @protocol UITextAutoscrolling
665 - (void)startAutoscroll:(CGPoint)point;
666 - (void)cancelAutoscroll;
667 - (void)scrollSelectionToVisible:(BOOL)animated;
668 @end
669
670
671 @protocol UIWebFormAccessoryDelegate;
672
673 @interface UIWebFormAccessory : UIInputView
674 @end
675
676 @interface UIWebFormAccessory ()
677 - (void)hideAutoFillButton;
678 - (void)setClearVisible:(BOOL)flag;
679 - (void)showAutoFillButtonWithTitle:(NSString *)title;
680 @property (nonatomic, retain) UIBarButtonItem *_autofill;
681 @property (nonatomic, assign) id <UIWebFormAccessoryDelegate> delegate;
682
683 @property (nonatomic, assign, getter=isNextEnabled) BOOL nextEnabled;
684 @property (nonatomic, assign, getter=isPreviousEnabled) BOOL previousEnabled;
685 - (id)initWithInputAssistantItem:(UITextInputAssistantItem *)inputAssistantItem;
686 @end
687
688 @protocol UIWebFormAccessoryDelegate
689 - (void)accessoryAutoFill;
690 - (void)accessoryClear;
691 - (void)accessoryDone;
692 - (void)accessoryTab:(BOOL)isNext;
693 @end
694
695 @interface UIWebGeolocationPolicyDecider : NSObject
696 @end
697
698 @interface UIWebGeolocationPolicyDecider ()
699 + (instancetype)sharedPolicyDecider;
700 - (void)decidePolicyForGeolocationRequestFromOrigin:(id)securityOrigin requestingURL:(NSURL *)requestingURL window:(UIWindow *)window listener:(id)listener;
701 @end
702
703 typedef enum {
704     UIWebTouchEventTouchBegin = 0,
705     UIWebTouchEventTouchChange = 1,
706     UIWebTouchEventTouchEnd = 2,
707     UIWebTouchEventTouchCancel = 3,
708 } UIWebTouchEventType;
709
710 typedef enum {
711     UIWebTouchPointTypeDirect = 0,
712     UIWebTouchPointTypeStylus
713 } UIWebTouchPointType;
714
715 struct _UIWebTouchPoint {
716     CGPoint locationInScreenCoordinates;
717     CGPoint locationInDocumentCoordinates;
718     unsigned identifier;
719     UITouchPhase phase;
720 #if __IPHONE_OS_VERSION_MIN_REQUIRED > 100000
721     CGFloat majorRadiusInScreenCoordinates;
722     CGFloat force;
723     CGFloat altitudeAngle;
724     CGFloat azimuthAngle;
725     UIWebTouchPointType touchType;
726 #endif
727 };
728
729 struct _UIWebTouchEvent {
730     UIWebTouchEventType type;
731     NSTimeInterval timestamp;
732     CGPoint locationInScreenCoordinates;
733     CGPoint locationInDocumentCoordinates;
734     CGFloat scale;
735     CGFloat rotation;
736
737     bool inJavaScriptGesture;
738
739     struct _UIWebTouchPoint* touchPoints;
740     unsigned touchPointCount;
741
742     bool isPotentialTap;
743 };
744
745 @interface _UILookupGestureRecognizer : UIGestureRecognizer
746 @end
747
748 @class UIWebTouchEventsGestureRecognizer;
749
750 @protocol UIWebTouchEventsGestureRecognizerDelegate <NSObject>
751 - (BOOL)isAnyTouchOverActiveArea:(NSSet *)touches;
752 @optional
753 - (BOOL)gestureRecognizer:(UIWebTouchEventsGestureRecognizer *)gestureRecognizer shouldIgnoreWebTouchWithEvent:(UIEvent *)event;
754 @end
755
756 @interface UIWebTouchEventsGestureRecognizer : UIGestureRecognizer
757 @end
758
759 @interface UIWebTouchEventsGestureRecognizer ()
760 - (id)initWithTarget:(id)target action:(SEL)action touchDelegate:(id <UIWebTouchEventsGestureRecognizerDelegate>)delegate;
761 - (void)cancel;
762 @property (nonatomic, getter=isDefaultPrevented) BOOL defaultPrevented;
763 @property (nonatomic, readonly) BOOL inJavaScriptGesture;
764 @property (nonatomic, readonly) CGPoint locationInWindow;
765 @property (nonatomic, readonly) UIWebTouchEventType type;
766 @property (nonatomic, readonly) const struct _UIWebTouchEvent *lastTouchEvent;
767 @end
768
769 typedef NS_ENUM(NSInteger, _UIBackdropViewStylePrivate) {
770     _UIBackdropViewStyle_Light = 2020,
771     _UIBackdropViewStyle_Dark = 2030
772 };
773
774 @interface _UIBackdropViewSettings : NSObject
775 @end
776
777 @interface _UIBackdropViewSettings ()
778 + (_UIBackdropViewSettings *)settingsForPrivateStyle:(_UIBackdropViewStylePrivate)style;
779 @property (nonatomic, assign) CGFloat scale;
780 @end
781
782 @interface _UIBackdropView : UIView
783 @end
784
785 @interface _UIBackdropView ()
786 - (instancetype)initWithPrivateStyle:(_UIBackdropViewStylePrivate)style;
787 - (instancetype)initWithSettings:(_UIBackdropViewSettings *)settings;
788 - (instancetype)initWithFrame:(CGRect)frame privateStyle:(_UIBackdropViewStylePrivate)style;
789 @property (nonatomic, strong, readonly) UIView *contentView;
790 @end
791
792 @interface _UIHighlightView : UIView
793 @end
794
795 @interface _UIHighlightView ()
796 - (void)setColor:(UIColor *)aColor;
797 - (void)setCornerRadii:(NSArray *)cornerRadii;
798 - (void)setCornerRadius:(CGFloat)aCornerRadius;
799 - (void)setFrames:(NSArray *)frames boundaryRect:(CGRect)aBoundarRect;
800 - (void)setQuads:(NSArray *)quads boundaryRect:(CGRect)aBoundaryRect;
801 @end
802
803 @interface _UINavigationParallaxTransition : NSObject <UIViewControllerAnimatedTransitioningEx>
804 @end
805
806 @interface _UINavigationParallaxTransition ()
807 - (instancetype) initWithCurrentOperation:(UINavigationControllerOperation)operation;
808 @end
809
810 @protocol _UINavigationInteractiveTransitionBaseDelegate;
811
812 @interface _UINavigationInteractiveTransitionBase : UIPercentDrivenInteractiveTransition <UIGestureRecognizerDelegate>
813 @end
814
815 @interface _UINavigationInteractiveTransitionBase ()
816 - (id)initWithGestureRecognizerView:(UIView *)gestureRecognizerView animator:(id<UIViewControllerAnimatedTransitioning>)animator delegate:(id<_UINavigationInteractiveTransitionBaseDelegate>)delegate;
817 - (void)_completeStoppedInteractiveTransition;
818 @property (nonatomic, weak) UIPanGestureRecognizer *gestureRecognizer;
819 @property (nonatomic, assign) BOOL shouldReverseTranslation;
820 @property (nonatomic, retain) _UINavigationParallaxTransition *animationController;
821 @end
822
823 @protocol _UINavigationInteractiveTransitionBaseDelegate <NSObject>
824 - (void)startInteractiveTransition:(_UINavigationInteractiveTransitionBase *)interactiveTransition;
825 - (BOOL)shouldBeginInteractiveTransition:(_UINavigationInteractiveTransitionBase *)interactiveTransition;
826 - (BOOL)interactiveTransition:(_UINavigationInteractiveTransitionBase *)interactiveTransition gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;
827 - (BOOL)interactiveTransition:(_UINavigationInteractiveTransitionBase *)interactiveTransition gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch;
828 - (UIPanGestureRecognizer *)gestureRecognizerForInteractiveTransition:(_UINavigationInteractiveTransitionBase *)interactiveTransition WithTarget:(id)target action:(SEL)action;
829 @end
830
831 @class BKSAnimationFenceHandle;
832
833 @interface UIWindow ()
834 + (BKSAnimationFenceHandle *)_synchronizedDrawingFence;
835 + (mach_port_t)_synchronizeDrawingAcrossProcesses;
836 - (void)_setWindowResolution:(CGFloat)resolution displayIfChanged:(BOOL)displayIfChanged;
837 - (uint32_t)_contextId;
838 @end
839
840 @interface UIWebScrollView : UIScrollView
841 @end
842
843 @interface UIWebTiledView : UIView
844 @end
845
846 @class WAKWindow;
847
848 @interface UIWebTiledView ()
849 - (void)setWAKWindow:(WAKWindow *)window;
850 @end
851
852 @interface UIWebDocumentView : UIWebTiledView
853 @end
854
855 typedef enum {
856     UIEveryDocumentMask = 0xFFFFFF,
857 } UIDocumentMask;
858
859 @interface UIWebDocumentView ()
860 - (void)setDelegate:(id)delegate;
861 - (void)setAutoresizes:(BOOL)flag;
862 - (void)setMinimumSize:(CGSize)aSize;
863 - (void)setInitialScale:(float)aScale forDocumentTypes:(UIDocumentMask)aDocumentMask;
864 - (void)setViewportSize:(CGSize)aSize forDocumentTypes:(UIDocumentMask)aDocumentMask;
865 - (void)setMinimumScale:(float)aScale forDocumentTypes:(UIDocumentMask)aDocumentMask;
866 - (void)setMaximumScale:(float)aScale forDocumentTypes:(UIDocumentMask)aDocumentMask;
867 @end
868
869 @interface UIWebBrowserView : UIWebDocumentView
870 @end
871
872 @class WebView;
873
874 @interface UIWebBrowserView ()
875 - (WebView *)webView;
876 - (void)setPaused:(BOOL)paused;
877 - (void)sendScrollEventIfNecessaryWasUserScroll:(BOOL)userScroll;
878 @property (nonatomic) BOOL inputViewObeysDOMFocus;
879 @end
880
881 @interface UIDocumentMenuViewController ()
882 - (instancetype)_initIgnoringApplicationEntitlementForImportOfTypes:(NSArray *)types;
883 @end
884
885 @protocol UIDocumentPasswordViewDelegate;
886
887 @interface UIDocumentPasswordView : UIView <UITextFieldDelegate>
888 @end
889
890 @interface UIDocumentPasswordView ()
891
892 - (id)initWithDocumentName:(NSString *)documentName;
893
894 @property (nonatomic, assign) NSObject<UIDocumentPasswordViewDelegate> *passwordDelegate;
895 @property (nonatomic, readonly) UITextField *passwordField;
896
897 @end
898
899 @protocol UIDocumentPasswordViewDelegate
900
901 @required
902
903 - (void)userDidEnterPassword:(NSString *)password forPasswordView:(UIDocumentPasswordView *)passwordView;
904
905 @optional
906
907 - (void)didBeginEditingPassword:(UITextField *)passwordField inView:(UIDocumentPasswordView *)passwordView;
908 - (void)didEndEditingPassword:(UITextField *)passwordField inView:(UIDocumentPasswordView *)passwordView;
909
910 @end
911
912 @interface UIViewControllerPreviewAction : NSObject <NSCopying>
913 @end
914
915 @interface UIViewControllerPreviewAction ()
916 + (instancetype)actionWithTitle:(NSString *)title handler:(void (^)(UIViewControllerPreviewAction *action, UIViewController *previewViewController))handler;
917 @end
918
919 @interface UITextChecker ()
920 - (id)_initWithAsynchronousLoading:(BOOL)asynchronousLoading;
921 - (BOOL)_doneLoading;
922 - (NSRange)rangeOfMisspelledWordInString:(NSString *)stringToCheck range:(NSRange)range startingAt:(NSInteger)startingOffset wrap:(BOOL)wrapFlag languages:(NSArray *)languagesArray;
923 @end
924
925 @interface UIKeyboardInputMode : UITextInputMode <NSCopying>
926 + (UIKeyboardInputMode *)keyboardInputModeWithIdentifier:(NSString *)identifier;
927 @property (nonatomic, readonly, retain) NSArray <NSString *> *multilingualLanguages;
928 @property (nonatomic, readonly, retain) NSString *languageWithRegion;
929 @end
930
931 @interface UIKeyboardInputModeController : NSObject
932 @end
933
934 @interface UIKeyboardInputModeController ()
935 + (UIKeyboardInputModeController *)sharedInputModeController;
936 @property (readwrite, retain) UIKeyboardInputMode *currentInputMode;
937 @end
938
939 @interface UIApplicationRotationFollowingWindow : UIWindow
940 @end
941
942 @interface UIApplicationRotationFollowingController : UIViewController
943 @end
944
945 @interface UIApplicationRotationFollowingControllerNoTouches : UIApplicationRotationFollowingController
946 @end
947
948 #if ENABLE(DRAG_SUPPORT)
949
950 WTF_EXTERN_C_BEGIN
951
952 NSTimeInterval _UIDragInteractionDefaultLiftDelay(void);
953 CGFloat UIRoundToScreenScale(CGFloat value, UIScreen *);
954
955 WTF_EXTERN_C_END
956
957 typedef NS_OPTIONS(NSUInteger, UIDragOperation)
958 {
959     UIDragOperationNone = 0,
960     UIDragOperationEvery = NSUIntegerMax,
961 };
962
963 @interface UIDragInteraction ()
964 @property (nonatomic, assign, getter=_liftDelay, setter=_setLiftDelay:) NSTimeInterval liftDelay;
965 @end
966
967 @interface UIDragItem ()
968 @property (nonatomic, strong, setter=_setPrivateLocalContext:, getter=_privateLocalContext) id privateLocalContext;
969 @end
970
971 @protocol UITextInput;
972 @interface _UITextDragCaretView : UIView
973 - (instancetype)initWithTextInputView:(UIView<UITextInput> *)textInputView;
974 -(void)insertAtPosition:(UITextPosition *)position;
975 -(void)updateToPosition:(UITextPosition *)position;
976 -(void)remove;
977 @end
978
979 @interface UICalloutBar : UIView
980 + (void)fadeSharedCalloutBar;
981 @end
982
983 @interface UIAutoRotatingWindow : UIApplicationRotationFollowingWindow
984 @end
985
986 @interface UITextEffectsWindow : UIAutoRotatingWindow
987 + (UITextEffectsWindow *)sharedTextEffectsWindow;
988 @end
989
990 @interface UIURLDragPreviewView : UIView
991 + (instancetype)viewWithTitle:(NSString *)title URL:(NSURL *)url;
992 @end
993
994 #endif
995
996 @interface _UIVisualEffectLayerConfig : NSObject
997 + (instancetype)layerWithFillColor:(UIColor *)fillColor opacity:(CGFloat)opacity filterType:(NSString *)filterType;
998 - (void)configureLayerView:(UIView *)view;
999 @end
1000
1001 @interface _UIVisualEffectTintLayerConfig : _UIVisualEffectLayerConfig
1002 + (instancetype)layerWithTintColor:(UIColor *)tintColor;
1003 + (instancetype)layerWithTintColor:(UIColor *)tintColor filterType:(NSString *)filterType NS_AVAILABLE_IOS(9_0);
1004 @end
1005
1006 @interface _UIVisualEffectConfig : NSObject
1007 @property (nonatomic, readonly) _UIVisualEffectLayerConfig *contentConfig;
1008 + (_UIVisualEffectConfig *)configWithContentConfig:(_UIVisualEffectLayerConfig *)contentConfig;
1009 @end
1010
1011 typedef NSInteger UICompositingMode;
1012
1013 @interface UIVisualEffect ()
1014 + (UIVisualEffect *)emptyEffect;
1015 + (UIVisualEffect *)effectCombiningEffects:(NSArray<UIVisualEffect *> *)effects;
1016 + (UIVisualEffect *)effectCompositingColor:(UIColor *)color withMode:(UICompositingMode)compositingMode alpha:(CGFloat)alpha;
1017 @end
1018
1019 @interface UIColorEffect : UIVisualEffect
1020 + (UIColorEffect *)colorEffectSaturate:(CGFloat)saturationAmount;
1021 @end
1022
1023 @interface UIBlurEffect ()
1024 + (UIBlurEffect *)effectWithBlurRadius:(CGFloat)blurRadius;
1025 @end
1026
1027 @interface UIPopoverPresentationController ()
1028 @property (assign, nonatomic, setter=_setCentersPopoverIfSourceViewNotSet:, getter=_centersPopoverIfSourceViewNotSet) BOOL _centersPopoverIfSourceViewNotSet;
1029 @end
1030
1031 #endif // USE(APPLE_INTERNAL_SDK)
1032
1033 @interface UIPhysicalKeyboardEvent : UIPressesEvent
1034 @end
1035
1036 @interface UIPhysicalKeyboardEvent ()
1037 + (UIPhysicalKeyboardEvent *)_eventWithInput:(NSString *)input inputFlags:(UIKeyboardInputFlags)flags;
1038 - (void)_setHIDEvent:(IOHIDEventRef)event keyboard:(GSKeyboardRef)gsKeyboard;
1039 - (UIPhysicalKeyboardEvent *)_cloneEvent NS_RETURNS_RETAINED;
1040 @property (nonatomic, readonly) UIKeyboardInputFlags _inputFlags;
1041 @property (nonatomic, readonly) CFIndex _keyCode;
1042 @property (nonatomic, readonly) NSInteger _gsModifierFlags;
1043 @end
1044
1045 @interface UIColor (IPI)
1046 + (UIColor *)insertionPointColor;
1047 @end
1048
1049 @interface UIView (IPI)
1050 - (UIScrollView *)_scroller;
1051 - (CGPoint)accessibilityConvertPointFromSceneReferenceCoordinates:(CGPoint)point;
1052 - (CGRect)accessibilityConvertRectToSceneReferenceCoordinates:(CGRect)rect;
1053 - (UIRectEdge)_edgesApplyingSafeAreaInsetsToContentInset;
1054 - (void)_updateSafeAreaInsets;
1055 @end
1056
1057 @interface UIScrollView (IPI)
1058 - (CGFloat)_rubberBandOffsetForOffset:(CGFloat)newOffset maxOffset:(CGFloat)maxOffset minOffset:(CGFloat)minOffset range:(CGFloat)range outside:(BOOL *)outside;
1059 - (void)_adjustForAutomaticKeyboardInfo:(NSDictionary *)info animated:(BOOL)animated lastAdjustment:(CGFloat*)lastAdjustment;
1060 - (BOOL)_isScrollingToTop;
1061 - (CGPoint)_animatedTargetOffset;
1062 - (BOOL)_canScrollWithoutBouncingX;
1063 - (BOOL)_canScrollWithoutBouncingY;
1064 - (void)_setContentOffsetWithDecelerationAnimation:(CGPoint)contentOffset;
1065 - (CGPoint)_adjustedContentOffsetForContentOffset:(CGPoint)contentOffset;
1066 - (void)_flashScrollIndicatorsPersistingPreviousFlashes:(BOOL)persisting;
1067 @end
1068
1069 @interface UIPeripheralHost (IPI)
1070 - (void)_beginIgnoringReloadInputViews;
1071 - (int)_endIgnoringReloadInputViews;
1072 - (void)forceReloadInputViews;
1073 - (CGFloat)getVerticalOverlapForView:(UIView *)view usingKeyboardInfo:(NSDictionary *)info;
1074 @end
1075
1076 @interface UIKeyboardImpl (IPI)
1077 - (void)setInitialDirection;
1078 - (void)prepareKeyboardInputModeFromPreferences:(UIKeyboardInputMode *)lastUsedMode;
1079 - (BOOL)handleKeyTextCommandForCurrentEvent;
1080 - (BOOL)handleKeyAppCommandForCurrentEvent;
1081 @property (nonatomic, readonly) UIKeyboardInputMode *currentInputModeInPreference;
1082 @end
1083
1084 @interface _UILayerHostView : UIView
1085 @end
1086
1087 @interface _UIRemoteView : _UILayerHostView
1088 - (instancetype)initWithFrame:(CGRect)frame pid:(pid_t)pid contextID:(uint32_t)contextID;
1089 @end
1090
1091 #if __has_include(<UIKit/UITextInputMultiDocument.h>)
1092 #import <UIKit/UITextInputMultiDocument.h>
1093 #else
1094 @protocol UITextInputMultiDocument <NSObject>
1095 @optional
1096 - (BOOL)_restoreFocusWithToken:(id <NSCopying, NSSecureCoding>)token;
1097 - (void)_preserveFocusWithToken:(id <NSCopying, NSSecureCoding>)token destructively:(BOOL)destructively;
1098 @end
1099 #endif
1100
1101 @interface UIResponder ()
1102 - (UIResponder *)firstResponder;
1103 - (void)pasteAndMatchStyle:(id)sender;
1104 - (void)makeTextWritingDirectionNatural:(id)sender;
1105 @end
1106
1107 @interface _UINavigationInteractiveTransitionBase ()
1108 - (void)_stopInteractiveTransition;
1109 @end
1110
1111 #if __has_include(<UIKit/UITextAutofillSuggestion.h>)
1112 #import <UIKit/UITextAutofillSuggestion.h>
1113 #else
1114 @interface UITextAutofillSuggestion : UITextSuggestion
1115 @property (nonatomic, assign) NSString *username;
1116 @property (nonatomic, assign) NSString *password;
1117 @end
1118 #endif
1119
1120 static inline bool currentUserInterfaceIdiomIsPad()
1121 {
1122     // This inline function exists to thwart unreachable code
1123     // detection on platforms where UICurrentUserInterfaceIdiomIsPad
1124     // is defined directly to false.
1125 #if USE(APPLE_INTERNAL_SDK)
1126     return UICurrentUserInterfaceIdiomIsPad();
1127 #else
1128     return [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad;
1129 #endif
1130 }
1131
1132 WTF_EXTERN_C_BEGIN
1133
1134 BOOL UIKeyboardEnabledInputModesAllowOneToManyShortcuts(void);
1135 BOOL UIKeyboardEnabledInputModesAllowChineseTransliterationForText(NSString *);
1136
1137 extern const float UITableCellDefaultFontSize;
1138 extern const float UITableViewCellDefaultFontSize;
1139
1140 extern NSString *const _UIApplicationDidFinishSuspensionSnapshotNotification;
1141
1142 extern NSString * const UIWindowDidMoveToScreenNotification;
1143 extern NSString * const UIWindowDidRotateNotification;
1144 extern NSString * const UIWindowNewScreenUserInfoKey;
1145 extern NSString * const UIWindowWillRotateNotification;
1146
1147 extern NSString * const UIKeyboardIsLocalUserInfoKey;
1148
1149 extern UIApplication *UIApp;
1150 BOOL _UIApplicationIsExtension(void);
1151 void _UIApplicationLoadWebKit(void);
1152
1153 void UIImageDataWriteToSavedPhotosAlbum(NSData *imageData, id completionTarget, SEL completionSelector, void *contextInfo);
1154
1155 UIImage* _UIImageGetWebKitPhotoLibraryIcon(void);
1156 UIImage* _UIImageGetWebKitTakePhotoOrVideoIcon(void);
1157
1158 extern const float UIWebViewGrowsAndShrinksToFitHeight;
1159 extern const float UIWebViewScalesToFitScale;
1160 extern const float UIWebViewStandardViewportWidth;
1161
1162 extern NSString *const UIKeyInputPageUp;
1163 extern NSString *const UIKeyInputPageDown;
1164
1165 extern const NSString *UIPreviewDataLink;
1166 extern const NSString *UIPreviewDataDDResult;
1167 extern const NSString *UIPreviewDataDDContext;
1168
1169 extern const NSString *UIPreviewDataAttachmentList;
1170 extern const NSString *UIPreviewDataAttachmentIndex;
1171
1172 #if __IPHONE_OS_VERSION_MAX_ALLOWED < 130000
1173 extern NSString * const UIPreviewDataAttachmentListSourceIsManaged;
1174 #else
1175 extern NSString * const UIPreviewDataAttachmentListIsContentManaged;
1176 #endif
1177
1178 UIEdgeInsets UIEdgeInsetsAdd(UIEdgeInsets lhs, UIEdgeInsets rhs, UIRectEdge);
1179
1180 WTF_EXTERN_C_END