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