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