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