787a377379c4919b8b97ba902736b37e5219f918
[WebKit-https.git] / Source / WebKit2 / Platform / spi / ios / UIKitSPI.h
1 /*
2  * Copyright (C) 2014 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/UIDatePicker_Private.h>
34 #import <UIKit/UIDevice_Private.h>
35 #import <UIKit/UIFont_Private.h>
36 #import <UIKit/UIGeometry_Private.h>
37 #import <UIKit/UIGestureRecognizer_Private.h>
38 #import <UIKit/UIImagePickerController_Private.h>
39 #import <UIKit/UIImage_Private.h>
40 #import <UIKit/UIKeyboardImpl.h>
41 #import <UIKit/UIKeyboardIntl.h>
42 #import <UIKit/UIKeyboard_Private.h>
43 #import <UIKit/UILongPressGestureRecognizer_Private.h>
44 #import <UIKit/UIPeripheralHost.h>
45 #import <UIKit/UIPeripheralHost_Private.h>
46 #import <UIKit/UIPickerContentView_Private.h>
47 #import <UIKit/UIPickerView_Private.h>
48 #import <UIKit/UIScrollView_Private.h>
49 #import <UIKit/UIStringDrawing_Private.h>
50 #import <UIKit/UITableViewCell_Private.h>
51 #import <UIKit/UITapGestureRecognizer_Private.h>
52 #import <UIKit/UITextInput_Private.h>
53 #import <UIKit/UITextInteractionAssistant_Private.h>
54 #import <UIKit/UIViewControllerTransitioning_Private.h>
55 #import <UIKit/UIViewController_Private.h>
56 #import <UIKit/UIView_Private.h>
57 #import <UIKit/UIWKSelectionAssistant.h>
58 #import <UIKit/UIWKTextInteractionAssistant.h>
59 #import <UIKit/UIWebBrowserView.h>
60 #import <UIKit/UIWebDocumentView.h>
61 #import <UIKit/UIWebFormAccessory.h>
62 #import <UIKit/UIWebGeolocationPolicyDecider.h>
63 #import <UIKit/UIWebScrollView.h>
64 #import <UIKit/UIWebTiledView.h>
65 #import <UIKit/UIWebTouchEventsGestureRecognizer.h>
66 #import <UIKit/UIWindow_Private.h>
67 #import <UIKit/_UIBackdropView_Private.h>
68 #import <UIKit/_UIHighlightView.h>
69 #import <UIKit/_UINavigationInteractiveTransition.h>
70 #import <UIKit/_UINavigationParallaxTransition.h>
71
72 // FIXME: Unconditionally include this file when a new SDK is available. <rdar://problem/20150072>
73 #if defined(__has_include) && __has_include(<UIKit/UIDocumentMenuViewController_Private.h>)
74 #import <UIKit/UIDocumentMenuViewController_Private.h>
75 #else
76 @interface UIDocumentMenuViewController (Details)
77 @property (nonatomic, assign, setter = _setIgnoreApplicationEntitlementForImport:, getter = _ignoreApplicationEntitlementForImport) BOOL _ignoreApplicationEntitlementForImport;
78 @end
79 #endif
80
81 #else
82
83 @interface UIAlertController (Details)
84 - (void)_addActionWithTitle:(NSString *)title style:(UIAlertActionStyle)style handler:(void (^)(void))handler;
85 - (void)_addActionWithTitle:(NSString *)title style:(UIAlertActionStyle)style handler:(void (^)(void))handler shouldDismissHandler:(BOOL (^)(void))shouldDismissHandler;
86 @property (nonatomic) UIAlertControllerStyle preferredStyle;
87 @end
88
89 @interface UIApplication (Details)
90 - (UIInterfaceOrientation)interfaceOrientation;
91 - (void)_cancelAllTouches;
92 - (CGFloat)statusBarHeight;
93 @end
94
95 typedef NS_ENUM(NSInteger, UIDatePickerPrivateMode)  {
96     UIDatePickerModeYearAndMonth = 4269,
97 };
98
99 @interface UIDatePicker (Details)
100 @property (nonatomic, readonly, getter=_contentWidth) CGFloat contentWidth;
101 @end
102
103 #define UICurrentUserInterfaceIdiomIsPad() ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
104
105 @interface UIDevice (Details)
106 @property (nonatomic, readonly, retain) NSString *buildVersion;
107 @end
108
109 typedef enum {
110     UIFontTraitPlain = 0x00000000,
111 } UIFontTrait;
112
113 @interface UIFont (Details)
114 + (UIFont *)fontWithFamilyName:(NSString *)familyName traits:(UIFontTrait)traits size:(CGFloat)fontSize;
115 @end
116
117 typedef enum {
118     UIAllCorners = 0xFF,
119 } UIRectCorners;
120
121 @interface UIImagePickerController (Details)
122 @property (nonatomic, setter=_setAllowsMultipleSelection:) BOOL _allowsMultipleSelection;
123 @end
124
125 @interface UIImage (Details)
126 - (id)initWithCGImage:(CGImageRef)CGImage imageOrientation:(UIImageOrientation)imageOrientation;
127 @end
128
129 @protocol UIKeyboardImplGeometryDelegate
130 @property (nonatomic, readwrite, getter=isMinimized) BOOL minimized;
131 - (void)prepareForImplBoundsHeightChange:(CGFloat)endDelta suppressNotification:(BOOL)suppressNotification;
132 - (void)implBoundsHeightChangeDone:(CGFloat)endDelta suppressNotification:(BOOL)suppressNotification;
133 - (BOOL)shouldSaveMinimizationState;
134 - (BOOL)canDismiss;
135 - (BOOL)isActive;
136 @end
137
138 @protocol UIKeyboardCandidateListDelegate <NSObject>
139 @optional
140 - (void)setCandidateList:(id)candidateList updateCandidateView:(BOOL)updateCandidateView;
141 - (void)candidateListAcceptCandidate:(id)candidateList;
142 - (void)candidateListSelectionDidChange:(id)candidateList;
143 - (void)candidateListShouldBeDismissed:(id)candidateList;
144 @end
145
146 @interface UIKeyboard : UIView <UIKeyboardImplGeometryDelegate>
147 @end
148
149 @interface UIKeyboard (Details)
150 + (CGSize)defaultSizeForInterfaceOrientation:(UIInterfaceOrientation)orientation;
151 - (void)activate;
152 - (void)geometryChangeDone:(BOOL)keyboardVisible;
153 - (void)prepareForGeometryChange;
154 @end
155
156 @interface UIKeyboardImpl : UIView <UIKeyboardCandidateListDelegate>
157 @end
158
159 @interface UIKeyboardImpl (Details)
160 + (UIKeyboardImpl *)activeInstance;
161 + (UIKeyboardImpl *)sharedInstance;
162 + (CGSize)defaultSizeForInterfaceOrientation:(UIInterfaceOrientation)orientation;
163 - (void)addInputString:(NSString *)string withFlags:(NSUInteger)flags;
164 - (BOOL)autocorrectSpellingEnabled;
165 - (void)deleteFromInput;
166 - (void)deleteFromInputWithFlags:(NSUInteger)flags;
167 - (void)replaceText:(id)replacement;
168 @property (nonatomic, readwrite, retain) UIResponder <UIKeyInput> *delegate;
169 @end
170
171 @interface UIGestureRecognizer (Details)
172 - (void)requireOtherGestureToFail:(UIGestureRecognizer *)gestureRecognizer;
173 @end
174
175 @interface UILongPressGestureRecognizer (Details)
176 @property (nonatomic) CFTimeInterval delay;
177 @property (nonatomic, readonly) CGPoint startPoint;
178 @end
179
180 @interface _UIWebHighlightLongPressGestureRecognizer : UILongPressGestureRecognizer
181 @end
182
183 @interface _UIWebHighlightLongPressGestureRecognizer (Details)
184 - (void)cancel;
185 @end
186
187 @interface UIPeripheralHost : NSObject <UIGestureRecognizerDelegate>
188 @end
189
190 @class UIKeyboardRotationState;
191
192 @interface UIPeripheralHost (Details)
193 + (UIPeripheralHost *)sharedInstance;
194 + (UIPeripheralHost *)activeInstance;
195 - (BOOL)isOnScreen;
196 - (UIKeyboardRotationState *)rotationState;
197 @end
198
199 @interface UIPickerContentView : UIView
200 @end
201
202 @interface UIPickerContentView (Details)
203 +(CGFloat)_checkmarkOffset;
204 -(CGFloat)labelWidthForBounds:(CGRect)bounds;
205 @property (nonatomic, getter=isChecked) BOOL checked;
206 @property (nonatomic, readonly) UILabel *titleLabel;
207 @end
208
209 @interface UIPickerView (Details)
210 + (CGSize)defaultSizeForCurrentOrientation;
211 - (void)_setUsesCheckedSelection:(BOOL)usesCheckedSelection;
212 @property (nonatomic, setter=_setMagnifierEnabled:) BOOL _magnifierEnabled;
213 @end
214
215 @interface UIScrollView (Details)
216 - (void)_stopScrollingAndZoomingAnimations;
217 - (void)_zoomToCenter:(CGPoint)center scale:(CGFloat)scale duration:(CFTimeInterval)duration force:(BOOL)force;
218 - (void)_zoomToCenter:(CGPoint)center scale:(CGFloat)scale duration:(CFTimeInterval)duration;
219 @property (nonatomic, getter=isZoomEnabled) BOOL zoomEnabled;
220 @property (nonatomic, readonly, getter=_isAnimatingZoom) BOOL isAnimatingZoom;
221 @property (nonatomic) CGFloat horizontalScrollDecelerationFactor;
222 @property (nonatomic) CGFloat verticalScrollDecelerationFactor;
223 @end
224
225 @interface NSString (UIKitDetails)
226 - (CGSize)_legacy_sizeWithFont:(UIFont *)font forWidth:(CGFloat)width lineBreakMode:(NSLineBreakMode)lineBreakMode;
227 - (CGSize)_legacy_sizeWithFont:(UIFont *)font minFontSize:(CGFloat)minFontSize actualFontSize:(CGFloat *)actualFontSize forWidth:(CGFloat)width lineBreakMode:(NSLineBreakMode)lineBreakMode;
228 @end
229
230 @interface UITapGestureRecognizer (Details)
231 @property (nonatomic, readonly) CGPoint location;
232 @end
233
234 @class WebEvent;
235
236 typedef enum {
237     UITextShortcutConversionTypeDefault = 0,
238     UITextShortcutConversionTypeNo = 1,
239     UITextShortcutConversionTypeYes = 2,
240 } UITextShortcutConversionType;
241
242 @protocol UITextInputTraits_Private <NSObject, UITextInputTraits>
243 - (void)takeTraitsFrom:(id <UITextInputTraits>)traits;
244 @optional
245 @property (nonatomic) UITextShortcutConversionType shortcutConversionType;
246 @end
247
248 @class UITextInputArrowKeyHistory;
249
250 @protocol UITextInputPrivate <UITextInput, UITextInputTokenizer, UITextInputTraits_Private>
251 @optional
252 - (BOOL)requiresKeyEvents;
253 - (NSArray *)metadataDictionariesForDictationResults;
254 - (UIColor *)textColorForCaretSelection;
255 - (UIFont *)fontForCaretSelection;
256 - (UIView *)automaticallySelectedOverlay;
257 - (void)handleKeyWebEvent:(WebEvent *)event;
258 - (void)insertDictationResult:(NSArray *)dictationResult withCorrectionIdentifier:(id)correctionIdentifier;
259 - (void)replaceRangeWithTextWithoutClosingTyping:(UITextRange *)range replacementText:(NSString *)text;
260 - (void)setBottomBufferHeight:(CGFloat)bottomBuffer;
261 @property (nonatomic) UITextGranularity selectionGranularity;
262 @required
263 - (BOOL)hasContent;
264 - (BOOL)hasSelection;
265 - (void)selectAll;
266 @end
267
268 @interface UITextInputTraits : NSObject <UITextInputTraits, UITextInputTraits_Private, NSCopying>
269 @end
270
271 @interface UITextInteractionAssistant : NSObject
272 @end
273
274 @interface UITextInteractionAssistant (Details)
275 - (void)activateSelection;
276 - (void)deactivateSelection;
277 - (void)didEndScrollingOverflow;
278 - (void)selectionChanged;
279 - (void)setGestureRecognizers;
280 - (void)willStartScrollingOverflow;
281 @end
282
283 @interface UIViewController (Details)
284 + (UIViewController *)_viewControllerForFullScreenPresentationFromView:(UIView *)view;
285 + (UIViewController *)viewControllerForView:(UIView *)view;
286 @end
287
288 @protocol UIViewControllerContextTransitioningEx <UIViewControllerContextTransitioning>
289 - (void)__runAlongsideAnimations;
290 - (void)_interactivityDidChange:(BOOL)isInteractive;
291 @property (nonatomic, assign, setter=_setAllowUserInteraction:, getter=_allowUserInteraction) BOOL _allowUserInteraction;
292 @property (nonatomic, assign, setter=_setPercentOffset:) CGFloat _percentOffset;
293 @property (nonatomic, retain, setter=_setContainerViews:) NSArray *_containerViews;
294 @end
295
296 @interface _UIViewControllerTransitionContext : NSObject <UIViewControllerContextTransitioningEx>
297 @end
298
299 @interface _UIViewControllerTransitionContext (Details)
300 - (void) _setTransitionIsInFlight:(BOOL)flag;
301 @property (nonatomic, assign, setter=_setAllowUserInteraction:, getter=_allowUserInteraction) BOOL _allowUserInteraction;
302 @property (nonatomic, assign, setter=_setAnimator:) id <UIViewControllerAnimatedTransitioning> _animator;
303 @property (nonatomic, assign, setter=_setContainerView:) UIView *containerView;
304 @property (nonatomic, assign, setter=_setInteractor:) id <UIViewControllerInteractiveTransitioning> _interactor;
305 @property (nonatomic, assign, setter=_setPercentOffset:) CGFloat _percentOffset;
306 @property (nonatomic, copy, setter=_setCompletionHandler:)  void (^_completionHandler)(_UIViewControllerTransitionContext *context, BOOL transitionCompleted);
307 @property (nonatomic, retain, setter=_setContainerViews:) NSArray *_containerViews;
308 @end
309
310 @interface _UIViewControllerOneToOneTransitionContext : _UIViewControllerTransitionContext
311 @end
312
313 @interface _UIViewControllerOneToOneTransitionContext (Details)
314 @property (nonatomic, assign, setter=_setFromEndFrame:) CGRect fromEndFrame;
315 @property (nonatomic, assign, setter=_setFromStartFrame:) CGRect fromStartFrame;
316 @property (nonatomic, assign, setter=_setToEndFrame:) CGRect toEndFrame;
317 @property (nonatomic, assign, setter=_setToStartFrame:) CGRect toStartFrame;
318 @property (nonatomic, retain, setter=_setFromViewController:) UIViewController *fromViewController;
319 @property (nonatomic, retain, setter=_setToViewController:) UIViewController *toViewController;
320 @end
321
322 @protocol UIViewControllerAnimatedTransitioningEx <UIViewControllerAnimatedTransitioning>
323 - (BOOL)interactionAborted;
324 - (UINavigationControllerOperation) operation;
325 - (UIPercentDrivenInteractiveTransition *)interactionController;
326 - (void)setInteractionAborted:(BOOL)aborted;
327 - (void)setInteractionController:(UIPercentDrivenInteractiveTransition *)controller;
328 - (void)setOperation:(UINavigationControllerOperation)operation;
329 @optional
330 - (UIWindow *)window;
331 @end
332
333 typedef NS_ENUM (NSInteger, _UIBackdropMaskViewFlags) {
334     _UIBackdropMaskViewNone = 0,
335     _UIBackdropMaskViewGrayscaleTint = 1 << 0,
336     _UIBackdropMaskViewColorTint = 1 << 1,
337     _UIBackdropMaskViewFilters = 1 << 2,
338     _UIBackdropMaskViewAll = _UIBackdropMaskViewGrayscaleTint | _UIBackdropMaskViewColorTint | _UIBackdropMaskViewFilters,
339 };
340
341 @interface UIView (Details)
342 + (BOOL)_isInAnimationBlock;
343 - (CGSize)size;
344 - (void)setFrameOrigin:(CGPoint)origin;
345 - (void)setSize:(CGSize)size;
346 @property (nonatomic, assign, setter=_setBackdropMaskViewFlags:) NSInteger _backdropMaskViewFlags;
347 @end
348
349 @interface UIWebSelectionAssistant : NSObject <UIGestureRecognizerDelegate>
350 @end
351
352 @interface UIWebSelectionAssistant (Details)
353 - (BOOL)isSelectionGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer;
354 - (id)initWithView:(UIView *)view;
355 - (void)clearSelection;
356 - (void)didEndScrollingOrZoomingPage;
357 - (void)didEndScrollingOverflow;
358 - (void)resignedFirstResponder;
359 - (void)selectionChanged;
360 - (void)setGestureRecognizers;
361 - (void)willStartScrollingOrZoomingPage;
362 - (void)willStartScrollingOverflow;
363 @property (nonatomic, readonly) CGRect selectionFrame;
364 @end
365
366 typedef NS_ENUM(NSInteger, UIWKSelectionTouch) {
367     UIWKSelectionTouchStarted = 0,
368     UIWKSelectionTouchMoved = 1,
369     UIWKSelectionTouchEnded = 2,
370     UIWKSelectionTouchEndedMovingForward = 3,
371     UIWKSelectionTouchEndedMovingBackward = 4,
372     UIWKSelectionTouchEndedNotMoving = 5,
373 };
374
375 typedef NS_ENUM(NSInteger, UIWKSelectionFlags) {
376     UIWKNone = 0,
377     UIWKWordIsNearTap = 1,
378     UIWKIsBlockSelection = 2,
379     UIWKPhraseBoundaryChanged = 4,
380 };
381
382 typedef NS_ENUM(NSInteger, UIWKGestureType) {
383     UIWKGestureLoupe = 0,
384     UIWKGestureOneFingerTap = 1,
385     UIWKGestureTapAndAHalf = 2,
386     UIWKGestureDoubleTap = 3,
387     UIWKGestureTapAndHalf = 4,
388     UIWKGestureDoubleTapInUneditable = 5,
389     UIWKGestureOneFingerTapInUneditable = 6,
390     UIWKGestureOneFingerTapSelectsAll = 7,
391     UIWKGestureOneFingerDoubleTap = 8,
392     UIWKGestureOneFingerTripleTap = 9,
393     UIWKGestureTwoFingerSingleTap = 10,
394     UIWKGestureTwoFingerRangedSelectGesture = 11,
395     UIWKGestureTapOnLinkWithGesture = 12,
396     UIWKGestureMakeWebSelection = 13,
397     UIWKGesturePhraseBoundary = 14,
398 };
399
400 @interface UIWKSelectionAssistant : UIWebSelectionAssistant
401 @end
402
403 @interface UIWKSelectionAssistant (Details)
404 - (BOOL)shouldHandleSingleTapAtPoint:(CGPoint)point;
405 - (void)blockSelectionChangedWithTouch:(UIWKSelectionTouch)touch withFlags:(UIWKSelectionFlags)flags growThreshold:(CGFloat)grow shrinkThreshold:(CGFloat)shrink;
406 - (void)selectionChangedWithGestureAt:(CGPoint)point withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)gestureState withFlags:(UIWKSelectionFlags)flags;
407 - (void)selectionChangedWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch withFlags:(UIWKSelectionFlags)flags;
408 - (void)selectionChangedWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch;
409 - (void)showDictionaryFor:(NSString *)selectedTerm fromRect:(CGRect)presentationRect;
410 @property (nonatomic, readonly) UILongPressGestureRecognizer *selectionLongPressRecognizer;
411 @end
412
413 typedef NS_ENUM(NSInteger, UIWKHandlePosition) {
414     UIWKHandleTop = 0,
415     UIWKHandleRight = 1,
416     UIWKHandleBottom = 2,
417     UIWKHandleLeft = 3,
418 };
419
420 @interface UIWKAutocorrectionRects : NSObject
421 @end
422
423 @interface UIWKAutocorrectionRects (UIWKAutocorrectionRectsDetails)
424 @property (nonatomic, assign) CGRect firstRect;
425 @property (nonatomic, assign) CGRect lastRect;
426 @end
427
428 @interface UIWKAutocorrectionContext : NSObject
429 @end
430
431 @interface UIWKAutocorrectionContext (UIWKAutocorrectionContextDetails)
432 @property (nonatomic, copy) NSString *contextBeforeSelection;
433 @property (nonatomic, copy) NSString *selectedText;
434 @property (nonatomic, copy) NSString *contextAfterSelection;
435 @property (nonatomic, copy) NSString *markedText;
436 @property (nonatomic, assign) NSRange rangeInMarkedText;
437 @end
438
439 @interface UIWKTextInteractionAssistant : UITextInteractionAssistant
440 @end
441
442 @interface UIWKTextInteractionAssistant (UIWKTextInteractionAssistantDetails)
443 - (void)selectionChangedWithGestureAt:(CGPoint)point withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)gestureState withFlags:(UIWKSelectionFlags)flags;
444 - (void)showDictionaryFor:(NSString *)selectedTerm fromRect:(CGRect)presentationRect;
445 - (void)selectionChangedWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch;
446 - (void)showTextStyleOptions;
447 - (void)hideTextStyleOptions;
448
449 @property (nonatomic, readonly, retain) UITapGestureRecognizer *singleTapGesture;
450 @property (nonatomic, readonly, retain) UILongPressGestureRecognizer *loupeGesture;
451 @end
452
453 @protocol UIWKInteractionViewProtocol
454 - (void)changeSelectionWithGestureAt:(CGPoint)point withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)state;
455
456 - (void)changeSelectionWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch baseIsStart:(BOOL)baseIsStart;
457 - (void)changeSelectionWithTouchesFrom:(CGPoint)from to:(CGPoint)to withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)gestureState;
458 - (CGRect)textFirstRect;
459 - (CGRect)textLastRect;
460
461 - (void)requestAutocorrectionContextWithCompletionHandler:(void (^)(UIWKAutocorrectionContext *autocorrectionContext))completionHandler;
462
463 - (void)requestAutocorrectionRectsForString:(NSString *)input withCompletionHandler:(void (^)(UIWKAutocorrectionRects *rectsForInput))completionHandler;
464
465 - (void)applyAutocorrection:(NSString *)correction toString:(NSString *)input withCompletionHandler:(void (^)(UIWKAutocorrectionRects *rectsForCorrection))completionHandler;
466
467 - (NSString *)markedText;
468 - (BOOL)hasMarkedText;
469
470 - (BOOL)hasSelectablePositionAtPoint:(CGPoint)point;
471 - (BOOL)pointIsInAssistedNode:(CGPoint)point;
472 - (NSArray *)webSelectionRects;
473 - (void)_cancelLongPressGestureRecognizer;
474
475 @optional
476 - (void)changeSelectionWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch baseIsStart:(BOOL)baseIsStart withFlags:(UIWKSelectionFlags)flags;
477 - (void)changeBlockSelectionWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch forHandle:(UIWKHandlePosition)handle;
478 - (void)clearSelection;
479 - (void)replaceDictatedText:(NSString *)oldText withText:(NSString *)newText;
480 - (void)requestDictationContext:(void (^)(NSString *selectedText, NSString *prefixText, NSString *postfixText))completionHandler;
481 - (BOOL)pointIsNearMarkedText:(CGPoint)point;
482 - (NSString *)selectedText;
483 - (void)replaceText:(NSString *)text withText:(NSString *)word;
484 - (void)selectWordForReplacement;
485 - (BOOL)isReplaceAllowed;
486 - (void)selectWordBackward;
487 - (UIView *)unscaledView;
488 - (CGFloat)inverseScale;
489 - (CGRect)unobscuredContentRect;
490 @end
491
492 typedef enum {
493     UIWebSelectionModeWeb = 0,
494     UIWebSelectionModeTextOnly = 1,
495 } UIWebSelectionMode;
496
497 @protocol UIWebFormAccessoryDelegate;
498
499 @interface UIWebFormAccessory : UIInputView
500 @end
501
502 @interface UIWebFormAccessory (Details)
503 - (void)hideAutoFillButton;
504 - (void)setClearVisible:(BOOL)flag;
505 - (void)showAutoFillButtonWithTitle:(NSString *)title;
506 @property (nonatomic, retain) UIBarButtonItem *_autofill;
507 @property (nonatomic, assign) id <UIWebFormAccessoryDelegate> delegate;
508
509 @property (nonatomic, assign, getter=isNextEnabled) BOOL nextEnabled;
510 @property (nonatomic, assign, getter=isPreviousEnabled) BOOL previousEnabled;
511 @end
512
513 @protocol UIWebFormAccessoryDelegate
514 - (void)accessoryAutoFill;
515 - (void)accessoryClear;
516 - (void)accessoryDone;
517 - (void)accessoryTab:(BOOL)isNext;
518 @end
519
520 @interface UIWebGeolocationPolicyDecider : NSObject
521 @end
522
523 @interface UIWebGeolocationPolicyDecider (Details)
524 + (instancetype)sharedPolicyDecider;
525 - (void)decidePolicyForGeolocationRequestFromOrigin:(id)securityOrigin requestingURL:(NSURL *)requestingURL window:(UIWindow *)window listener:(id)listener;
526 @end
527
528 typedef enum {
529     UIWebTouchEventTouchBegin = 0,
530     UIWebTouchEventTouchChange = 1,
531     UIWebTouchEventTouchEnd = 2,
532     UIWebTouchEventTouchCancel = 3,
533 } UIWebTouchEventType;
534
535 struct _UIWebTouchPoint {
536     CGPoint locationInScreenCoordinates;
537     CGPoint locationInDocumentCoordinates;
538     unsigned identifier;
539     UITouchPhase phase;
540     CGFloat majorRadiusInScreenCoordinates;
541 };
542
543 struct _UIWebTouchEvent {
544     UIWebTouchEventType type;
545     NSTimeInterval timestamp;
546     CGPoint locationInScreenCoordinates;
547     CGPoint locationInDocumentCoordinates;
548     CGFloat scale;
549     CGFloat rotation;
550
551     bool inJavaScriptGesture;
552
553     struct _UIWebTouchPoint* touchPoints;
554     unsigned touchPointCount;
555 };
556
557 @protocol UIWebTouchEventsGestureRecognizerDelegate
558 - (BOOL)isAnyTouchOverActiveArea:(NSSet *)touches;
559 - (BOOL)shouldIgnoreWebTouch;
560 @end
561
562 @interface UIWebTouchEventsGestureRecognizer : UIGestureRecognizer
563 @end
564
565 @interface UIWebTouchEventsGestureRecognizer (Details)
566 - (id)initWithTarget:(id)target action:(SEL)action touchDelegate:(id <UIWebTouchEventsGestureRecognizerDelegate>)delegate;
567 @property (nonatomic, getter=isDefaultPrevented) BOOL defaultPrevented;
568 @property (nonatomic, readonly) BOOL inJavaScriptGesture;
569 @property (nonatomic, readonly) CGPoint locationInWindow;
570 @property (nonatomic, readonly) UIWebTouchEventType type;
571 @property (nonatomic, readonly) const struct _UIWebTouchEvent *lastTouchEvent;
572 @end
573
574 typedef NS_ENUM(NSInteger, _UIBackdropViewStylePrivate) {
575     _UIBackdropViewStyle_Light = 2020,
576     _UIBackdropViewStyle_Dark = 2030
577 };
578
579 @interface _UIBackdropView : UIView
580 @end
581
582 @interface _UIBackdropView (_UIBackdropViewDetails)
583 - (instancetype)initWithPrivateStyle:(_UIBackdropViewStylePrivate)style;
584 - (instancetype)initWithFrame:(CGRect)frame privateStyle:(_UIBackdropViewStylePrivate)style;
585 @property (nonatomic, strong, readonly) UIView *contentView;
586 @end
587
588 @interface _UIHighlightView : UIView
589 @end
590
591 @interface _UIHighlightView (Details)
592 - (void)setColor:(UIColor *)aColor;
593 - (void)setCornerRadii:(NSArray *)cornerRadii;
594 - (void)setCornerRadius:(CGFloat)aCornerRadius;
595 - (void)setFrames:(NSArray *)frames boundaryRect:(CGRect)aBoundarRect;
596 - (void)setQuads:(NSArray *)quads boundaryRect:(CGRect)aBoundaryRect;
597 @end
598
599 @interface _UINavigationParallaxTransition : NSObject <UIViewControllerAnimatedTransitioningEx>
600 @end
601
602 @interface _UINavigationParallaxTransition (Details)
603 - (instancetype) initWithCurrentOperation:(UINavigationControllerOperation)operation;
604 @end
605
606 @protocol _UINavigationInteractiveTransitionBaseDelegate;
607
608 @interface _UINavigationInteractiveTransitionBase : UIPercentDrivenInteractiveTransition <UIGestureRecognizerDelegate>
609 @end
610
611 @interface _UINavigationInteractiveTransitionBase (Details)
612 - (id)initWithGestureRecognizerView:(UIView *)gestureRecognizerView animator:(id<UIViewControllerAnimatedTransitioning>)animator delegate:(id<_UINavigationInteractiveTransitionBaseDelegate>)delegate;
613 @property (nonatomic, assign) BOOL shouldReverseTranslation;
614 @property (nonatomic, retain) _UINavigationParallaxTransition *animationController;
615 @end
616
617 @protocol _UINavigationInteractiveTransitionBaseDelegate <NSObject>
618 - (void)startInteractiveTransition:(_UINavigationInteractiveTransitionBase *)interactiveTransition;
619 - (BOOL)shouldBeginInteractiveTransition:(_UINavigationInteractiveTransitionBase *)interactiveTransition;
620 - (BOOL)interactiveTransition:(_UINavigationInteractiveTransitionBase *)interactiveTransition gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;
621 - (BOOL)interactiveTransition:(_UINavigationInteractiveTransitionBase *)interactiveTransition gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch;
622 - (UIPanGestureRecognizer *)gestureRecognizerForInteractiveTransition:(_UINavigationInteractiveTransitionBase *)interactiveTransition WithTarget:(id)target action:(SEL)action;
623 @end
624
625 @interface UIWindow (Details)
626 + (mach_port_t)_synchronizeDrawingAcrossProcesses;
627 @end
628
629 @interface UIWebScrollView : UIScrollView
630 @end
631
632 @interface UIWebTiledView : UIView
633 @end
634
635 @class WAKWindow;
636
637 @interface UIWebTiledView (Details)
638 - (void)setWAKWindow:(WAKWindow *)window;
639 @end
640
641 @interface UIWebDocumentView : UIWebTiledView
642 @end
643
644 typedef enum {
645     UIEveryDocumentMask = 0xFFFFFF,
646 } UIDocumentMask;
647
648 @interface UIWebDocumentView (Details)
649 - (void)setDelegate:(id)delegate;
650 - (void)setAutoresizes:(BOOL)flag;
651 - (void)setMinimumSize:(CGSize)aSize;
652 - (void)setInitialScale:(float)aScale forDocumentTypes:(UIDocumentMask)aDocumentMask;
653 - (void)setViewportSize:(CGSize)aSize forDocumentTypes:(UIDocumentMask)aDocumentMask;
654 - (void)setMinimumScale:(float)aScale forDocumentTypes:(UIDocumentMask)aDocumentMask;
655 - (void)setMaximumScale:(float)aScale forDocumentTypes:(UIDocumentMask)aDocumentMask;
656 @end
657
658 @interface UIWebBrowserView : UIWebDocumentView
659 @end
660
661 @class WebView;
662
663 @interface UIWebBrowserView (Details)
664 - (WebView *)webView;
665 - (void)setPaused:(BOOL)paused;
666 - (void)sendScrollEventIfNecessaryWasUserScroll:(BOOL)userScroll;
667 @property (nonatomic) BOOL inputViewObeysDOMFocus;
668 @end
669
670 @interface UIDocumentMenuViewController (Details)
671 @property (nonatomic, assign, setter = _setIgnoreApplicationEntitlementForImport:, getter = _ignoreApplicationEntitlementForImport) BOOL _ignoreApplicationEntitlementForImport;
672 @end
673
674 #endif // USE(APPLE_INTERNAL_SDK)
675
676 @interface UIView (IPI)
677 - (UIScrollView *)_scroller;
678 - (CGPoint)accessibilityConvertPointFromSceneReferenceCoordinates:(CGPoint)point;
679 - (CGRect)accessibilityConvertRectToSceneReferenceCoordinates:(CGRect)rect;
680 @end
681
682 WTF_EXTERN_C_BEGIN
683
684 BOOL UIKeyboardEnabledInputModesAllowOneToManyShortcuts();
685 BOOL UIKeyboardEnabledInputModesAllowChineseTransliterationForText(NSString *);
686 BOOL UIKeyboardCurrentInputModeAllowsChineseOrJapaneseReanalysisForText(NSString *);
687
688 extern const float UITableCellDefaultFontSize;
689 extern const float UITableViewCellDefaultFontSize;
690
691 extern NSString * const UIWindowDidMoveToScreenNotification;
692 extern NSString * const UIWindowDidRotateNotification;
693 extern NSString * const UIWindowNewScreenUserInfoKey;
694 extern NSString * const UIWindowWillRotateNotification;
695
696 extern UIApplication *UIApp;
697 void _UIApplicationLoadWebKit(void);
698 BOOL _UIApplicationUsesLegacyUI(void);
699
700 void UIImageDataWriteToSavedPhotosAlbum(NSData *imageData, id completionTarget, SEL completionSelector, void *contextInfo);
701
702 extern const float UIWebViewGrowsAndShrinksToFitHeight;
703 extern const float UIWebViewScalesToFitScale;
704 extern const float UIWebViewStandardViewportWidth;
705
706 WTF_EXTERN_C_END