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