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