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