1 /* 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 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 * 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of 14 * its contributors may be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY 18 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 // This header contains WebView declarations that can be used anywhere in WebKit, but are neither SPI nor API. 30 31 #import "WebTypesInternal.h" 32 33 @class WebView; 34 35 struct WebResourceDelegateImplementationCache { 36 IMP didCancelAuthenticationChallengeFunc; 37 IMP didReceiveAuthenticationChallengeFunc; 38 IMP identifierForRequestFunc; 39 IMP willSendRequestFunc; 40 IMP didReceiveResponseFunc; 41 IMP didReceiveContentLengthFunc; 42 IMP didFinishLoadingFromDataSourceFunc; 43 IMP didFailLoadingWithErrorFromDataSourceFunc; 44 IMP didLoadResourceFromMemoryCacheFunc; 45 IMP willCacheResponseFunc; 46 IMP plugInFailedWithErrorFunc; 47 IMP shouldUseCredentialStorageFunc; 48 }; 49 50 struct WebFrameLoadDelegateImplementationCache { 51 IMP didClearWindowObjectForFrameFunc; 52 IMP didClearWindowObjectForFrameInScriptWorldFunc; 53 IMP didClearInspectorWindowObjectForFrameFunc; 54 IMP windowScriptObjectAvailableFunc; 55 IMP didHandleOnloadEventsForFrameFunc; 56 IMP didReceiveServerRedirectForProvisionalLoadForFrameFunc; 57 IMP didCancelClientRedirectForFrameFunc; 58 IMP willPerformClientRedirectToURLDelayFireDateForFrameFunc; 59 IMP didChangeLocationWithinPageForFrameFunc; 60 IMP didPushStateWithinPageForFrameFunc; 61 IMP didReplaceStateWithinPageForFrameFunc; 62 IMP didPopStateWithinPageForFrameFunc; 63 IMP willCloseFrameFunc; 64 IMP didStartProvisionalLoadForFrameFunc; 65 IMP didReceiveTitleForFrameFunc; 66 IMP didCommitLoadForFrameFunc; 67 IMP didFailProvisionalLoadWithErrorForFrameFunc; 68 IMP didFailLoadWithErrorForFrameFunc; 69 IMP didFinishLoadForFrameFunc; 70 IMP didFirstLayoutInFrameFunc; 71 IMP didFirstVisuallyNonEmptyLayoutInFrameFunc; 72 IMP didReceiveIconForFrameFunc; 73 IMP didFinishDocumentLoadForFrameFunc; 74 IMP didDisplayInsecureContentFunc; 75 IMP didRunInsecureContentFunc; 76 }; 77 78 struct WebScriptDebugDelegateImplementationCache { 79 BOOL didParseSourceExpectsBaseLineNumber; 80 IMP didParseSourceFunc; 81 IMP failedToParseSourceFunc; 82 IMP didEnterCallFrameFunc; 83 IMP willExecuteStatementFunc; 84 IMP willLeaveCallFrameFunc; 85 IMP exceptionWasRaisedFunc; 86 }; 87 88 struct WebHistoryDelegateImplementationCache { 89 IMP navigatedFunc; 90 IMP clientRedirectFunc; 91 IMP serverRedirectFunc; 92 IMP setTitleFunc; 93 IMP populateVisitedLinksFunc; 94 }; 95 96 WebResourceDelegateImplementationCache* WebViewGetResourceLoadDelegateImplementations(WebView *); 97 WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementations(WebView *); 98 WebScriptDebugDelegateImplementationCache* WebViewGetScriptDebugDelegateImplementations(WebView *); 99 WebHistoryDelegateImplementationCache* WebViewGetHistoryDelegateImplementations(WebView *webView); 100 101 id CallFormDelegate(WebView *, SEL, id, id); 102 id CallFormDelegate(WebView *self, SEL selector, id object1, id object2, id object3, id object4, id object5); 103 BOOL CallFormDelegateReturningBoolean(BOOL, WebView *, SEL, id, SEL, id); 104 105 id CallUIDelegate(WebView *, SEL); 106 id CallUIDelegate(WebView *, SEL, id); 107 id CallUIDelegate(WebView *, SEL, NSRect); 108 id CallUIDelegate(WebView *, SEL, id, id); 109 id CallUIDelegate(WebView *, SEL, id, BOOL); 110 id CallUIDelegate(WebView *, SEL, id, id, id); 111 id CallUIDelegate(WebView *, SEL, id, NSUInteger); 112 float CallUIDelegateReturningFloat(WebView *, SEL); 113 BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL); 114 BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL, id); 115 BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL, id, id); 116 BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL, id, BOOL); 117 BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL, id, BOOL, id); 118 119 id CallFrameLoadDelegate(IMP, WebView *, SEL); 120 id CallFrameLoadDelegate(IMP, WebView *, SEL, id); 121 id CallFrameLoadDelegate(IMP, WebView *, SEL, id, id); 122 id CallFrameLoadDelegate(IMP, WebView *, SEL, id, id, id); 123 id CallFrameLoadDelegate(IMP, WebView *, SEL, id, id, id, id); 124 id CallFrameLoadDelegate(IMP, WebView *, SEL, id, NSTimeInterval, id, id); 125 126 id CallResourceLoadDelegate(IMP, WebView *, SEL, id, id); 127 id CallResourceLoadDelegate(IMP, WebView *, SEL, id, id, id); 128 id CallResourceLoadDelegate(IMP, WebView *, SEL, id, id, id, id); 129 id CallResourceLoadDelegate(IMP, WebView *, SEL, id, NSInteger, id); 130 id CallResourceLoadDelegate(IMP, WebView *, SEL, id, id, NSInteger, id); 131 132 BOOL CallResourceLoadDelegateReturningBoolean(BOOL, IMP, WebView *, SEL, id, id); 133 134 id CallScriptDebugDelegate(IMP, WebView *, SEL, id, id, NSInteger, id); 135 id CallScriptDebugDelegate(IMP, WebView *, SEL, id, NSInteger, id, NSInteger, id); 136 id CallScriptDebugDelegate(IMP, WebView *, SEL, id, NSInteger, id, id, id); 137 id CallScriptDebugDelegate(IMP, WebView *, SEL, id, NSInteger, NSInteger, id); 138 139 id CallHistoryDelegate(IMP, WebView *, SEL); 140 id CallHistoryDelegate(IMP, WebView *, SEL, id, id); 141 id CallHistoryDelegate(IMP, WebView *, SEL, id, id, id); 142