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