Don't register for Lookup notifications until needed
[WebKit-https.git] / Source / WebKit2 / UIProcess / API / mac / WKViewInternal.h
1 /*
2  * Copyright (C) 2010 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 "WKViewPrivate.h"
27
28 #import "APIObject.h"
29 #import "PluginComplexTextInputState.h"
30 #import "SameDocumentNavigationType.h"
31 #import "WebFindOptions.h"
32 #import "WebHitTestResult.h"
33 #import <wtf/Forward.h>
34 #import <wtf/RetainPtr.h>
35 #import <wtf/Vector.h>
36
37 @class WKWebViewConfiguration;
38
39 namespace API {
40 class Object;
41 }
42
43 namespace IPC {
44 class DataReference;
45 }
46
47 namespace WebCore {
48 class Image;
49 class SharedBuffer;
50 class TextIndicator;
51 struct KeypressCommand;
52 }
53
54 namespace WebKit {
55 class DrawingAreaProxy;
56 class LayerTreeContext;
57 class ViewSnapshot;
58 class WebProcessPool;
59 struct ColorSpaceData;
60 struct EditorState;
61 struct WebPageConfiguration;
62 }
63
64 @class WKFullScreenWindowController;
65 @class WKWebView;
66 #if WK_API_ENABLED
67 @class _WKThumbnailView;
68 #endif
69
70 @interface WKView ()
71 #if WK_API_ENABLED
72 - (instancetype)initWithFrame:(CGRect)frame processPool:(WebKit::WebProcessPool&)processPool configuration:(WebKit::WebPageConfiguration)webPageConfiguration webView:(WKWebView *)webView;
73 #endif
74
75 - (std::unique_ptr<WebKit::DrawingAreaProxy>)_createDrawingAreaProxy;
76 - (BOOL)_isFocused;
77 - (void)_processDidExit;
78 - (void)_pageClosed;
79 - (void)_didRelaunchProcess;
80 - (void)_preferencesDidChange;
81 - (void)_toolTipChangedFrom:(NSString *)oldToolTip to:(NSString *)newToolTip;
82 - (void)_setUserInterfaceItemState:(NSString *)commandName enabled:(BOOL)isEnabled state:(int)newState;
83 - (void)_doneWithKeyEvent:(NSEvent *)event eventWasHandled:(BOOL)eventWasHandled;
84 - (bool)_executeSavedCommandBySelector:(SEL)selector;
85 - (void)_setIntrinsicContentSize:(NSSize)intrinsicContentSize;
86 - (NSRect)_convertToDeviceSpace:(NSRect)rect;
87 - (NSRect)_convertToUserSpace:(NSRect)rect;
88 - (void)_setTextIndicator:(WebCore::TextIndicator&)textIndicator;
89 - (void)_setTextIndicator:(WebCore::TextIndicator&)textIndicator withLifetime:(WebCore::TextIndicatorLifetime)lifetime;
90 - (void)_clearTextIndicatorWithAnimation:(WebCore::TextIndicatorDismissalAnimation)animation;
91 - (void)_setTextIndicatorAnimationProgress:(float)progress;
92 - (void)_selectionChanged;
93
94 - (void)_setAcceleratedCompositingModeRootLayer:(CALayer *)rootLayer;
95 - (CALayer *)_acceleratedCompositingModeRootLayer;
96
97 - (PassRefPtr<WebKit::ViewSnapshot>)_takeViewSnapshot;
98 - (void)_wheelEventWasNotHandledByWebCore:(NSEvent *)event;
99
100 - (void)_setAccessibilityWebProcessToken:(NSData *)data;
101
102 - (void)_pluginFocusOrWindowFocusChanged:(BOOL)pluginHasFocusAndWindowHasFocus pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier;
103 - (void)_setPluginComplexTextInputState:(WebKit::PluginComplexTextInputState)pluginComplexTextInputState pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier;
104 - (void)_dragImageForView:(NSView *)view withImage:(NSImage *)image at:(NSPoint)clientPoint linkDrag:(BOOL)linkDrag;
105 - (void)_setPromisedDataForImage:(WebCore::Image *)image withFileName:(NSString *)filename withExtension:(NSString *)extension withTitle:(NSString *)title withURL:(NSString *)url withVisibleURL:(NSString *)visibleUrl withArchive:(WebCore::SharedBuffer*) archiveBuffer forPasteboard:(NSString *)pasteboardName;
106 #if ENABLE(ATTACHMENT_ELEMENT)
107 - (void)_setPromisedDataForAttachment:(NSString *)filename withExtension:(NSString *)extension withTitle:(NSString *)title withURL:(NSString *)url withVisibleURL:(NSString *)visibleUrl forPasteboard:(NSString *)pasteboardName;
108 #endif
109 - (void)_updateSecureInputState;
110 - (void)_resetSecureInputState;
111 - (void)_notifyInputContextAboutDiscardedComposition;
112
113 - (WebKit::ColorSpaceData)_colorSpace;
114
115 - (void)_cacheWindowBottomCornerRect;
116
117 - (NSInteger)spellCheckerDocumentTag;
118 - (void)handleAcceptedAlternativeText:(NSString*)text;
119
120 - (void)_setSuppressVisibilityUpdates:(BOOL)suppressVisibilityUpdates;
121 - (BOOL)_suppressVisibilityUpdates;
122
123 - (void)_didFirstVisuallyNonEmptyLayoutForMainFrame;
124 - (void)_didFinishLoadForMainFrame;
125 - (void)_didSameDocumentNavigationForMainFrame:(WebKit::SameDocumentNavigationType)type;
126 - (void)_removeNavigationGestureSnapshot;
127
128 #if WK_API_ENABLED
129 @property (nonatomic, setter=_setThumbnailView:) _WKThumbnailView *_thumbnailView;
130 - (void)_reparentLayerTreeInThumbnailView;
131 #endif
132
133 - (void)_windowDidOrderOnScreen:(NSNotification *)notification;
134 - (void)_windowDidOrderOffScreen:(NSNotification *)notification;
135
136 - (void)_addFontPanelObserver;
137 // FullScreen
138
139 @property (readonly) BOOL _hasFullScreenWindowController;
140 @property (readonly) WKFullScreenWindowController *_fullScreenWindowController;
141 - (void)_closeFullScreenWindowController;
142
143 - (void)_prepareForDictionaryLookup;
144
145 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
146 - (void)_didPerformActionMenuHitTest:(const WebKit::WebHitTestResult::Data&)hitTestResult forImmediateAction:(BOOL)forImmediateAction contentPreventsDefault:(BOOL)contentPreventsDefault userData:(API::Object*)userData;
147 #endif
148
149 @property (nonatomic, retain, setter=_setPrimaryTrackingArea:) NSTrackingArea *_primaryTrackingArea;
150
151 @property (readonly) NSWindow *_targetWindowForMovePreparation;
152
153 // For WKViewLayoutStrategy and subclasses:
154 - (void)_setDrawingAreaSize:(NSSize)size;
155 - (void)_updateViewExposedRect;
156 - (CALayer *)_rootLayer;
157
158 @end