|
1 /* |
|
2 * Copyright (C) 2005, 2006, 2007 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 the Web Kit, but are neither SPI nor API. |
|
30 |
|
31 #import "WebViewPrivate.h" |
|
32 #import "WebTypesInternal.h" |
|
33 |
|
34 #ifdef __cplusplus |
|
35 namespace WebCore { |
|
36 class KeyboardEvent; |
|
37 class KURL; |
|
38 class Page; |
|
39 class String; |
|
40 } |
|
41 typedef WebCore::KeyboardEvent WebCoreKeyboardEvent; |
|
42 typedef WebCore::Page WebCorePage; |
|
43 #else |
|
44 @class WebCoreKeyboardEvent; |
|
45 @class WebCorePage; |
|
46 #endif |
|
47 |
|
48 @class WebBasePluginPackage; |
|
49 @class WebDownload; |
|
50 |
|
51 @interface WebView (WebViewEditingExtras) |
|
52 - (BOOL)_interceptEditingKeyEvent:(WebCoreKeyboardEvent *)event shouldSaveCommand:(BOOL)shouldSave; |
|
53 - (BOOL)_shouldChangeSelectedDOMRange:(DOMRange *)currentRange toDOMRange:(DOMRange *)proposedRange affinity:(NSSelectionAffinity)selectionAffinity stillSelecting:(BOOL)flag; |
|
54 @end |
|
55 |
|
56 @interface WebView (AllWebViews) |
|
57 + (void)_makeAllWebViewsPerformSelector:(SEL)selector; |
|
58 - (void)_removeFromAllWebViewsSet; |
|
59 - (void)_addToAllWebViewsSet; |
|
60 @end |
|
61 |
|
62 @interface WebView (WebViewInternal) |
|
63 #ifdef __cplusplus |
|
64 - (WebCore::String)_userAgentForURL:(const WebCore::KURL&)url; |
|
65 #endif |
|
66 @end |
|
67 |
|
68 @interface WebView (WebViewMiscInternal) |
|
69 |
|
70 + (void)_setCacheModelIfNecessary; |
|
71 - (WebCorePage*)page; |
|
72 - (NSMenu *)_menuForElement:(NSDictionary *)element defaultItems:(NSArray *)items; |
|
73 - (id)_UIDelegateForwarder; |
|
74 - (id)_editingDelegateForwarder; |
|
75 - (id)_policyDelegateForwarder; |
|
76 - (id)_scriptDebugDelegateForwarder; |
|
77 - (void)_pushPerformingProgrammaticFocus; |
|
78 - (void)_popPerformingProgrammaticFocus; |
|
79 - (void)_incrementProgressForIdentifier:(id)identifier response:(NSURLResponse *)response; |
|
80 - (void)_incrementProgressForIdentifier:(id)identifier length:(int)length; |
|
81 - (void)_completeProgressForIdentifier:(id)identifer; |
|
82 - (void)_progressStarted:(WebFrame *)frame; |
|
83 - (void)_didStartProvisionalLoadForFrame:(WebFrame *)frame; |
|
84 + (BOOL)_viewClass:(Class *)vClass andRepresentationClass:(Class *)rClass forMIMEType:(NSString *)MIMEType; |
|
85 - (BOOL)_viewClass:(Class *)vClass andRepresentationClass:(Class *)rClass forMIMEType:(NSString *)MIMEType; |
|
86 + (NSString *)_MIMETypeForFile:(NSString *)path; |
|
87 - (WebDownload *)_downloadURL:(NSURL *)URL; |
|
88 + (NSString *)_generatedMIMETypeForURLScheme:(NSString *)URLScheme; |
|
89 + (BOOL)_representationExistsForURLScheme:(NSString *)URLScheme; |
|
90 - (BOOL)_isPerformingProgrammaticFocus; |
|
91 - (void)_mouseDidMoveOverElement:(NSDictionary *)dictionary modifierFlags:(NSUInteger)modifierFlags; |
|
92 - (WebView *)_openNewWindowWithRequest:(NSURLRequest *)request; |
|
93 - (void)_writeImageForElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard; |
|
94 - (void)_writeLinkElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard; |
|
95 - (void)_openFrameInNewWindowFromMenu:(NSMenuItem *)sender; |
|
96 - (void)_searchWithGoogleFromMenu:(id)sender; |
|
97 - (void)_searchWithSpotlightFromMenu:(id)sender; |
|
98 - (void)_progressCompleted:(WebFrame *)frame; |
|
99 - (void)_didCommitLoadForFrame:(WebFrame *)frame; |
|
100 - (void)_didFinishLoadForFrame:(WebFrame *)frame; |
|
101 - (void)_didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame; |
|
102 - (void)_didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame; |
|
103 - (void)_willChangeValueForKey:(NSString *)key; |
|
104 - (void)_didChangeValueForKey:(NSString *)key; |
|
105 - (WebBasePluginPackage *)_pluginForMIMEType:(NSString *)MIMEType; |
|
106 - (WebBasePluginPackage *)_pluginForExtension:(NSString *)extension; |
|
107 - (BOOL)_isMIMETypeRegisteredAsPlugin:(NSString *)MIMEType; |
|
108 |
|
109 - (void)_addObject:(id)object forIdentifier:(unsigned long)identifier; |
|
110 - (id)_objectForIdentifier:(unsigned long)identifier; |
|
111 - (void)_removeObjectForIdentifier:(unsigned long)identifier; |
|
112 - (BOOL)_becomingFirstResponderFromOutside; |
|
113 |
|
114 - (void)_registerForIconNotification:(BOOL)listen; |
|
115 - (void)_dispatchDidReceiveIconFromWebFrame:(WebFrame *)webFrame; |
|
116 |
|
117 @end |
|
118 |
|
119 typedef struct _WebResourceDelegateImplementationCache { |
|
120 IMP didCancelAuthenticationChallengeFunc; |
|
121 IMP didReceiveAuthenticationChallengeFunc; |
|
122 IMP identifierForRequestFunc; |
|
123 IMP willSendRequestFunc; |
|
124 IMP didReceiveResponseFunc; |
|
125 IMP didReceiveContentLengthFunc; |
|
126 IMP didFinishLoadingFromDataSourceFunc; |
|
127 IMP didFailLoadingWithErrorFromDataSourceFunc; |
|
128 IMP didLoadResourceFromMemoryCacheFunc; |
|
129 IMP willCacheResponseFunc; |
|
130 IMP plugInFailedWithErrorFunc; |
|
131 } WebResourceDelegateImplementationCache; |
|
132 |
|
133 typedef struct _WebFrameLoadDelegateImplementationCache { |
|
134 IMP didClearWindowObjectForFrameFunc; |
|
135 IMP windowScriptObjectAvailableFunc; |
|
136 IMP didHandleOnloadEventsForFrameFunc; |
|
137 IMP didReceiveServerRedirectForProvisionalLoadForFrameFunc; |
|
138 IMP didCancelClientRedirectForFrameFunc; |
|
139 IMP willPerformClientRedirectToURLDelayFireDateForFrameFunc; |
|
140 IMP didChangeLocationWithinPageForFrameFunc; |
|
141 IMP willCloseFrameFunc; |
|
142 IMP didStartProvisionalLoadForFrameFunc; |
|
143 IMP didReceiveTitleForFrameFunc; |
|
144 IMP didCommitLoadForFrameFunc; |
|
145 IMP didFailProvisionalLoadWithErrorForFrameFunc; |
|
146 IMP didFailLoadWithErrorForFrameFunc; |
|
147 IMP didFinishLoadForFrameFunc; |
|
148 IMP didFirstLayoutInFrameFunc; |
|
149 IMP didReceiveIconForFrameFunc; |
|
150 IMP didFinishDocumentLoadForFrameFunc; |
|
151 } WebFrameLoadDelegateImplementationCache; |
|
152 |
|
153 WebResourceDelegateImplementationCache WebViewGetResourceLoadDelegateImplementations(WebView *webView); |
|
154 WebFrameLoadDelegateImplementationCache WebViewGetFrameLoadDelegateImplementations(WebView *webView); |
|
155 |
|
156 #ifdef __cplusplus |
|
157 |
|
158 id CallFormDelegate(WebView *, SEL, id, id); |
|
159 id CallFormDelegate(WebView *self, SEL selector, id object1, id object2, id object3, id object4, id object5); |
|
160 BOOL CallFormDelegateReturningBoolean(BOOL, WebView *, SEL, id, SEL, id); |
|
161 |
|
162 id CallUIDelegate(WebView *, SEL); |
|
163 id CallUIDelegate(WebView *, SEL, id); |
|
164 id CallUIDelegate(WebView *, SEL, NSRect); |
|
165 id CallUIDelegate(WebView *, SEL, id, id); |
|
166 id CallUIDelegate(WebView *, SEL, id, BOOL); |
|
167 id CallUIDelegate(WebView *, SEL, id, id, id); |
|
168 id CallUIDelegate(WebView *, SEL, id, NSUInteger); |
|
169 float CallUIDelegateReturningFloat(WebView *, SEL); |
|
170 BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL); |
|
171 BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL, id); |
|
172 BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL, id, id); |
|
173 BOOL CallUIDelegateReturningBoolean(BOOL, WebView *, SEL, id, BOOL); |
|
174 |
|
175 id CallFrameLoadDelegate(IMP, WebView *, SEL); |
|
176 id CallFrameLoadDelegate(IMP, WebView *, SEL, id); |
|
177 id CallFrameLoadDelegate(IMP, WebView *, SEL, id, id); |
|
178 id CallFrameLoadDelegate(IMP, WebView *, SEL, id, id, id); |
|
179 id CallFrameLoadDelegate(IMP, WebView *, SEL, id, id, id, id); |
|
180 id CallFrameLoadDelegate(IMP, WebView *, SEL, id, NSTimeInterval, id, id); |
|
181 |
|
182 id CallResourceLoadDelegate(IMP, WebView *, SEL, id, id); |
|
183 id CallResourceLoadDelegate(IMP, WebView *, SEL, id, id, id); |
|
184 id CallResourceLoadDelegate(IMP, WebView *, SEL, id, id, id, id); |
|
185 id CallResourceLoadDelegate(IMP, WebView *, SEL, id, NSInteger, id); |
|
186 id CallResourceLoadDelegate(IMP, WebView *, SEL, id, id, NSInteger, id); |
|
187 |
|
188 #endif |