Home | History | Annotate | Download | only in WebView
      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 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
     39     IMP canAuthenticateAgainstProtectionSpaceFunc;
     40 #endif
     41     IMP identifierForRequestFunc;
     42     IMP willSendRequestFunc;
     43     IMP didReceiveResponseFunc;
     44     IMP didReceiveContentLengthFunc;
     45     IMP didFinishLoadingFromDataSourceFunc;
     46     IMP didFailLoadingWithErrorFromDataSourceFunc;
     47     IMP didLoadResourceFromMemoryCacheFunc;
     48     IMP willCacheResponseFunc;
     49     IMP plugInFailedWithErrorFunc;
     50     IMP shouldUseCredentialStorageFunc;
     51     IMP shouldPaintBrokenImageForURLFunc;
     52 };
     53 
     54 struct WebFrameLoadDelegateImplementationCache {
     55     IMP didClearWindowObjectForFrameFunc;
     56     IMP didClearWindowObjectForFrameInScriptWorldFunc;
     57     IMP didClearInspectorWindowObjectForFrameFunc;
     58     IMP windowScriptObjectAvailableFunc;
     59     IMP didHandleOnloadEventsForFrameFunc;
     60     IMP didReceiveServerRedirectForProvisionalLoadForFrameFunc;
     61     IMP didCancelClientRedirectForFrameFunc;
     62     IMP willPerformClientRedirectToURLDelayFireDateForFrameFunc;
     63     IMP didChangeLocationWithinPageForFrameFunc;
     64     IMP didPushStateWithinPageForFrameFunc;
     65     IMP didReplaceStateWithinPageForFrameFunc;
     66     IMP didPopStateWithinPageForFrameFunc;
     67     IMP willCloseFrameFunc;
     68     IMP didStartProvisionalLoadForFrameFunc;
     69     IMP didReceiveTitleForFrameFunc;
     70     IMP didCommitLoadForFrameFunc;
     71     IMP didFailProvisionalLoadWithErrorForFrameFunc;
     72     IMP didFailLoadWithErrorForFrameFunc;
     73     IMP didFinishLoadForFrameFunc;
     74     IMP didFirstLayoutInFrameFunc;
     75     IMP didFirstVisuallyNonEmptyLayoutInFrameFunc;
     76     IMP didReceiveIconForFrameFunc;
     77     IMP didFinishDocumentLoadForFrameFunc;
     78     IMP didDisplayInsecureContentFunc;
     79     IMP didRunInsecureContentFunc;
     80 };
     81 
     82 struct WebScriptDebugDelegateImplementationCache {
     83     BOOL didParseSourceExpectsBaseLineNumber;
     84     BOOL exceptionWasRaisedExpectsHasHandlerFlag;
     85     IMP didParseSourceFunc;
     86     IMP failedToParseSourceFunc;
     87     IMP didEnterCallFrameFunc;
     88     IMP willExecuteStatementFunc;
     89     IMP willLeaveCallFrameFunc;
     90     IMP exceptionWasRaisedFunc;
     91 };
     92 
     93 struct WebHistoryDelegateImplementationCache {
     94     IMP navigatedFunc;
     95     IMP clientRedirectFunc;
     96     IMP serverRedirectFunc;
     97     IMP setTitleFunc;
     98     IMP populateVisitedLinksFunc;
     99 };
    100 
    101 WebResourceDelegateImplementationCache* WebViewGetResourceLoadDelegateImplementations(WebView *);
    102 WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementations(WebView *);
    103 WebScriptDebugDelegateImplementationCache* WebViewGetScriptDebugDelegateImplementations(WebView *);
    104 WebHistoryDelegateImplementationCache* WebViewGetHistoryDelegateImplementations(WebView *webView);
    105 
    106 id CallFormDelegate(WebView *, SEL, id, id);
    107 id CallFormDelegate(WebView *self, SEL selector, id object1, id object2, id object3, id object4, id object5);
    108 BOOL CallFormDelegateReturningBoolean(BOOL, WebView *, SEL, id, SEL, id);
    109 
    110 id CallUIDelegate(WebView *, SEL);
    111 id CallUIDelegate(WebView *, SEL, id);
    112 id CallUIDelegate(WebView *, SEL, NSRect);
    113 id CallUIDelegate(WebView *, SEL, id, id);
    114 id CallUIDelegate(WebView *, SEL, id, BOOL);
    115 id CallUIDelegate(WebView *, SEL, id, id, id);
    116 id CallUIDelegate(WebView *, SEL, id, NSUInteger);
    117 float CallUIDelegateReturningFloat(WebView *, SEL);
    118 BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL);
    119 BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL, id);
    120 BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL, id, id);
    121 BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL, id, BOOL);
    122 BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL, id, BOOL, id);
    123 
    124 id CallFrameLoadDelegate(IMP, WebView *, SEL);
    125 id CallFrameLoadDelegate(IMP, WebView *, SEL, id);
    126 id CallFrameLoadDelegate(IMP, WebView *, SEL, id, id);
    127 id CallFrameLoadDelegate(IMP, WebView *, SEL, id, id, id);
    128 id CallFrameLoadDelegate(IMP, WebView *, SEL, id, id, id, id);
    129 id CallFrameLoadDelegate(IMP, WebView *, SEL, id, NSTimeInterval, id, id);
    130 
    131 id CallResourceLoadDelegate(IMP, WebView *, SEL, id, id);
    132 id CallResourceLoadDelegate(IMP, WebView *, SEL, id, id, id);
    133 id CallResourceLoadDelegate(IMP, WebView *, SEL, id, id, id, id);
    134 id CallResourceLoadDelegate(IMP, WebView *, SEL, id, NSInteger, id);
    135 id CallResourceLoadDelegate(IMP, WebView *, SEL, id, id, NSInteger, id);
    136 
    137 BOOL CallResourceLoadDelegateReturningBoolean(BOOL, IMP, WebView *, SEL, id);
    138 BOOL CallResourceLoadDelegateReturningBoolean(BOOL, IMP, WebView *, SEL, id, id);
    139 BOOL CallResourceLoadDelegateReturningBoolean(BOOL, IMP, WebView *, SEL, id, id, id);
    140 
    141 id CallScriptDebugDelegate(IMP, WebView *, SEL, id, id, NSInteger, id);
    142 id CallScriptDebugDelegate(IMP, WebView *, SEL, id, NSInteger, id, NSInteger, id);
    143 id CallScriptDebugDelegate(IMP, WebView *, SEL, id, NSInteger, id, id, id);
    144 id CallScriptDebugDelegate(IMP, WebView *, SEL, id, NSInteger, int, id);
    145 id CallScriptDebugDelegate(IMP, WebView *, SEL, id, BOOL, NSInteger, int, id);
    146 
    147 id CallHistoryDelegate(IMP, WebView *, SEL);
    148 id CallHistoryDelegate(IMP, WebView *, SEL, id, id);
    149 id CallHistoryDelegate(IMP, WebView *, SEL, id, id, id);
    150