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