Don't use (Details) when exposing SPI
[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 ()
88 @property (nonatomic, assign, setter = _setIgnoreApplicationEntitlementForImport:, getter = _ignoreApplicationEntitlementForImport) BOOL _ignoreApplicationEntitlementForImport;
89 @end
90 #endif
91
92 #else
93
94 @interface UIAlertController ()
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 ()
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 ()
112 @property (nonatomic, readonly, getter=_contentWidth) CGFloat contentWidth;
113 @end
114
115 #define UICurrentUserInterfaceIdiomIsPad() ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
116
117 @interface UIDevice ()
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 ()
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 ()
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 ()
154 @property (nonatomic, setter=_setAllowsMultipleSelection:) BOOL _allowsMultipleSelection;
155 @end
156
157 @interface UIImage ()
158 - (id)initWithCGImage:(CGImageRef)CGImage imageOrientation:(UIImageOrientation)imageOrientation;
159 @end
160
161 @interface UIKeyCommand ()
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 ()
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 ()
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 ()
208 - (void)requireOtherGestureToFail:(UIGestureRecognizer *)gestureRecognizer;
209 @end
210
211 @interface UILongPressGestureRecognizer ()
212 @property (nonatomic) CFTimeInterval delay;
213 @property (nonatomic, readonly) CGPoint startPoint;
214 @end
215
216 @interface _UIWebHighlightLongPressGestureRecognizer : UILongPressGestureRecognizer
217 @end
218
219 @interface _UIWebHighlightLongPressGestureRecognizer ()
220 - (void)cancel;
221 @end
222
223 @interface UIPeripheralHost : NSObject <UIGestureRecognizerDelegate>
224 @end
225
226 @class UIKeyboardRotationState;
227
228 @interface UIPeripheralHost ()
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 ()
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 ()
247 + (CGSize)defaultSizeForCurrentOrientation;
248 - (void)_setUsesCheckedSelection:(BOOL)usesCheckedSelection;
249 @property (nonatomic, setter=_setMagnifierEnabled:) BOOL _magnifierEnabled;
250 @end
251
252 @interface UIResponder ()
253 - (void)_handleKeyUIEvent:(UIEvent *)event;
254 @end
255
256 @class CADisplay;
257 @interface UIScreen ()
258 - (CADisplay *)_display;
259 @end
260
261 @interface UIScrollView ()
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 ()
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 ()
322 - (void)activateSelection;
323 - (void)deactivateSelection;
324 - (void)didEndScrollingOverflow;
325 - (void)selectionChanged;
326 - (void)setGestureRecognizers;
327 - (void)willStartScrollingOverflow;
328 @end
329
330 @interface UIViewController ()
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 // FIXME: Separate the parts we are simply re-declaring from the ones we are overriding.
351 @interface _UIViewControllerTransitionContext (Details)
352 - (void) _setTransitionIsInFlight:(BOOL)flag;
353 @property (nonatomic, assign, setter=_setAllowUserInteraction:, getter=_allowUserInteraction) BOOL _allowUserInteraction;
354 @property (nonatomic, assign, setter=_setAnimator:) id <UIViewControllerAnimatedTransitioning> _animator;
355 @property (nonatomic, assign, setter=_setContainerView:) UIView *containerView;
356 @property (nonatomic, assign, setter=_setInteractor:) id <UIViewControllerInteractiveTransitioning> _interactor;
357 @property (nonatomic, assign, setter=_setPercentOffset:) CGFloat _percentOffset;
358 @property (nonatomic, copy, setter=_setCompletionHandler:)  void (^_completionHandler)(_UIViewControllerTransitionContext *context, BOOL transitionCompleted);
359 @property (nonatomic, retain, setter=_setContainerViews:) NSArray *_containerViews;
360 @end
361
362 @interface _UIViewControllerOneToOneTransitionContext : _UIViewControllerTransitionContext
363 @end
364
365 @interface _UIViewControllerOneToOneTransitionContext ()
366 @property (nonatomic, assign, setter=_setFromEndFrame:) CGRect fromEndFrame;
367 @property (nonatomic, assign, setter=_setFromStartFrame:) CGRect fromStartFrame;
368 @property (nonatomic, assign, setter=_setToEndFrame:) CGRect toEndFrame;
369 @property (nonatomic, assign, setter=_setToStartFrame:) CGRect toStartFrame;
370 @property (nonatomic, retain, setter=_setFromViewController:) UIViewController *fromViewController;
371 @property (nonatomic, retain, setter=_setToViewController:) UIViewController *toViewController;
372 @end
373
374 @protocol UIViewControllerAnimatedTransitioningEx <UIViewControllerAnimatedTransitioning>
375 - (BOOL)interactionAborted;
376 - (UINavigationControllerOperation) operation;
377 - (UIPercentDrivenInteractiveTransition *)interactionController;
378 - (void)setInteractionAborted:(BOOL)aborted;
379 - (void)setInteractionController:(UIPercentDrivenInteractiveTransition *)controller;
380 - (void)setOperation:(UINavigationControllerOperation)operation;
381 @optional
382 - (UIWindow *)window;
383 @end
384
385 typedef NS_ENUM (NSInteger, _UIBackdropMaskViewFlags) {
386     _UIBackdropMaskViewNone = 0,
387     _UIBackdropMaskViewGrayscaleTint = 1 << 0,
388     _UIBackdropMaskViewColorTint = 1 << 1,
389     _UIBackdropMaskViewFilters = 1 << 2,
390     _UIBackdropMaskViewAll = _UIBackdropMaskViewGrayscaleTint | _UIBackdropMaskViewColorTint | _UIBackdropMaskViewFilters,
391 };
392
393 @interface UIView ()
394 + (BOOL)_isInAnimationBlock;
395 - (CGSize)size;
396 - (void)setFrameOrigin:(CGPoint)origin;
397 - (void)setSize:(CGSize)size;
398 @property (nonatomic, assign, setter=_setBackdropMaskViewFlags:) NSInteger _backdropMaskViewFlags;
399 @end
400
401 @interface UIWebSelectionAssistant : NSObject <UIGestureRecognizerDelegate>
402 @end
403
404 @interface UIWebSelectionAssistant ()
405 - (BOOL)isSelectionGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer;
406 - (id)initWithView:(UIView *)view;
407 - (void)clearSelection;
408 - (void)didEndScrollingOrZoomingPage;
409 - (void)didEndScrollingOverflow;
410 - (void)resignedFirstResponder;
411 - (void)selectionChanged;
412 - (void)setGestureRecognizers;
413 - (void)willStartScrollingOrZoomingPage;
414 - (void)willStartScrollingOverflow;
415 @property (nonatomic, readonly) CGRect selectionFrame;
416 @end
417
418 typedef NS_ENUM(NSInteger, UIWKSelectionTouch) {
419     UIWKSelectionTouchStarted = 0,
420     UIWKSelectionTouchMoved = 1,
421     UIWKSelectionTouchEnded = 2,
422     UIWKSelectionTouchEndedMovingForward = 3,
423     UIWKSelectionTouchEndedMovingBackward = 4,
424     UIWKSelectionTouchEndedNotMoving = 5,
425 };
426
427 typedef NS_ENUM(NSInteger, UIWKSelectionFlags) {
428     UIWKNone = 0,
429     UIWKWordIsNearTap = 1,
430     UIWKIsBlockSelection = 2,
431     UIWKPhraseBoundaryChanged = 4,
432 };
433
434 typedef NS_ENUM(NSInteger, UIWKGestureType) {
435     UIWKGestureLoupe = 0,
436     UIWKGestureOneFingerTap = 1,
437     UIWKGestureTapAndAHalf = 2,
438     UIWKGestureDoubleTap = 3,
439     UIWKGestureTapAndHalf = 4,
440     UIWKGestureDoubleTapInUneditable = 5,
441     UIWKGestureOneFingerTapInUneditable = 6,
442     UIWKGestureOneFingerTapSelectsAll = 7,
443     UIWKGestureOneFingerDoubleTap = 8,
444     UIWKGestureOneFingerTripleTap = 9,
445     UIWKGestureTwoFingerSingleTap = 10,
446     UIWKGestureTwoFingerRangedSelectGesture = 11,
447     UIWKGestureTapOnLinkWithGesture = 12,
448     UIWKGestureMakeWebSelection = 13,
449     UIWKGesturePhraseBoundary = 14,
450 };
451
452 @interface UIWKSelectionAssistant : UIWebSelectionAssistant
453 @end
454
455 @interface UIWKSelectionAssistant ()
456 - (BOOL)shouldHandleSingleTapAtPoint:(CGPoint)point;
457 - (void)blockSelectionChangedWithTouch:(UIWKSelectionTouch)touch withFlags:(UIWKSelectionFlags)flags growThreshold:(CGFloat)grow shrinkThreshold:(CGFloat)shrink;
458 - (void)selectionChangedWithGestureAt:(CGPoint)point withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)gestureState withFlags:(UIWKSelectionFlags)flags;
459 - (void)selectionChangedWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch withFlags:(UIWKSelectionFlags)flags;
460 - (void)selectionChangedWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch;
461 - (void)showDictionaryFor:(NSString *)selectedTerm fromRect:(CGRect)presentationRect;
462 @property (nonatomic, readonly) UILongPressGestureRecognizer *selectionLongPressRecognizer;
463 @end
464
465 typedef NS_ENUM(NSInteger, UIWKHandlePosition) {
466     UIWKHandleTop = 0,
467     UIWKHandleRight = 1,
468     UIWKHandleBottom = 2,
469     UIWKHandleLeft = 3,
470 };
471
472 @interface UIWKAutocorrectionRects : NSObject
473 @end
474
475 @interface UIWKAutocorrectionRects (UIWKAutocorrectionRectsDetails)
476 @property (nonatomic, assign) CGRect firstRect;
477 @property (nonatomic, assign) CGRect lastRect;
478 @end
479
480 @interface UIWKAutocorrectionContext : NSObject
481 @end
482
483 @interface UIWKAutocorrectionContext (UIWKAutocorrectionContextDetails)
484 @property (nonatomic, copy) NSString *contextBeforeSelection;
485 @property (nonatomic, copy) NSString *selectedText;
486 @property (nonatomic, copy) NSString *contextAfterSelection;
487 @property (nonatomic, copy) NSString *markedText;
488 @property (nonatomic, assign) NSRange rangeInMarkedText;
489 @end
490
491 @interface UIWKTextInteractionAssistant : UITextInteractionAssistant
492 @end
493
494 @interface UIWKTextInteractionAssistant (UIWKTextInteractionAssistantDetails)
495 - (void)selectionChangedWithGestureAt:(CGPoint)point withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)gestureState withFlags:(UIWKSelectionFlags)flags;
496 - (void)showDictionaryFor:(NSString *)selectedTerm fromRect:(CGRect)presentationRect;
497 - (void)selectionChangedWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch;
498 - (void)showTextStyleOptions;
499 - (void)hideTextStyleOptions;
500
501 @property (nonatomic, readonly, retain) UITapGestureRecognizer *singleTapGesture;
502 @property (nonatomic, readonly, retain) UILongPressGestureRecognizer *loupeGesture;
503 @end
504
505 @protocol UIWKInteractionViewProtocol
506 - (void)changeSelectionWithGestureAt:(CGPoint)point withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)state;
507
508 - (void)changeSelectionWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch baseIsStart:(BOOL)baseIsStart;
509 - (void)changeSelectionWithTouchesFrom:(CGPoint)from to:(CGPoint)to withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)gestureState;
510 - (CGRect)textFirstRect;
511 - (CGRect)textLastRect;
512
513 - (void)requestAutocorrectionContextWithCompletionHandler:(void (^)(UIWKAutocorrectionContext *autocorrectionContext))completionHandler;
514
515 - (void)requestAutocorrectionRectsForString:(NSString *)input withCompletionHandler:(void (^)(UIWKAutocorrectionRects *rectsForInput))completionHandler;
516
517 - (void)applyAutocorrection:(NSString *)correction toString:(NSString *)input withCompletionHandler:(void (^)(UIWKAutocorrectionRects *rectsForCorrection))completionHandler;
518
519 - (NSString *)markedText;
520 - (BOOL)hasMarkedText;
521
522 - (BOOL)hasSelectablePositionAtPoint:(CGPoint)point;
523 - (BOOL)pointIsInAssistedNode:(CGPoint)point;
524 - (NSArray *)webSelectionRects;
525 - (void)_cancelLongPressGestureRecognizer;
526
527 @optional
528 - (void)changeSelectionWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch baseIsStart:(BOOL)baseIsStart withFlags:(UIWKSelectionFlags)flags;
529 - (void)changeBlockSelectionWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch forHandle:(UIWKHandlePosition)handle;
530 - (void)clearSelection;
531 - (void)replaceDictatedText:(NSString *)oldText withText:(NSString *)newText;
532 - (void)requestDictationContext:(void (^)(NSString *selectedText, NSString *prefixText, NSString *postfixText))completionHandler;
533 - (BOOL)pointIsNearMarkedText:(CGPoint)point;
534 - (NSString *)selectedText;
535 - (void)replaceText:(NSString *)text withText:(NSString *)word;
536 - (void)selectWordForReplacement;
537 - (BOOL)isReplaceAllowed;
538 - (void)selectWordBackward;
539 - (UIView *)unscaledView;
540 - (CGFloat)inverseScale;
541 - (CGRect)unobscuredContentRect;
542 @end
543
544 typedef enum {
545     UIWebSelectionModeWeb = 0,
546     UIWebSelectionModeTextOnly = 1,
547 } UIWebSelectionMode;
548
549 @protocol UIWebFormAccessoryDelegate;
550
551 @interface UIWebFormAccessory : UIInputView
552 @end
553
554 @interface UIWebFormAccessory ()
555 - (void)hideAutoFillButton;
556 - (void)setClearVisible:(BOOL)flag;
557 - (void)showAutoFillButtonWithTitle:(NSString *)title;
558 @property (nonatomic, retain) UIBarButtonItem *_autofill;
559 @property (nonatomic, assign) id <UIWebFormAccessoryDelegate> delegate;
560
561 @property (nonatomic, assign, getter=isNextEnabled) BOOL nextEnabled;
562 @property (nonatomic, assign, getter=isPreviousEnabled) BOOL previousEnabled;
563 @end
564
565 @protocol UIWebFormAccessoryDelegate
566 - (void)accessoryAutoFill;
567 - (void)accessoryClear;
568 - (void)accessoryDone;
569 - (void)accessoryTab:(BOOL)isNext;
570 @end
571
572 @interface UIWebGeolocationPolicyDecider : NSObject
573 @end
574
575 @interface UIWebGeolocationPolicyDecider ()
576 + (instancetype)sharedPolicyDecider;
577 - (void)decidePolicyForGeolocationRequestFromOrigin:(id)securityOrigin requestingURL:(NSURL *)requestingURL window:(UIWindow *)window listener:(id)listener;
578 @end
579
580 typedef enum {
581     UIWebTouchEventTouchBegin = 0,
582     UIWebTouchEventTouchChange = 1,
583     UIWebTouchEventTouchEnd = 2,
584     UIWebTouchEventTouchCancel = 3,
585 } UIWebTouchEventType;
586
587 struct _UIWebTouchPoint {
588     CGPoint locationInScreenCoordinates;
589     CGPoint locationInDocumentCoordinates;
590     unsigned identifier;
591     UITouchPhase phase;
592     CGFloat majorRadiusInScreenCoordinates;
593 };
594
595 struct _UIWebTouchEvent {
596     UIWebTouchEventType type;
597     NSTimeInterval timestamp;
598     CGPoint locationInScreenCoordinates;
599     CGPoint locationInDocumentCoordinates;
600     CGFloat scale;
601     CGFloat rotation;
602
603     bool inJavaScriptGesture;
604
605     struct _UIWebTouchPoint* touchPoints;
606     unsigned touchPointCount;
607
608 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000
609     bool isPotentialTap;
610 #endif
611 };
612
613 @protocol UIWebTouchEventsGestureRecognizerDelegate
614 - (BOOL)isAnyTouchOverActiveArea:(NSSet *)touches;
615 - (BOOL)shouldIgnoreWebTouch;
616 @end
617
618 @interface UIWebTouchEventsGestureRecognizer : UIGestureRecognizer
619 @end
620
621 @interface UIWebTouchEventsGestureRecognizer ()
622 - (id)initWithTarget:(id)target action:(SEL)action touchDelegate:(id <UIWebTouchEventsGestureRecognizerDelegate>)delegate;
623 @property (nonatomic, getter=isDefaultPrevented) BOOL defaultPrevented;
624 @property (nonatomic, readonly) BOOL inJavaScriptGesture;
625 @property (nonatomic, readonly) CGPoint locationInWindow;
626 @property (nonatomic, readonly) UIWebTouchEventType type;
627 @property (nonatomic, readonly) const struct _UIWebTouchEvent *lastTouchEvent;
628 @end
629
630 typedef NS_ENUM(NSInteger, _UIBackdropViewStylePrivate) {
631     _UIBackdropViewStyle_Light = 2020,
632     _UIBackdropViewStyle_Dark = 2030
633 };
634
635 @interface _UIBackdropView : UIView
636 @end
637
638 @interface _UIBackdropView (_UIBackdropViewDetails)
639 - (instancetype)initWithPrivateStyle:(_UIBackdropViewStylePrivate)style;
640 - (instancetype)initWithFrame:(CGRect)frame privateStyle:(_UIBackdropViewStylePrivate)style;
641 @property (nonatomic, strong, readonly) UIView *contentView;
642 @end
643
644 @interface _UIHighlightView : UIView
645 @end
646
647 @interface _UIHighlightView ()
648 - (void)setColor:(UIColor *)aColor;
649 - (void)setCornerRadii:(NSArray *)cornerRadii;
650 - (void)setCornerRadius:(CGFloat)aCornerRadius;
651 - (void)setFrames:(NSArray *)frames boundaryRect:(CGRect)aBoundarRect;
652 - (void)setQuads:(NSArray *)quads boundaryRect:(CGRect)aBoundaryRect;
653 @end
654
655 @interface _UINavigationParallaxTransition : NSObject <UIViewControllerAnimatedTransitioningEx>
656 @end
657
658 @interface _UINavigationParallaxTransition ()
659 - (instancetype) initWithCurrentOperation:(UINavigationControllerOperation)operation;
660 @end
661
662 @protocol _UINavigationInteractiveTransitionBaseDelegate;
663
664 @interface _UINavigationInteractiveTransitionBase : UIPercentDrivenInteractiveTransition <UIGestureRecognizerDelegate>
665 @end
666
667 @interface _UINavigationInteractiveTransitionBase ()
668 - (id)initWithGestureRecognizerView:(UIView *)gestureRecognizerView animator:(id<UIViewControllerAnimatedTransitioning>)animator delegate:(id<_UINavigationInteractiveTransitionBaseDelegate>)delegate;
669 @property (nonatomic, assign) BOOL shouldReverseTranslation;
670 @property (nonatomic, retain) _UINavigationParallaxTransition *animationController;
671 @end
672
673 @protocol _UINavigationInteractiveTransitionBaseDelegate <NSObject>
674 - (void)startInteractiveTransition:(_UINavigationInteractiveTransitionBase *)interactiveTransition;
675 - (BOOL)shouldBeginInteractiveTransition:(_UINavigationInteractiveTransitionBase *)interactiveTransition;
676 - (BOOL)interactiveTransition:(_UINavigationInteractiveTransitionBase *)interactiveTransition gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;
677 - (BOOL)interactiveTransition:(_UINavigationInteractiveTransitionBase *)interactiveTransition gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch;
678 - (UIPanGestureRecognizer *)gestureRecognizerForInteractiveTransition:(_UINavigationInteractiveTransitionBase *)interactiveTransition WithTarget:(id)target action:(SEL)action;
679 @end
680
681 @class BKSAnimationFenceHandle;
682
683 @interface UIWindow ()
684 + (BKSAnimationFenceHandle *)_synchronizedDrawingFence;
685 + (mach_port_t)_synchronizeDrawingAcrossProcesses;
686 - (void)_setWindowResolution:(CGFloat)resolution displayIfChanged:(BOOL)displayIfChanged;
687 @end
688
689 @interface UIWebScrollView : UIScrollView
690 @end
691
692 @interface UIWebTiledView : UIView
693 @end
694
695 @class WAKWindow;
696
697 @interface UIWebTiledView ()
698 - (void)setWAKWindow:(WAKWindow *)window;
699 @end
700
701 @interface UIWebDocumentView : UIWebTiledView
702 @end
703
704 typedef enum {
705     UIEveryDocumentMask = 0xFFFFFF,
706 } UIDocumentMask;
707
708 @interface UIWebDocumentView ()
709 - (void)setDelegate:(id)delegate;
710 - (void)setAutoresizes:(BOOL)flag;
711 - (void)setMinimumSize:(CGSize)aSize;
712 - (void)setInitialScale:(float)aScale forDocumentTypes:(UIDocumentMask)aDocumentMask;
713 - (void)setViewportSize:(CGSize)aSize forDocumentTypes:(UIDocumentMask)aDocumentMask;
714 - (void)setMinimumScale:(float)aScale forDocumentTypes:(UIDocumentMask)aDocumentMask;
715 - (void)setMaximumScale:(float)aScale forDocumentTypes:(UIDocumentMask)aDocumentMask;
716 @end
717
718 @interface UIWebBrowserView : UIWebDocumentView
719 @end
720
721 @class WebView;
722
723 @interface UIWebBrowserView ()
724 - (WebView *)webView;
725 - (void)setPaused:(BOOL)paused;
726 - (void)sendScrollEventIfNecessaryWasUserScroll:(BOOL)userScroll;
727 @property (nonatomic) BOOL inputViewObeysDOMFocus;
728 @end
729
730 @interface UIDocumentMenuViewController ()
731 @property (nonatomic, assign, setter = _setIgnoreApplicationEntitlementForImport:, getter = _ignoreApplicationEntitlementForImport) BOOL _ignoreApplicationEntitlementForImport;
732 @end
733
734 @protocol UIDocumentPasswordViewDelegate;
735
736 @interface UIDocumentPasswordView : UIView <UITextFieldDelegate>
737 @end
738
739 @interface UIDocumentPasswordView ()
740
741 - (id)initWithDocumentName:(NSString *)documentName;
742
743 @property (nonatomic, assign) NSObject<UIDocumentPasswordViewDelegate> *passwordDelegate;
744 @property (nonatomic, readonly) UITextField *passwordField;
745
746 @end
747
748 @protocol UIDocumentPasswordViewDelegate
749
750 @required
751
752 - (void)userDidEnterPassword:(NSString *)password forPasswordView:(UIDocumentPasswordView *)passwordView;
753
754 @optional
755
756 - (void)didBeginEditingPassword:(UITextField *)passwordField inView:(UIDocumentPasswordView *)passwordView;
757 - (void)didEndEditingPassword:(UITextField *)passwordField inView:(UIDocumentPasswordView *)passwordView;
758
759 @end
760
761 #endif // USE(APPLE_INTERNAL_SDK)
762
763 @interface UIView (IPI)
764 - (UIScrollView *)_scroller;
765 - (CGPoint)accessibilityConvertPointFromSceneReferenceCoordinates:(CGPoint)point;
766 - (CGRect)accessibilityConvertRectToSceneReferenceCoordinates:(CGRect)rect;
767 @end
768
769 WTF_EXTERN_C_BEGIN
770
771 BOOL UIKeyboardEnabledInputModesAllowOneToManyShortcuts();
772 BOOL UIKeyboardEnabledInputModesAllowChineseTransliterationForText(NSString *);
773 BOOL UIKeyboardCurrentInputModeAllowsChineseOrJapaneseReanalysisForText(NSString *);
774
775 extern const float UITableCellDefaultFontSize;
776 extern const float UITableViewCellDefaultFontSize;
777
778 extern NSString * const UIWindowDidMoveToScreenNotification;
779 extern NSString * const UIWindowDidRotateNotification;
780 extern NSString * const UIWindowNewScreenUserInfoKey;
781 extern NSString * const UIWindowWillRotateNotification;
782
783 extern NSString * const UIKeyboardIsLocalUserInfoKey;
784
785 extern UIApplication *UIApp;
786 BOOL _UIApplicationIsExtension(void);
787 void _UIApplicationLoadWebKit(void);
788 BOOL _UIApplicationUsesLegacyUI(void);
789
790 void UIImageDataWriteToSavedPhotosAlbum(NSData *imageData, id completionTarget, SEL completionSelector, void *contextInfo);
791
792 UIImage* _UIImageGetWebKitPhotoLibraryIcon(void);
793 UIImage* _UIImageGetWebKitTakePhotoOrVideoIcon(void);
794
795 extern const float UIWebViewGrowsAndShrinksToFitHeight;
796 extern const float UIWebViewScalesToFitScale;
797 extern const float UIWebViewStandardViewportWidth;
798
799 extern NSString *const UIKeyInputPageUp;
800 extern NSString *const UIKeyInputPageDown;
801
802 WTF_EXTERN_C_END