[iOS] Replace "node assistance" terminology in WebKit with "focused element"
[WebKit-https.git] / Source / WebKit / UIProcess / ios / WKContentView.h
1 /*
2  * Copyright (C) 2013, 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 "WKApplicationStateTrackingView.h"
27 #import "WKBase.h"
28 #import "WKBrowsingContextController.h"
29 #import "WKBrowsingContextGroup.h"
30 #import "WKProcessGroup.h"
31 #import <wtf/RetainPtr.h>
32
33 @class WKContentView;
34 @class WKWebView;
35
36 namespace API {
37 class PageConfiguration;
38 }
39
40 namespace WebCore {
41 struct Highlight;
42 }
43
44 namespace WebKit {
45 class DrawingAreaProxy;
46 class RemoteLayerTreeTransaction;
47 class WebFrameProxy;
48 class WebPageProxy;
49 class WebProcessPool;
50 }
51
52 @interface WKContentView : WKApplicationStateTrackingView {
53 @package
54     RefPtr<WebKit::WebPageProxy> _page;
55     WKWebView *_webView;
56 }
57
58 #pragma clang diagnostic push
59 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
60 @property (nonatomic, readonly) WKBrowsingContextController *browsingContextController;
61 #pragma clang diagnostic pop
62
63 @property (nonatomic, readonly) WebKit::WebPageProxy* page;
64 @property (nonatomic, readonly) BOOL isFocusingElement;
65 @property (nonatomic, getter=isShowingInspectorIndication) BOOL showingInspectorIndication;
66 @property (nonatomic, readonly, getter=isResigningFirstResponder) BOOL resigningFirstResponder;
67 @property (nonatomic) BOOL sizeChangedSinceLastVisibleContentRectUpdate;
68
69 - (instancetype)initWithFrame:(CGRect)frame processPool:(WebKit::WebProcessPool&)processPool configuration:(Ref<API::PageConfiguration>&&)configuration webView:(WKWebView *)webView;
70
71 - (void)didUpdateVisibleRect:(CGRect)visibleRect
72     unobscuredRect:(CGRect)unobscuredRect
73     unobscuredRectInScrollViewCoordinates:(CGRect)unobscuredRectInScrollViewCoordinates
74     obscuredInsets:(UIEdgeInsets)obscuredInsets
75     unobscuredSafeAreaInsets:(UIEdgeInsets)unobscuredSafeAreaInsets
76     inputViewBounds:(CGRect)inputViewBounds
77     scale:(CGFloat)scale minimumScale:(CGFloat)minimumScale
78     inStableState:(BOOL)isStableState
79     isChangingObscuredInsetsInteractively:(BOOL)isChangingObscuredInsetsInteractively
80     enclosedInScrollableAncestorView:(BOOL)enclosedInScrollableAncestorView;
81
82 - (void)didFinishScrolling;
83 - (void)didInterruptScrolling;
84 - (void)didZoomToScale:(CGFloat)scale;
85 - (void)willStartZoomOrScroll;
86
87 - (void)_webViewDestroyed;
88
89 - (std::unique_ptr<WebKit::DrawingAreaProxy>)_createDrawingAreaProxy;
90 - (void)_processDidExit;
91 - (void)_processWillSwap;
92 - (void)_didRelaunchProcess;
93 - (void)_setAcceleratedCompositingRootView:(UIView *)rootView;
94
95 - (void)_showInspectorHighlight:(const WebCore::Highlight&)highlight;
96 - (void)_hideInspectorHighlight;
97
98 - (void)_didCommitLoadForMainFrame;
99 - (void)_didCommitLayerTree:(const WebKit::RemoteLayerTreeTransaction&)layerTreeTransaction;
100 - (void)_layerTreeCommitComplete;
101
102 - (void)_setAccessibilityWebProcessToken:(NSData *)data;
103
104 - (BOOL)_scrollToRect:(CGRect)targetRect withOrigin:(CGPoint)origin minimumScrollDistance:(CGFloat)minimumScrollDistance;
105 - (void)_zoomToFocusRect:(CGRect)rectToFocus selectionRect:(CGRect)selectionRect insideFixed:(BOOL)insideFixed fontSize:(float)fontSize minimumScale:(double)minimumScale maximumScale:(double)maximumScale allowScaling:(BOOL)allowScaling forceScroll:(BOOL)forceScroll;
106 - (BOOL)_zoomToRect:(CGRect)targetRect withOrigin:(CGPoint)origin fitEntireRect:(BOOL)fitEntireRect minimumScale:(double)minimumScale maximumScale:(double)maximumScale minimumScrollDistance:(CGFloat)minimumScrollDistance;
107 - (void)_zoomOutWithOrigin:(CGPoint)origin;
108 - (void)_zoomToInitialScaleWithOrigin:(CGPoint)origin;
109
110 @end