2 * Copyright (C) 2006 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
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.
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.
28 #import "WebDefaultUIKitDelegate.h"
31 #import "WebUIDelegate.h"
33 static WebDefaultUIKitDelegate *sharedDelegate = nil;
35 @implementation WebDefaultUIKitDelegate
37 + (WebDefaultUIKitDelegate *)sharedUIKitDelegate
39 if (!sharedDelegate) {
40 sharedDelegate = [[WebDefaultUIKitDelegate alloc] init];
42 return sharedDelegate;
45 - (CGPoint)contentsPointForWebView:(WebView *)aWebView
50 - (CGRect)documentVisibleRectForWebView:(WebView *)aWebView
55 - (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame
60 - (void)webView:(WebView *)sender didCommitLoadForFrame:(WebFrame *)frame
65 - (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
70 - (void)webView:(WebView *)webView saveStateToHistoryItem:(WebHistoryItem *)item forFrame:(WebFrame *)frame
75 - (void)webView:(WebView *)webView restoreStateFromHistoryItem:(WebHistoryItem *)item forFrame:(WebFrame *)frame force:(BOOL)force
80 - (void)webView:(WebView *)aWebView didReceiveViewportArguments:(NSDictionary *)arguments
85 - (void)webView:(WebView *)aWebView needsScrollNotifications:(NSNumber *)aNumber forFrame:(WebFrame *)aFrame
90 - (void)webView:(WebView *)aWebView didObserveDeferredContentChange:(WKContentChange)aChange forFrame:(WebFrame *)frame
95 - (void)webViewDidPreventDefaultForEvent:(WebView *)webView
99 - (BOOL)webView:(WebView *)webView shouldScrollToPoint:(CGPoint)point forFrame:(WebFrame *)frame
104 - (void)webView:(WebView *)webView willCloseFrame:(WebFrame *)frame
109 - (void)webView:(WebView *)webView didFinishDocumentLoadForFrame:(WebFrame *)frame
114 - (void)webView:(WebView *)sender didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame
118 - (void)webView:(WebView *)sender didChangeLocationWithinPageForFrame:(WebFrame *)frame
122 - (void)webView:(WebView *)webView didFirstLayoutInFrame:(WebFrame *)frame
127 - (void)webView:(WebView *)webView didFirstVisuallyNonEmptyLayoutInFrame:(WebFrame *)frame
131 - (void)webView:(WebView *)webView elementDidFocusNode:(DOMNode *)node
135 - (void)webView:(WebView *)webView elementDidBlurNode:(DOMNode *)node
139 - (void)webViewDidRestoreFromPageCache:(WebView *)webView
143 - (void)webViewDidReceiveMobileDocType:(WebView *)webView
148 - (NSView *)webView:(WebView *)webView plugInViewWithArguments:(NSDictionary *)arguments fromPlugInPackage:(WebPluginPackage *)package
153 - (void)webView:(WebView *)webView willShowFullScreenForPlugInView:(id)plugInView
157 - (void)webView:(WebView *)webView didHideFullScreenForPlugInView:(id)plugInView
161 - (void)webView:(WebView *)aWebView didReceiveMessage:(NSDictionary *)aMessage
165 - (void)addInputString:(NSString *)str withFlags:(NSUInteger)flags
169 // FIXME: to be removed when UIKit implements the new one below.
170 - (void)deleteFromInput
174 - (void)deleteFromInputWithFlags:(NSUInteger)flags
178 - (void)_webthread_webView:(WebView *)sender attachRootLayer:(id)layer
182 - (void)webViewDidCommitCompositingLayerChanges:(WebView*)webView
186 - (void)webView:(WebView*)webView didCreateOrUpdateScrollingLayer:(id)layer withContentsLayer:(id)contentsLayer scrollSize:(NSValue*)sizeValue forNode:(DOMNode *)node
187 allowHorizontalScrollbar:(BOOL)allowHorizontalScrollbar allowVerticalScrollbar:(BOOL)allowVerticalScrollbar
191 - (void)webView:(WebView*)webView willRemoveScrollingLayer:(id)layer withContentsLayer:(id)contentsLayer forNode:(DOMNode *)node
195 - (void)revealedSelectionByScrollingWebFrame:(WebFrame *)webFrame
199 - (void)webViewDidLayout:(WebView *)webView
203 - (void)webViewDidStartOverflowScroll:(WebView *)webView
207 - (void)webViewDidEndOverflowScroll:(WebView *)webView
211 - (void)webView:(WebView *)webView runOpenPanelForFileButtonWithResultListener:(id<WebOpenPanelResultListener>)resultListener configuration:(NSDictionary *)configuration
213 [resultListener cancel];
216 - (NSArray *)checkSpellingOfString:(NSString *)stringToCheck
221 - (void)writeDataToPasteboard:(NSDictionary *)representations
225 - (NSArray*)readDataFromPasteboard:(NSString*)type withIndex:(NSInteger)index
230 - (NSInteger)getPasteboardItemsCount
235 - (NSArray*)supportedPasteboardTypesForCurrentSelection
240 - (CGPoint)interactionLocation
245 - (void)showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(CGRect)elementRect
249 #if ENABLE(ORIENTATION_EVENTS)
250 - (int)deviceOrientation
256 - (BOOL)hasRichlyEditableSelection
261 - (BOOL)performsTwoStepPaste:(DOMDocumentFragment*)fragment
266 - (BOOL)performTwoStepDrop:(DOMDocumentFragment *)fragment atDestination:(DOMRange *)destination isMove:(BOOL)isMove
271 - (NSInteger)getPasteboardChangeCount
276 - (BOOL)isUnperturbedDictationResultMarker:(id)metadataForMarker
281 - (void)webView:(WebView *)webView willAddPlugInView:(id)plugInView
285 - (void)webViewDidDrawTiles:(WebView *)webView
289 - (void)webView:(WebView *)webView addMessageToConsole:(NSDictionary *)message withSource:(NSString *)source
294 #endif // PLATFORM(IOS)