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