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