|
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 #import <WebKit/WebView.h> |
|
30 #import <WebKit/WebFramePrivate.h> |
|
31 #import <JavaScriptCore/JSBase.h> |
|
32 |
|
33 #if !defined(ENABLE_DASHBOARD_SUPPORT) |
|
34 #define ENABLE_DASHBOARD_SUPPORT 1 |
|
35 #endif |
|
36 |
|
37 #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 |
|
38 #define WebNSInteger int |
|
39 #define WebNSUInteger unsigned int |
|
40 #else |
|
41 #define WebNSInteger NSInteger |
|
42 #define WebNSUInteger NSUInteger |
|
43 #endif |
|
44 |
|
45 @class NSError; |
|
46 @class WebFrame; |
|
47 @class WebGeolocationPosition; |
|
48 @class WebInspector; |
|
49 @class WebPreferences; |
|
50 @class WebScriptWorld; |
|
51 @class WebTextIterator; |
|
52 |
|
53 @protocol WebFormDelegate; |
|
54 |
|
55 extern NSString *_WebCanGoBackKey; |
|
56 extern NSString *_WebCanGoForwardKey; |
|
57 extern NSString *_WebEstimatedProgressKey; |
|
58 extern NSString *_WebIsLoadingKey; |
|
59 extern NSString *_WebMainFrameIconKey; |
|
60 extern NSString *_WebMainFrameTitleKey; |
|
61 extern NSString *_WebMainFrameURLKey; |
|
62 extern NSString *_WebMainFrameDocumentKey; |
|
63 |
|
64 // pending public WebElementDictionary keys |
|
65 extern NSString *WebElementTitleKey; // NSString of the title of the element (used by Safari) |
|
66 extern NSString *WebElementSpellingToolTipKey; // NSString of a tooltip representing misspelling or bad grammar (used internally) |
|
67 extern NSString *WebElementIsContentEditableKey; // NSNumber indicating whether the inner non-shared node is content editable (used internally) |
|
68 |
|
69 // other WebElementDictionary keys |
|
70 extern NSString *WebElementLinkIsLiveKey; // NSNumber of BOOL indictating whether the link is live or not |
|
71 extern NSString *WebElementIsInScrollBarKey; |
|
72 |
|
73 // One of the subviews of the WebView entered compositing mode. |
|
74 extern NSString *_WebViewDidStartAcceleratedCompositingNotification; |
|
75 |
|
76 #if ENABLE_DASHBOARD_SUPPORT |
|
77 typedef enum { |
|
78 WebDashboardBehaviorAlwaysSendMouseEventsToAllWindows, |
|
79 WebDashboardBehaviorAlwaysSendActiveNullEventsToPlugIns, |
|
80 WebDashboardBehaviorAlwaysAcceptsFirstMouse, |
|
81 WebDashboardBehaviorAllowWheelScrolling, |
|
82 WebDashboardBehaviorUseBackwardCompatibilityMode |
|
83 } WebDashboardBehavior; |
|
84 #endif |
|
85 |
|
86 typedef enum { |
|
87 WebInjectAtDocumentStart, |
|
88 WebInjectAtDocumentEnd, |
|
89 } WebUserScriptInjectionTime; |
|
90 |
|
91 typedef enum { |
|
92 WebInjectInAllFrames, |
|
93 WebInjectInTopFrameOnly |
|
94 } WebUserContentInjectedFrames; |
|
95 |
|
96 @interface WebController : NSTreeController { |
|
97 IBOutlet WebView *webView; |
|
98 } |
|
99 - (WebView *)webView; |
|
100 - (void)setWebView:(WebView *)newWebView; |
|
101 @end |
|
102 |
|
103 @interface WebView (WebViewEditingActionsPendingPublic) |
|
104 |
|
105 - (void)outdent:(id)sender; |
|
106 |
|
107 @end |
|
108 |
|
109 @interface WebView (WebPendingPublic) |
|
110 |
|
111 - (void)scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode; |
|
112 - (void)unscheduleFromRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode; |
|
113 |
|
114 /*! |
|
115 @method searchFor:direction:caseSensitive:wrap:startInSelection: |
|
116 @abstract Searches a document view for a string and highlights the string if it is found. |
|
117 Starts the search from the current selection. Will search across all frames. |
|
118 @param string The string to search for. |
|
119 @param forward YES to search forward, NO to seach backwards. |
|
120 @param caseFlag YES to for case-sensitive search, NO for case-insensitive search. |
|
121 @param wrapFlag YES to wrap around, NO to avoid wrapping. |
|
122 @param startInSelection YES to begin search in the selected text (useful for incremental searching), NO to begin search after the selected text. |
|
123 @result YES if found, NO if not found. |
|
124 */ |
|
125 - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag startInSelection:(BOOL)startInSelection; |
|
126 |
|
127 - (void)setMainFrameDocumentReady:(BOOL)mainFrameDocumentReady; |
|
128 |
|
129 - (void)setTabKeyCyclesThroughElements:(BOOL)cyclesElements; |
|
130 - (BOOL)tabKeyCyclesThroughElements; |
|
131 |
|
132 - (void)scrollDOMRangeToVisible:(DOMRange *)range; |
|
133 |
|
134 // setHoverFeedbackSuspended: can be called by clients that want to temporarily prevent the webView |
|
135 // from displaying feedback about mouse position. Each WebDocumentView class that displays feedback |
|
136 // about mouse position should honor this setting. |
|
137 - (void)setHoverFeedbackSuspended:(BOOL)newValue; |
|
138 - (BOOL)isHoverFeedbackSuspended; |
|
139 |
|
140 /*! |
|
141 @method setScriptDebugDelegate: |
|
142 @abstract Set the WebView's WebScriptDebugDelegate delegate. |
|
143 @param delegate The WebScriptDebugDelegate to set as the delegate. |
|
144 */ |
|
145 - (void)setScriptDebugDelegate:(id)delegate; |
|
146 |
|
147 /*! |
|
148 @method scriptDebugDelegate |
|
149 @abstract Return the WebView's WebScriptDebugDelegate. |
|
150 @result The WebView's WebScriptDebugDelegate. |
|
151 */ |
|
152 - (id)scriptDebugDelegate; |
|
153 |
|
154 /*! |
|
155 @method setHistoryDelegate: |
|
156 @abstract Set the WebView's WebHistoryDelegate delegate. |
|
157 @param delegate The WebHistoryDelegate to set as the delegate. |
|
158 */ |
|
159 - (void)setHistoryDelegate:(id)delegate; |
|
160 |
|
161 /*! |
|
162 @method historyDelegate |
|
163 @abstract Return the WebView's WebHistoryDelegate delegate. |
|
164 @result The WebView's WebHistoryDelegate delegate. |
|
165 */ |
|
166 - (id)historyDelegate; |
|
167 |
|
168 - (BOOL)shouldClose; |
|
169 |
|
170 /*! |
|
171 @method aeDescByEvaluatingJavaScriptFromString: |
|
172 @param script The text of the JavaScript. |
|
173 @result The result of the script, converted to an NSAppleEventDescriptor, or nil for failure. |
|
174 */ |
|
175 - (NSAppleEventDescriptor *)aeDescByEvaluatingJavaScriptFromString:(NSString *)script; |
|
176 |
|
177 // Support for displaying multiple text matches. |
|
178 // These methods might end up moving into a protocol, so different document types can specify |
|
179 // whether or not they implement the protocol. For now we'll just deal with HTML. |
|
180 // These methods are still in flux; don't rely on them yet. |
|
181 - (BOOL)canMarkAllTextMatches; |
|
182 - (WebNSUInteger)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag highlight:(BOOL)highlight limit:(WebNSUInteger)limit; |
|
183 - (void)unmarkAllTextMatches; |
|
184 - (NSArray *)rectsForTextMatches; |
|
185 |
|
186 // Support for disabling registration with the undo manager. This is equivalent to the methods with the same names on NSTextView. |
|
187 - (BOOL)allowsUndo; |
|
188 - (void)setAllowsUndo:(BOOL)flag; |
|
189 |
|
190 /*! |
|
191 @method setPageSizeMultiplier: |
|
192 @abstract Change the zoom factor of the page in views managed by this webView. |
|
193 @param multiplier A fractional percentage value, 1.0 is 100%. |
|
194 */ |
|
195 - (void)setPageSizeMultiplier:(float)multiplier; |
|
196 |
|
197 /*! |
|
198 @method pageSizeMultiplier |
|
199 @result The page size multipler. |
|
200 */ |
|
201 - (float)pageSizeMultiplier; |
|
202 |
|
203 // Commands for doing page zoom. Will end up in WebView (WebIBActions) <NSUserInterfaceValidations> |
|
204 - (BOOL)canZoomPageIn; |
|
205 - (IBAction)zoomPageIn:(id)sender; |
|
206 - (BOOL)canZoomPageOut; |
|
207 - (IBAction)zoomPageOut:(id)sender; |
|
208 - (BOOL)canResetPageZoom; |
|
209 - (IBAction)resetPageZoom:(id)sender; |
|
210 |
|
211 // Sets a master volume control for all media elements in the WebView. Valid values are 0..1. |
|
212 - (void)setMediaVolume:(float)volume; |
|
213 - (float)mediaVolume; |
|
214 |
|
215 // Add visited links |
|
216 - (void)addVisitedLinks:(NSArray *)visitedLinks; |
|
217 |
|
218 @end |
|
219 |
|
220 @interface WebView (WebPrivate) |
|
221 |
|
222 - (WebInspector *)inspector; |
|
223 |
|
224 /*! |
|
225 @method setBackgroundColor: |
|
226 @param backgroundColor Color to use as the default background. |
|
227 @abstract Sets what color the receiver draws under transparent page background colors and images. |
|
228 This color is also used when no page is loaded. A color with alpha should only be used when the receiver is |
|
229 in a non-opaque window, since the color is drawn using NSCompositeCopy. |
|
230 */ |
|
231 - (void)setBackgroundColor:(NSColor *)backgroundColor; |
|
232 |
|
233 /*! |
|
234 @method backgroundColor |
|
235 @result Returns the background color drawn under transparent page background colors and images. |
|
236 This color is also used when no page is loaded. A color with alpha should only be used when the receiver is |
|
237 in a non-opaque window, since the color is drawn using NSCompositeCopy. |
|
238 */ |
|
239 - (NSColor *)backgroundColor; |
|
240 |
|
241 /*! |
|
242 Could be worth adding to the API. |
|
243 @method _loadBackForwardListFromOtherView: |
|
244 @abstract Loads the view with the contents of the other view, including its backforward list. |
|
245 @param otherView The WebView from which to copy contents. |
|
246 */ |
|
247 - (void)_loadBackForwardListFromOtherView:(WebView *)otherView; |
|
248 |
|
249 /* |
|
250 @method _reportException:inContext: |
|
251 @abstract Logs the exception to the Web Inspector. This only needs called for exceptions that |
|
252 occur while using the JavaScriptCore APIs with a context owned by a WebKit. |
|
253 @param exception The exception value to log. |
|
254 @param context The context the exception occured in. |
|
255 */ |
|
256 + (void)_reportException:(JSValueRef)exception inContext:(JSContextRef)context; |
|
257 |
|
258 /*! |
|
259 @method _dispatchPendingLoadRequests: |
|
260 @abstract Dispatches any pending load requests that have been scheduled because of recent DOM additions or style changes. |
|
261 @discussion You only need to call this method if you require synchronous notification of loads through the resource load delegate. |
|
262 Otherwise the resource load delegate will be notified about loads during a future run loop iteration. |
|
263 */ |
|
264 - (void)_dispatchPendingLoadRequests; |
|
265 |
|
266 + (NSArray *)_supportedFileExtensions; |
|
267 |
|
268 /*! |
|
269 @method canShowFile: |
|
270 @abstract Checks if the WebKit can show the content of the file at the specified path. |
|
271 @param path The path of the file to check |
|
272 @result YES if the WebKit can show the content of the file at the specified path. |
|
273 */ |
|
274 + (BOOL)canShowFile:(NSString *)path; |
|
275 |
|
276 /*! |
|
277 @method suggestedFileExtensionForMIMEType: |
|
278 @param MIMEType The MIME type to check. |
|
279 @result The extension based on the MIME type |
|
280 */ |
|
281 + (NSString *)suggestedFileExtensionForMIMEType: (NSString *)MIMEType; |
|
282 |
|
283 + (NSString *)_standardUserAgentWithApplicationName:(NSString *)applicationName; |
|
284 |
|
285 /*! |
|
286 @method canCloseAllWebViews |
|
287 @abstract Checks if all the open WebViews can be closed (by dispatching the beforeUnload event to the pages). |
|
288 @result YES if all the WebViews can be closed. |
|
289 */ |
|
290 + (BOOL)canCloseAllWebViews; |
|
291 |
|
292 // May well become public |
|
293 - (void)_setFormDelegate:(id<WebFormDelegate>)delegate; |
|
294 - (id<WebFormDelegate>)_formDelegate; |
|
295 |
|
296 - (BOOL)_isClosed; |
|
297 |
|
298 // _close is now replaced by public method -close. It remains here only for backward compatibility |
|
299 // until callers can be weaned off of it. |
|
300 - (void)_close; |
|
301 |
|
302 // Indicates if the WebView is in the midst of a user gesture. |
|
303 - (BOOL)_isProcessingUserGesture; |
|
304 |
|
305 // SPI for DumpRenderTree |
|
306 - (void)_updateActiveState; |
|
307 |
|
308 /*! |
|
309 @method _registerViewClass:representationClass:forURLScheme: |
|
310 @discussion Register classes that implement WebDocumentView and WebDocumentRepresentation respectively. |
|
311 @param viewClass The WebDocumentView class to use to render data for a given MIME type. |
|
312 @param representationClass The WebDocumentRepresentation class to use to represent data of the given MIME type. |
|
313 @param scheme The URL scheme to represent with an object of the given class. |
|
314 */ |
|
315 + (void)_registerViewClass:(Class)viewClass representationClass:(Class)representationClass forURLScheme:(NSString *)URLScheme; |
|
316 |
|
317 + (void)_unregisterViewClassAndRepresentationClassForMIMEType:(NSString *)MIMEType; |
|
318 |
|
319 /*! |
|
320 @method _canHandleRequest: |
|
321 @abstract Performs a "preflight" operation that performs some |
|
322 speculative checks to see if a request can be used to create |
|
323 a WebDocumentView and WebDocumentRepresentation. |
|
324 @discussion The result of this method is valid only as long as no |
|
325 protocols or schemes are registered or unregistered, and as long as |
|
326 the request is not mutated (if the request is mutable). Hence, clients |
|
327 should be prepared to handle failures even if they have performed request |
|
328 preflighting by caling this method. |
|
329 @param request The request to preflight. |
|
330 @result YES if it is likely that a WebDocumentView and WebDocumentRepresentation |
|
331 can be created for the request, NO otherwise. |
|
332 */ |
|
333 + (BOOL)_canHandleRequest:(NSURLRequest *)request; |
|
334 |
|
335 + (NSString *)_decodeData:(NSData *)data; |
|
336 |
|
337 + (void)_setAlwaysUsesComplexTextCodePath:(BOOL)f; |
|
338 // This is the old name of the above method. Needed for Safari versions that call it. |
|
339 + (void)_setAlwaysUseATSU:(BOOL)f; |
|
340 |
|
341 - (NSCachedURLResponse *)_cachedResponseForURL:(NSURL *)URL; |
|
342 |
|
343 #if ENABLE_DASHBOARD_SUPPORT |
|
344 - (void)_addScrollerDashboardRegions:(NSMutableDictionary *)regions; |
|
345 - (NSDictionary *)_dashboardRegions; |
|
346 |
|
347 - (void)_setDashboardBehavior:(WebDashboardBehavior)behavior to:(BOOL)flag; |
|
348 - (BOOL)_dashboardBehavior:(WebDashboardBehavior)behavior; |
|
349 #endif |
|
350 |
|
351 + (void)_setShouldUseFontSmoothing:(BOOL)f; |
|
352 + (BOOL)_shouldUseFontSmoothing; |
|
353 |
|
354 - (void)_setCatchesDelegateExceptions:(BOOL)f; |
|
355 - (BOOL)_catchesDelegateExceptions; |
|
356 |
|
357 // These two methods are useful for a test harness that needs a consistent appearance for the focus rings |
|
358 // regardless of OS X version. |
|
359 + (void)_setUsesTestModeFocusRingColor:(BOOL)f; |
|
360 + (BOOL)_usesTestModeFocusRingColor; |
|
361 |
|
362 /*! |
|
363 @method setAlwaysShowVerticalScroller: |
|
364 @result Forces the vertical scroller to be visible if flag is YES, otherwise |
|
365 if flag is NO the scroller with automatically show and hide as needed. |
|
366 */ |
|
367 - (void)setAlwaysShowVerticalScroller:(BOOL)flag; |
|
368 |
|
369 /*! |
|
370 @method alwaysShowVerticalScroller |
|
371 @result YES if the vertical scroller is always shown |
|
372 */ |
|
373 - (BOOL)alwaysShowVerticalScroller; |
|
374 |
|
375 /*! |
|
376 @method setAlwaysShowHorizontalScroller: |
|
377 @result Forces the horizontal scroller to be visible if flag is YES, otherwise |
|
378 if flag is NO the scroller with automatically show and hide as needed. |
|
379 */ |
|
380 - (void)setAlwaysShowHorizontalScroller:(BOOL)flag; |
|
381 |
|
382 /*! |
|
383 @method alwaysShowHorizontalScroller |
|
384 @result YES if the horizontal scroller is always shown |
|
385 */ |
|
386 - (BOOL)alwaysShowHorizontalScroller; |
|
387 |
|
388 /*! |
|
389 @method setProhibitsMainFrameScrolling: |
|
390 @abstract Prohibits scrolling in the WebView's main frame. Used to "lock" a WebView |
|
391 to a specific scroll position. |
|
392 */ |
|
393 - (void)setProhibitsMainFrameScrolling:(BOOL)prohibits; |
|
394 |
|
395 /*! |
|
396 @method _setAdditionalWebPlugInPaths: |
|
397 @abstract Sets additional plugin search paths for a specific WebView. |
|
398 */ |
|
399 - (void)_setAdditionalWebPlugInPaths:(NSArray *)newPaths; |
|
400 |
|
401 /*! |
|
402 @method _setInViewSourceMode: |
|
403 @abstract Used to place a WebView into a special source-viewing mode. |
|
404 */ |
|
405 - (void)_setInViewSourceMode:(BOOL)flag; |
|
406 |
|
407 /*! |
|
408 @method _inViewSourceMode; |
|
409 @abstract Whether or not the WebView is in source-view mode for HTML. |
|
410 */ |
|
411 - (BOOL)_inViewSourceMode; |
|
412 |
|
413 /*! |
|
414 @method _attachScriptDebuggerToAllFrames |
|
415 @abstract Attaches a script debugger to all frames belonging to the receiver. |
|
416 */ |
|
417 - (void)_attachScriptDebuggerToAllFrames; |
|
418 |
|
419 /*! |
|
420 @method _detachScriptDebuggerFromAllFrames |
|
421 @abstract Detaches any script debuggers from all frames belonging to the receiver. |
|
422 */ |
|
423 - (void)_detachScriptDebuggerFromAllFrames; |
|
424 |
|
425 - (BOOL)defersCallbacks; // called by QuickTime plug-in |
|
426 - (void)setDefersCallbacks:(BOOL)defer; // called by QuickTime plug-in |
|
427 |
|
428 - (BOOL)usesPageCache; |
|
429 - (void)setUsesPageCache:(BOOL)usesPageCache; |
|
430 |
|
431 - (WebHistoryItem *)_globalHistoryItem; |
|
432 |
|
433 /*! |
|
434 @method textIteratorForRect: |
|
435 @param rect The rectangle of the document that we're interested in text from. |
|
436 @result WebTextIterator object, initialized with a range that corresponds to |
|
437 the passed-in rectangle. |
|
438 @abstract This method gives the text for the approximate range of the document |
|
439 corresponding to the rectangle. The range is determined by using hit testing at |
|
440 the top left and bottom right of the rectangle. Because of that, there can be |
|
441 text visible in the rectangle that is not included in the iterator. If you need |
|
442 a guarantee of iterating all text that is visible, then you need to instead make |
|
443 a WebTextIterator with a DOMRange that covers the entire document. |
|
444 */ |
|
445 - (WebTextIterator *)textIteratorForRect:(NSRect)rect; |
|
446 |
|
447 #if ENABLE_DASHBOARD_SUPPORT |
|
448 // <rdar://problem/5217124> Clients other than Dashboard, don't use this. |
|
449 // As of this writing, Dashboard uses this on Tiger, but not on Leopard or newer. |
|
450 - (void)handleAuthenticationForResource:(id)identifier challenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource; |
|
451 #endif |
|
452 |
|
453 - (void)_clearUndoRedoOperations; |
|
454 |
|
455 /* Used to do fast (lower quality) scaling of images so that window resize can be quick. */ |
|
456 - (BOOL)_inFastImageScalingMode; |
|
457 - (void)_setUseFastImageScalingMode:(BOOL)flag; |
|
458 |
|
459 - (BOOL)_cookieEnabled; |
|
460 - (void)_setCookieEnabled:(BOOL)enable; |
|
461 |
|
462 // SPI for DumpRenderTree |
|
463 - (void)_executeCoreCommandByName:(NSString *)name value:(NSString *)value; |
|
464 - (void)_clearMainFrameName; |
|
465 |
|
466 - (void)_setCustomHTMLTokenizerTimeDelay:(double)timeDelay; |
|
467 - (void)_setCustomHTMLTokenizerChunkSize:(int)chunkSize; |
|
468 |
|
469 - (id)_initWithFrame:(NSRect)f frameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews; |
|
470 - (BOOL)_usesDocumentViews; |
|
471 |
|
472 - (void)setSelectTrailingWhitespaceEnabled:(BOOL)flag; |
|
473 - (BOOL)isSelectTrailingWhitespaceEnabled; |
|
474 |
|
475 - (void)setMemoryCacheDelegateCallsEnabled:(BOOL)suspend; |
|
476 - (BOOL)areMemoryCacheDelegateCallsEnabled; |
|
477 |
|
478 - (void)_setJavaScriptURLsAreAllowed:(BOOL)setJavaScriptURLsAreAllowed; |
|
479 |
|
480 + (NSCursor *)_pointingHandCursor; |
|
481 |
|
482 // SPI for DumpRenderTree |
|
483 - (BOOL)_postsAcceleratedCompositingNotifications; |
|
484 - (void)_setPostsAcceleratedCompositingNotifications:(BOOL)flag; |
|
485 - (BOOL)_isUsingAcceleratedCompositing; |
|
486 |
|
487 // Returns YES if NSView -displayRectIgnoringOpacity:inContext: will produce a faithful representation of the content. |
|
488 - (BOOL)_isSoftwareRenderable; |
|
489 // When drawing into a bitmap context, we normally flatten compositing layers (and distort 3D transforms). |
|
490 // Clients who are able to capture their own copy of the compositing layers need to be able to disable this. |
|
491 - (void)_setIncludesFlattenedCompositingLayersWhenDrawingToBitmap:(BOOL)flag; |
|
492 - (BOOL)_includesFlattenedCompositingLayersWhenDrawingToBitmap; |
|
493 |
|
494 // SPI for PluginHalter |
|
495 + (BOOL)_isNodeHaltedPlugin:(DOMNode *)node; |
|
496 + (BOOL)_hasPluginForNodeBeenHalted:(DOMNode *)node; |
|
497 + (void)_restartHaltedPluginForNode:(DOMNode *)node; |
|
498 |
|
499 // Which pasteboard text is coming from in editing delegate methods such as shouldInsertNode. |
|
500 - (NSPasteboard *)_insertionPasteboard; |
|
501 |
|
502 // Whitelists access from an origin (sourceOrigin) to a set of one or more origins described by the parameters: |
|
503 // - destinationProtocol: The protocol to grant access to. |
|
504 // - destinationHost: The host to grant access to. |
|
505 // - allowDestinationSubdomains: If host is a domain, setting this to YES will whitelist host and all its subdomains, recursively. |
|
506 + (void)_addOriginAccessWhitelistEntryWithSourceOrigin:(NSString *)sourceOrigin destinationProtocol:(NSString *)destinationProtocol destinationHost:(NSString *)destinationHost allowDestinationSubdomains:(BOOL)allowDestinationSubdomains; |
|
507 + (void)_removeOriginAccessWhitelistEntryWithSourceOrigin:(NSString *)sourceOrigin destinationProtocol:(NSString *)destinationProtocol destinationHost:(NSString *)destinationHost allowDestinationSubdomains:(BOOL)allowDestinationSubdomains; |
|
508 |
|
509 // Removes all white list entries created with _addOriginAccessWhitelistEntryWithSourceOrigin. |
|
510 + (void)_resetOriginAccessWhitelists; |
|
511 |
|
512 // FIXME: The following two methods are deprecated in favor of the overloads below that take the WebUserContentInjectedFrames argument. https://bugs.webkit.org/show_bug.cgi?id=41800. |
|
513 + (void)_addUserScriptToGroup:(NSString *)groupName world:(WebScriptWorld *)world source:(NSString *)source url:(NSURL *)url whitelist:(NSArray *)whitelist blacklist:(NSArray *)blacklist injectionTime:(WebUserScriptInjectionTime)injectionTime; |
|
514 + (void)_addUserStyleSheetToGroup:(NSString *)groupName world:(WebScriptWorld *)world source:(NSString *)source url:(NSURL *)url whitelist:(NSArray *)whitelist blacklist:(NSArray *)blacklist; |
|
515 |
|
516 + (void)_addUserScriptToGroup:(NSString *)groupName world:(WebScriptWorld *)world source:(NSString *)source url:(NSURL *)url whitelist:(NSArray *)whitelist blacklist:(NSArray *)blacklist injectionTime:(WebUserScriptInjectionTime)injectionTime injectedFrames:(WebUserContentInjectedFrames)injectedFrames; |
|
517 + (void)_addUserStyleSheetToGroup:(NSString *)groupName world:(WebScriptWorld *)world source:(NSString *)source url:(NSURL *)url whitelist:(NSArray *)whitelist blacklist:(NSArray *)blacklist injectedFrames:(WebUserContentInjectedFrames)injectedFrames; |
|
518 + (void)_removeUserScriptFromGroup:(NSString *)groupName world:(WebScriptWorld *)world url:(NSURL *)url; |
|
519 + (void)_removeUserStyleSheetFromGroup:(NSString *)groupName world:(WebScriptWorld *)world url:(NSURL *)url; |
|
520 + (void)_removeUserScriptsFromGroup:(NSString *)groupName world:(WebScriptWorld *)world; |
|
521 + (void)_removeUserStyleSheetsFromGroup:(NSString *)groupName world:(WebScriptWorld *)world; |
|
522 + (void)_removeAllUserContentFromGroup:(NSString *)groupName; |
|
523 |
|
524 /*! |
|
525 @method cssAnimationsSuspended |
|
526 @abstract Returns whether or not CSS Animations are suspended. |
|
527 @result YES if CSS Animations are suspended. |
|
528 */ |
|
529 - (BOOL)cssAnimationsSuspended; |
|
530 |
|
531 /*! |
|
532 @method setCSSAnimationsSuspended |
|
533 @param paused YES to suspend animations, NO to resume animations. |
|
534 @discussion Suspends or resumes all running animations and transitions in the page. |
|
535 */ |
|
536 - (void)setCSSAnimationsSuspended:(BOOL)suspended; |
|
537 |
|
538 + (void)_setDomainRelaxationForbidden:(BOOL)forbidden forURLScheme:(NSString *)scheme; |
|
539 + (void)_registerURLSchemeAsSecure:(NSString *)scheme; |
|
540 |
|
541 @end |
|
542 |
|
543 @interface WebView (WebViewPrintingPrivate) |
|
544 /*! |
|
545 @method _adjustPrintingMarginsForHeaderAndFooter: |
|
546 @abstract Increase the top and bottom margins for the current print operation to |
|
547 account for the header and footer height. |
|
548 @discussion Called by <WebDocument> implementors once when a print job begins. If the |
|
549 <WebDocument> implementor implements knowsPageRange:, this should be called from there. |
|
550 Otherwise this should be called from beginDocument. The <WebDocument> implementors need |
|
551 to also call _drawHeaderAndFooter. |
|
552 */ |
|
553 - (void)_adjustPrintingMarginsForHeaderAndFooter; |
|
554 |
|
555 /*! |
|
556 @method _drawHeaderAndFooter |
|
557 @abstract Gives the WebView's UIDelegate a chance to draw a header and footer on the |
|
558 printed page. |
|
559 @discussion This should be called by <WebDocument> implementors from an override of |
|
560 drawPageBorderWithSize:. |
|
561 */ |
|
562 - (void)_drawHeaderAndFooter; |
|
563 @end |
|
564 |
|
565 @interface WebView (WebViewGrammarChecking) |
|
566 |
|
567 // FIXME: These two methods should be merged into WebViewEditing when we're not in API freeze |
|
568 - (BOOL)isGrammarCheckingEnabled; |
|
569 #ifndef BUILDING_ON_TIGER |
|
570 - (void)setGrammarCheckingEnabled:(BOOL)flag; |
|
571 |
|
572 // FIXME: This method should be merged into WebIBActions when we're not in API freeze |
|
573 - (void)toggleGrammarChecking:(id)sender; |
|
574 #endif |
|
575 |
|
576 @end |
|
577 |
|
578 @interface WebView (WebViewTextChecking) |
|
579 |
|
580 - (BOOL)isAutomaticQuoteSubstitutionEnabled; |
|
581 - (BOOL)isAutomaticLinkDetectionEnabled; |
|
582 - (BOOL)isAutomaticDashSubstitutionEnabled; |
|
583 - (BOOL)isAutomaticTextReplacementEnabled; |
|
584 - (BOOL)isAutomaticSpellingCorrectionEnabled; |
|
585 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) |
|
586 - (void)setAutomaticQuoteSubstitutionEnabled:(BOOL)flag; |
|
587 - (void)toggleAutomaticQuoteSubstitution:(id)sender; |
|
588 - (void)setAutomaticLinkDetectionEnabled:(BOOL)flag; |
|
589 - (void)toggleAutomaticLinkDetection:(id)sender; |
|
590 - (void)setAutomaticDashSubstitutionEnabled:(BOOL)flag; |
|
591 - (void)toggleAutomaticDashSubstitution:(id)sender; |
|
592 - (void)setAutomaticTextReplacementEnabled:(BOOL)flag; |
|
593 - (void)toggleAutomaticTextReplacement:(id)sender; |
|
594 - (void)setAutomaticSpellingCorrectionEnabled:(BOOL)flag; |
|
595 - (void)toggleAutomaticSpellingCorrection:(id)sender; |
|
596 #endif |
|
597 |
|
598 @end |
|
599 |
|
600 @interface WebView (WebViewEditingInMail) |
|
601 - (void)_insertNewlineInQuotedContent; |
|
602 - (void)_replaceSelectionWithNode:(DOMNode *)node matchStyle:(BOOL)matchStyle; |
|
603 - (BOOL)_selectionIsCaret; |
|
604 - (BOOL)_selectionIsAll; |
|
605 @end |
|
606 |
|
607 @protocol WebGeolocationProvider <NSObject> |
|
608 - (void)registerWebView:(WebView *)webView; |
|
609 - (void)unregisterWebView:(WebView *)webView; |
|
610 - (WebGeolocationPosition *)lastPosition; |
|
611 @end |
|
612 |
|
613 @interface WebView (WebViewGeolocation) |
|
614 - (void)_setGeolocationProvider:(id<WebGeolocationProvider>)locationProvider; |
|
615 - (id<WebGeolocationProvider>)_geolocationProvider; |
|
616 |
|
617 - (void)_geolocationDidChangePosition:(WebGeolocationPosition *)position; |
|
618 - (void)_geolocationDidFailWithError:(NSError *)error; |
|
619 @end |
|
620 |
|
621 @interface WebView (WebViewPrivateStyleInfo) |
|
622 - (JSValueRef)_computedStyleIncludingVisitedInfo:(JSContextRef)context forElement:(JSValueRef)value; |
|
623 @end |
|
624 |
|
625 @interface NSObject (WebFrameLoadDelegatePrivate) |
|
626 - (void)webView:(WebView *)sender didFirstLayoutInFrame:(WebFrame *)frame; |
|
627 |
|
628 // didFinishDocumentLoadForFrame is sent when the document has finished loading, though not necessarily all |
|
629 // of its subresources. |
|
630 // FIXME 5259339: Currently this callback is not sent for (some?) pages loaded entirely from the cache. |
|
631 - (void)webView:(WebView *)sender didFinishDocumentLoadForFrame:(WebFrame *)frame; |
|
632 |
|
633 // Addresses 4192534. SPI for now. |
|
634 - (void)webView:(WebView *)sender didHandleOnloadEventsForFrame:(WebFrame *)frame; |
|
635 |
|
636 - (void)webView:(WebView *)sender didFirstVisuallyNonEmptyLayoutInFrame:(WebFrame *)frame; |
|
637 |
|
638 // For implementing the WebInspector's test harness |
|
639 - (void)webView:(WebView *)webView didClearInspectorWindowObject:(WebScriptObject *)windowObject forFrame:(WebFrame *)frame; |
|
640 |
|
641 @end |
|
642 |
|
643 @interface NSObject (WebResourceLoadDelegatePrivate) |
|
644 // Addresses <rdar://problem/5008925> - SPI for now |
|
645 - (NSCachedURLResponse *)webView:(WebView *)sender resource:(id)identifier willCacheResponse:(NSCachedURLResponse *)response fromDataSource:(WebDataSource *)dataSource; |
|
646 @end |
|
647 |
|
648 #undef WebNSInteger |
|
649 #undef WebNSUInteger |