WebViewPrivate.h 21.9 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
 * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1.  Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer. 
 * 2.  Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution. 
 * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
 *     its contributors may be used to endorse or promote products derived
 *     from this software without specific prior written permission. 
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
darin's avatar
darin committed
28

rjw's avatar
WebKit:    
rjw committed
29
#import <WebKit/WebView.h>
trey's avatar
WebKit:    
trey committed
30
#import <WebKit/WebFramePrivate.h>
31

mjs's avatar
mjs committed
32
33
34
35
36
37
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
#define WebNSInteger int
#else
#define WebNSInteger NSInteger
#endif

kocienda's avatar
kocienda committed
38
@class NSError;
darin's avatar
darin committed
39
@class WebFrame;
rjw's avatar
WebKit:    
rjw committed
40
@class WebPreferences;
cblu's avatar
cblu committed
41

trey's avatar
trey committed
42
@protocol WebFormDelegate;
43

mjs's avatar
mjs committed
44
45
46
47
48
49
50
typedef void (*WebDidCancelAuthenticationChallengeFunc)(id, SEL, WebView *, id, NSURLAuthenticationChallenge *, WebDataSource *);
typedef void (*WebDidReceiveAuthenticationChallengeFunc)(id, SEL, WebView *, id, NSURLAuthenticationChallenge *, WebDataSource *);
typedef id (*WebIdentifierForRequestFunc)(id, SEL, WebView *, NSURLRequest *, WebDataSource *);
typedef NSURLRequest *(*WebWillSendRequestFunc)(id, SEL, WebView *, id, NSURLRequest *, NSURLResponse *, WebDataSource *);
typedef void (*WebDidReceiveResponseFunc)(id, SEL, WebView *, id, NSURLResponse *, WebDataSource *);
typedef void (*WebDidReceiveContentLengthFunc)(id, SEL, WebView *, id, WebNSInteger, WebDataSource *);
typedef void (*WebDidFinishLoadingFromDataSourceFunc)(id, SEL, WebView *, id, WebDataSource *);
51
typedef void (*WebDidFailLoadingWithErrorFromDataSourceFunc)(id, SEL, WebView *, id, NSError *, WebDataSource *);
mjs's avatar
mjs committed
52
typedef void (*WebDidLoadResourceFromMemoryCacheFunc)(id, SEL, WebView *, NSURLRequest *, NSURLResponse *, WebNSInteger, WebDataSource *);
beidson's avatar
beidson committed
53
typedef NSCachedURLResponse *(*WebWillCacheResponseFunc)(id, SEL, WebView *, id, NSCachedURLResponse *, WebDataSource *);
mjs's avatar
mjs committed
54

55
typedef struct _WebResourceDelegateImplementationCache {
mjs's avatar
mjs committed
56
57
    uint delegateImplementsDidCancelAuthenticationChallenge:1;
    uint delegateImplementsDidReceiveAuthenticationChallenge:1;
58
59
60
    uint delegateImplementsDidReceiveResponse:1;
    uint delegateImplementsDidReceiveContentLength:1;
    uint delegateImplementsDidFinishLoadingFromDataSource:1;
61
    uint delegateImplementsDidFailLoadingWithErrorFromDataSource:1;
62
63
    uint delegateImplementsWillSendRequest:1;
    uint delegateImplementsIdentifierForRequest:1;
mjs's avatar
mjs committed
64
    uint delegateImplementsDidLoadResourceFromMemoryCache:1;
beidson's avatar
beidson committed
65
    uint delegateImplementsWillCacheResponse:1;
mjs's avatar
mjs committed
66
67
68
69
70
71
72
73

    WebDidCancelAuthenticationChallengeFunc didCancelAuthenticationChallengeFunc;
    WebDidReceiveAuthenticationChallengeFunc didReceiveAuthenticationChallengeFunc;
    WebIdentifierForRequestFunc identifierForRequestFunc;
    WebWillSendRequestFunc willSendRequestFunc;
    WebDidReceiveResponseFunc didReceiveResponseFunc;
    WebDidReceiveContentLengthFunc didReceiveContentLengthFunc;
    WebDidFinishLoadingFromDataSourceFunc didFinishLoadingFromDataSourceFunc;
74
    WebDidFailLoadingWithErrorFromDataSourceFunc didFailLoadingWithErrorFromDataSourceFunc;
mjs's avatar
mjs committed
75
    WebDidLoadResourceFromMemoryCacheFunc didLoadResourceFromMemoryCacheFunc;
beidson's avatar
beidson committed
76
    WebWillCacheResponseFunc willCacheResponseFunc;
77
78
} WebResourceDelegateImplementationCache;

ggaren's avatar
ggaren committed
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
typedef void (*WebDidClearWindowObjectForFrameFunc)(id, SEL, WebView *, WebScriptObject *, WebFrame *);
typedef void (*WebWindowScriptObjectAvailableFunc)(id, SEL, WebView *, WebScriptObject *);
typedef void (*WebDidHandleOnloadEventsForFrameFunc)(id, SEL, WebView *, WebFrame *);
typedef void (*WebDidReceiveServerRedirectForProvisionalLoadForFrameFunc)(id, SEL, WebView *, WebFrame *);
typedef void (*WebDidCancelClientRedirectForFrameFunc)(id, SEL, WebView *, WebFrame *);
typedef void (*WebWillPerformClientRedirectToURLDelayFireDateForFrameFunc)(id, SEL, WebView *, NSURL *, double, NSDate *, WebFrame *);
typedef void (*WebDidChangeLocationWithinPageForFrameFunc)(id, SEL, WebView *, WebFrame *);
typedef void (*WebWillCloseFrameFunc)(id, SEL, WebView *, WebFrame *);
typedef void (*WebDidStartProvisionalLoadForFrameFunc)(id, SEL, WebView *, WebFrame *);
typedef void (*WebDidReceiveTitleForFrameFunc)(id, SEL, WebView *, NSString *, WebFrame *);
typedef void (*WebDidCommitLoadForFrameFunc)(id, SEL, WebView *, WebFrame *);
typedef void (*WebDidFailProvisionalLoadWithErrorForFrameFunc)(id, SEL, WebView *, NSError *, WebFrame *);
typedef void (*WebDidFailLoadWithErrorForFrameFunc)(id, SEL, WebView *, NSError *, WebFrame *);
typedef void (*WebDidFinishLoadForFrameFunc)(id, SEL, WebView *, WebFrame *);
typedef void (*WebDidFirstLayoutInFrameFunc)(id, SEL, WebView *, WebFrame *);
typedef void (*WebDidReceiveIconForFrameFunc)(id, SEL, WebView *, NSImage *, WebFrame *);
typedef void (*WebDidFinishDocumentLoadForFrameFunc)(id, SEL, WebView *, WebFrame *);

typedef struct _WebFrameLoadDelegateImplementationCache {
    uint delegateImplementsDidClearWindowObjectForFrame: 1;
    uint delegateImplementsWindowScriptObjectAvailable: 1;
    uint delegateImplementsDidHandleOnloadEventsForFrame: 1;
    uint delegateImplementsDidReceiveServerRedirectForProvisionalLoadForFrame: 1;
    uint delegateImplementsDidCancelClientRedirectForFrame: 1;
    uint delegateImplementsWillPerformClientRedirectToURLDelayFireDateForFrame: 1;
    uint delegateImplementsDidChangeLocationWithinPageForFrame: 1;
    uint delegateImplementsWillCloseFrame: 1;
    uint delegateImplementsDidStartProvisionalLoadForFrame: 1;
    uint delegateImplementsDidReceiveTitleForFrame: 1;
    uint delegateImplementsDidCommitLoadForFrame: 1;
    uint delegateImplementsDidFailProvisionalLoadWithErrorForFrame: 1;
    uint delegateImplementsDidFailLoadWithErrorForFrame: 1;
    uint delegateImplementsDidFinishLoadForFrame: 1;
    uint delegateImplementsDidFirstLayoutInFrame: 1;
    uint delegateImplementsDidReceiveIconForFrame: 1;
    uint delegateImplementsDidFinishDocumentLoadForFrame: 1;

    WebDidClearWindowObjectForFrameFunc didClearWindowObjectForFrameFunc;
    WebWindowScriptObjectAvailableFunc windowScriptObjectAvailableFunc;
    WebDidHandleOnloadEventsForFrameFunc didHandleOnloadEventsForFrameFunc;
    WebDidReceiveServerRedirectForProvisionalLoadForFrameFunc didReceiveServerRedirectForProvisionalLoadForFrameFunc;
    WebDidCancelClientRedirectForFrameFunc didCancelClientRedirectForFrameFunc;
    WebWillPerformClientRedirectToURLDelayFireDateForFrameFunc willPerformClientRedirectToURLDelayFireDateForFrameFunc;
    WebDidChangeLocationWithinPageForFrameFunc didChangeLocationWithinPageForFrameFunc;
    WebWillCloseFrameFunc willCloseFrameFunc;
    WebDidStartProvisionalLoadForFrameFunc didStartProvisionalLoadForFrameFunc;
    WebDidReceiveTitleForFrameFunc didReceiveTitleForFrameFunc;
    WebDidCommitLoadForFrameFunc didCommitLoadForFrameFunc;
    WebDidFailProvisionalLoadWithErrorForFrameFunc didFailProvisionalLoadWithErrorForFrameFunc;
    WebDidFailLoadWithErrorForFrameFunc didFailLoadWithErrorForFrameFunc;
    WebDidFinishLoadForFrameFunc didFinishLoadForFrameFunc;
    WebDidFirstLayoutInFrameFunc didFirstLayoutInFrameFunc;
    WebDidReceiveIconForFrameFunc didReceiveIconForFrameFunc;
    WebDidFinishDocumentLoadForFrameFunc didFinishDocumentLoadForFrameFunc;
} WebFrameLoadDelegateImplementationCache;

135
136
137
138
139
140
141
extern NSString *_WebCanGoBackKey;
extern NSString *_WebCanGoForwardKey;
extern NSString *_WebEstimatedProgressKey;
extern NSString *_WebIsLoadingKey;
extern NSString *_WebMainFrameIconKey;
extern NSString *_WebMainFrameTitleKey;
extern NSString *_WebMainFrameURLKey;
thatcher's avatar
thatcher committed
142
extern NSString *_WebMainFrameDocumentKey;
143

sullivan's avatar
sullivan committed
144
145
146
// pending public WebElementDictionary keys
extern NSString *WebElementTitleKey;             // NSString of the title of the element (used by Safari)
extern NSString *WebElementSpellingToolTipKey;   // NSString of a tooltip representing misspelling or bad grammar (used internally)
bdakin's avatar
bdakin committed
147
extern NSString *WebElementIsContentEditableKey; // NSNumber indicating whether the inner non-shared node is content editable (used internally)
thatcher's avatar
thatcher committed
148

gdennis's avatar
gdennis committed
149
150
151
// other WebElementDictionary keys
extern NSString *WebElementLinkIsLiveKey;        // NSNumber of BOOL indictating whether the link is live or not

rjw's avatar
WebKit:    
rjw committed
152
typedef enum {
153
154
155
    WebDashboardBehaviorAlwaysSendMouseEventsToAllWindows,
    WebDashboardBehaviorAlwaysSendActiveNullEventsToPlugIns,
    WebDashboardBehaviorAlwaysAcceptsFirstMouse,
ggaren's avatar
ggaren committed
156
157
    WebDashboardBehaviorAllowWheelScrolling,
    WebDashboardBehaviorUseBackwardCompatibilityMode
rjw's avatar
WebKit:    
rjw committed
158
159
} WebDashboardBehavior;

thatcher's avatar
thatcher committed
160
161
162
163
164
165
@interface WebController : NSTreeController {
    IBOutlet WebView *webView;
}
- (WebView *)webView;
- (void)setWebView:(WebView *)newWebView;
@end
rjw's avatar
WebKit:    
rjw committed
166

thatcher's avatar
thatcher committed
167
@interface WebView (WebViewEditingActionsPendingPublic)
168

thatcher's avatar
thatcher committed
169
170
- (void)outdent:(id)sender;

thatcher's avatar
thatcher committed
171
172
173
174
@end

@interface WebView (WebPendingPublic)

sullivan's avatar
sullivan committed
175
176
177
178
179
180
181
182
183
184
185
186
187
/*!
@method searchFor:direction:caseSensitive:wrap:startInSelection:
 @abstract Searches a document view for a string and highlights the string if it is found.
 Starts the search from the current selection.  Will search across all frames.
 @param string The string to search for.
 @param forward YES to search forward, NO to seach backwards.
 @param caseFlag YES to for case-sensitive search, NO for case-insensitive search.
 @param wrapFlag YES to wrap around, NO to avoid wrapping.
 @param startInSelection YES to begin search in the selected text (useful for incremental searching), NO to begin search after the selected text.
 @result YES if found, NO if not found.
 */
- (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag startInSelection:(BOOL)startInSelection;

thatcher's avatar
thatcher committed
188
- (void)setMainFrameDocumentReady:(BOOL)mainFrameDocumentReady;
sullivan's avatar
WebKit:    
sullivan committed
189

thatcher's avatar
thatcher committed
190
191
192
- (void)setTabKeyCyclesThroughElements:(BOOL)cyclesElements;
- (BOOL)tabKeyCyclesThroughElements;

193
194
- (void)scrollDOMRangeToVisible:(DOMRange *)range;

sullivan's avatar
sullivan committed
195
196
197
198
199
// setHoverFeedbackSuspended: can be called by clients that want to temporarily prevent the webView
// from displaying feedback about mouse position. Each WebDocumentView class that displays feedback
// about mouse position should honor this setting.
- (void)setHoverFeedbackSuspended:(BOOL)newValue;
- (BOOL)isHoverFeedbackSuspended;
sullivan's avatar
sullivan committed
200

201
202
203
204
205
206
207
208
209
210
211
212
213
214
/*!
@method setScriptDebugDelegate:
@abstract Set the WebView's WebScriptDebugDelegate delegate.
@param delegate The WebScriptDebugDelegate to set as the delegate.
*/    
- (void)setScriptDebugDelegate:(id)delegate;

/*!
@method scriptDebugDelegate
@abstract Return the WebView's WebScriptDebugDelegate.
@result The WebView's WebScriptDebugDelegate.
*/    
- (id)scriptDebugDelegate;

215
216
- (BOOL)shouldClose;

217
218
219
220
221
222
223
/*!
    @method aeDescByEvaluatingJavaScriptFromString:
    @param script The text of the JavaScript.
    @result The result of the script, converted to an NSAppleEventDescriptor, or nil for failure.
*/
- (NSAppleEventDescriptor *)aeDescByEvaluatingJavaScriptFromString:(NSString *)script;

224
// Support for displaying multiple text matches.
sullivan's avatar
sullivan committed
225
226
// These methods might end up moving into a protocol, so different document types can specify
// whether or not they implement the protocol. For now we'll just deal with HTML.
227
// These methods are still in flux; don't rely on them yet.
sullivan's avatar
sullivan committed
228
- (unsigned)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag highlight:(BOOL)highlight limit:(unsigned)limit;
229
230
- (void)unmarkAllTextMatches;
- (NSArray *)rectsForTextMatches;
sullivan's avatar
sullivan committed
231

232
233
234
235
// Support for disabling registration with the undo manager. This is equivalent to the methods with the same names on NSTextView.
- (BOOL)allowsUndo;
- (void)setAllowsUndo:(BOOL)flag;

236
237
@end

rjw's avatar
WebKit:    
rjw committed
238
239
@interface WebView (WebPrivate)

thatcher's avatar
thatcher committed
240
241
242
+ (BOOL)_developerExtrasEnabled;
+ (BOOL)_scriptDebuggerEnabled;

thatcher's avatar
thatcher committed
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
/*!
    @method setBackgroundColor:
    @param backgroundColor Color to use as the default background.
    @abstract Sets what color the receiver draws under transparent page background colors and images.
    This color is also used when no page is loaded. A color with alpha should only be used when the receiver is
    in a non-opaque window, since the color is drawn using NSCompositeCopy.
*/
- (void)setBackgroundColor:(NSColor *)backgroundColor;

/*!
    @method backgroundColor
    @result Returns the background color drawn under transparent page background colors and images.
    This color is also used when no page is loaded. A color with alpha should only be used when the receiver is
    in a non-opaque window, since the color is drawn using NSCompositeCopy.
*/
- (NSColor *)backgroundColor;

mjs's avatar
mjs committed
260
261
262
263
264
265
266
/*!
Could be worth adding to the API.
 @method loadItemsFromOtherView:
 @abstract Loads the view with the contents of the other view, including its backforward list.
 @param otherView   The WebView from which to copy contents.
 */
- (void)_loadBackForwardListFromOtherView:(WebView *)otherView;
267

cblu's avatar
WebKit:    
cblu committed
268
269
+ (NSArray *)_supportedFileExtensions;

rjw's avatar
WebKit:    
rjw committed
270
271
272
273
274
275
276
277
278
279
280
281
282
283
/*!
    @method canShowFile:
    @abstract Checks if the WebKit can show the content of the file at the specified path.
    @param path The path of the file to check
    @result YES if the WebKit can show the content of the file at the specified path.
*/
+ (BOOL)canShowFile:(NSString *)path;

/*!
    @method suggestedFileExtensionForMIMEType:
    @param MIMEType The MIME type to check.
    @result The extension based on the MIME type
*/
+ (NSString *)suggestedFileExtensionForMIMEType: (NSString *)MIMEType;
284

trey's avatar
trey committed
285
// May well become public
mjs's avatar
mjs committed
286
- (void)_setFormDelegate:(id<WebFormDelegate>)delegate;
trey's avatar
trey committed
287
288
- (id<WebFormDelegate>)_formDelegate;

cblu's avatar
WebKit:    
cblu committed
289
- (void)_close;
darin's avatar
WebKit:    
darin committed
290
291
292
293
294
295
296
297
298
299

/*!
    @method _registerViewClass:representationClass:forURLScheme:
    @discussion Register classes that implement WebDocumentView and WebDocumentRepresentation respectively.
    @param viewClass The WebDocumentView class to use to render data for a given MIME type.
    @param representationClass The WebDocumentRepresentation class to use to represent data of the given MIME type.
    @param scheme The URL scheme to represent with an object of the given class.
*/
+ (void)_registerViewClass:(Class)viewClass representationClass:(Class)representationClass forURLScheme:(NSString *)URLScheme;

cblu's avatar
cblu committed
300
301
+ (void)_unregisterViewClassAndRepresentationClassForMIMEType:(NSString *)MIMEType;

sullivan's avatar
WebKit:    
sullivan committed
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
/*!
     @method _canHandleRequest:
     @abstract Performs a "preflight" operation that performs some
     speculative checks to see if a request can be used to create
     a WebDocumentView and WebDocumentRepresentation.
     @discussion The result of this method is valid only as long as no
     protocols or schemes are registered or unregistered, and as long as
     the request is not mutated (if the request is mutable). Hence, clients
     should be prepared to handle failures even if they have performed request
     preflighting by caling this method.
     @param request The request to preflight.
     @result YES if it is likely that a WebDocumentView and WebDocumentRepresentation
     can be created for the request, NO otherwise.
*/
+ (BOOL)_canHandleRequest:(NSURLRequest *)request;
darin's avatar
WebKit:    
darin committed
317

darin's avatar
darin committed
318
319
+ (NSString *)_decodeData:(NSData *)data;

rjw's avatar
rjw committed
320
+ (void)_setAlwaysUseATSU:(BOOL)f;
321
322
323

- (NSCachedURLResponse *)_cachedResponseForURL:(NSURL *)URL;

rjw's avatar
rjw committed
324
325
326
- (void)_addScrollerDashboardRegions:(NSMutableDictionary *)regions;
- (NSDictionary *)_dashboardRegions;

rjw's avatar
WebKit:    
rjw committed
327
328
329
- (void)_setDashboardBehavior:(WebDashboardBehavior)behavior to:(BOOL)flag;
- (BOOL)_dashboardBehavior:(WebDashboardBehavior)behavior;

330
331
+ (void)_setShouldUseFontSmoothing:(BOOL)f;
+ (BOOL)_shouldUseFontSmoothing;
rjw's avatar
WebKit:    
rjw committed
332

sullivan's avatar
sullivan committed
333
334
+ (NSString *)_minimumRequiredSafariBuildNumber;

thatcher's avatar
thatcher committed
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
/*!
    @method setAlwaysShowVerticalScroller:
    @result Forces the vertical scroller to be visible if flag is YES, otherwise
    if flag is NO the scroller with automatically show and hide as needed.
 */
- (void)setAlwaysShowVerticalScroller:(BOOL)flag;

/*!
    @method alwaysShowVerticalScroller
    @result YES if the vertical scroller is always shown
 */
- (BOOL)alwaysShowVerticalScroller;

/*!
    @method setAlwaysShowHorizontalScroller:
    @result Forces the horizontal scroller to be visible if flag is YES, otherwise
    if flag is NO the scroller with automatically show and hide as needed.
 */
- (void)setAlwaysShowHorizontalScroller:(BOOL)flag;

/*!
    @method alwaysShowHorizontalScroller
    @result YES if the horizontal scroller is always shown
 */
- (BOOL)alwaysShowHorizontalScroller;

tomernic's avatar
tomernic committed
361
362
363
364
365
366
367
/*!
    @method setProhibitsMainFrameScrolling:
    @abstract Prohibits scrolling in the WebView's main frame.  Used to "lock" a WebView
    to a specific scroll position.
  */
- (void)setProhibitsMainFrameScrolling:(BOOL)prohibits;

tomernic's avatar
tomernic committed
368
369
370
371
372
373
/*!
    @method _setAdditionalWebPlugInPaths:
    @abstract Sets additional plugin search paths for a specific WebView.
 */
- (void)_setAdditionalWebPlugInPaths:(NSArray *)newPaths;

374
375
376
377
378
379
380
381
382
383
384
385
/*!
    @method _setInViewSourceMode:
    @abstract Used to place a WebView into a special source-viewing mode.
  */
- (void)_setInViewSourceMode:(BOOL)flag;

/*!
    @method _inViewSourceMode;
    @abstract Whether or not the WebView is in source-view mode for HTML.
  */
- (BOOL)_inViewSourceMode;

thatcher's avatar
thatcher committed
386
387
388
389
390
391
392
393
394
395
396
397
/*!
    @method _attachScriptDebuggerToAllFrames
    @abstract Attaches a script debugger to all frames belonging to the receiver.
 */
- (void)_attachScriptDebuggerToAllFrames;

/*!
    @method _detachScriptDebuggerFromAllFrames
    @abstract Detaches any script debuggers from all frames belonging to the receiver.
 */
- (void)_detachScriptDebuggerFromAllFrames;

darin's avatar
darin committed
398
399
400
- (BOOL)defersCallbacks; // called by QuickTime plug-in
- (void)setDefersCallbacks:(BOOL)defer; // called by QuickTime plug-in

401
402
// <rdar://problem/5217124> Clients other than dashboard, don't use this.
// Do not remove until Dashboard has moved off it
beidson's avatar
beidson committed
403
404
- (void)handleAuthenticationForResource:(id)identifier challenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource;

rjw's avatar
rjw committed
405
@end
rjw's avatar
WebKit:    
rjw committed
406

sullivan's avatar
Tests:    
sullivan committed
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
@interface WebView (WebViewPrintingPrivate)
/*!
    @method _adjustPrintingMarginsForHeaderAndFooter:
    @abstract Increase the top and bottom margins for the current print operation to
    account for the header and footer height. 
    @discussion Called by <WebDocument> implementors once when a print job begins. If the
    <WebDocument> implementor implements knowsPageRange:, this should be called from there.
    Otherwise this should be called from beginDocument. The <WebDocument> implementors need
    to also call _drawHeaderAndFooter.
*/
- (void)_adjustPrintingMarginsForHeaderAndFooter;

/*!
    @method _drawHeaderAndFooter
    @abstract Gives the WebView's UIDelegate a chance to draw a header and footer on the
    printed page. 
    @discussion This should be called by <WebDocument> implementors from an override of
    drawPageBorderWithSize:.
*/
- (void)_drawHeaderAndFooter;
@end

sullivan's avatar
sullivan committed
429
430
431
432
@interface WebView (WebViewGrammarChecking)

// FIXME: These two methods should be merged into WebViewEditing when we're not in API freeze
- (BOOL)isGrammarCheckingEnabled;
bdash's avatar
bdash committed
433
#ifndef BUILDING_ON_TIGER
sullivan's avatar
sullivan committed
434
435
436
437
438
- (void)setGrammarCheckingEnabled:(BOOL)flag;

// FIXME: This method should be merged into WebIBActions when we're not in API freeze
- (void)toggleGrammarChecking:(id)sender;
#endif
sullivan's avatar
sullivan committed
439
@end
sullivan's avatar
sullivan committed
440

kocienda's avatar
kocienda committed
441
442
@interface WebView (WebViewEditingInMail)
- (void)_insertNewlineInQuotedContent;
cblu's avatar
cblu committed
443
444
- (BOOL)_selectWordBeforeMenuEvent;
- (void)_setSelectWordBeforeMenuEvent:(BOOL)flag;
harrison's avatar
harrison committed
445
- (void)_replaceSelectionWithNode:(DOMNode *)node matchStyle:(BOOL)matchStyle;
kocienda's avatar
kocienda committed
446
447
@end

rjw's avatar
WebKit:    
rjw committed
448
449
@interface _WebSafeForwarder : NSObject
{
450
    id target; // Non-retained. Don't retain delegates.
rjw's avatar
WebKit:    
rjw committed
451
452
453
    id defaultTarget;
    Class templateClass;
}
mjs's avatar
mjs committed
454
455
- (id)initWithTarget:(id)t defaultTarget:(id)dt templateClass:(Class)aClass;
+ (id)safeForwarderWithTarget:(id)t defaultTarget:(id)dt templateClass:(Class)aClass;
rjw's avatar
WebKit:    
rjw committed
456
@end
cblu's avatar
cblu committed
457
458
459

@interface NSObject (WebFrameLoadDelegatePrivate)
- (void)webView:(WebView *)sender didFirstLayoutInFrame:(WebFrame *)frame;
sullivan's avatar
sullivan committed
460
461
462
463
464

// didFinishDocumentLoadForFrame is sent when the document has finished loading, though not necessarily all
// of its subresources.
- (void)webView:(WebView *)sender didFinishDocumentLoadForFrame:(WebFrame *)frame;

beidson's avatar
beidson committed
465
// Addresses 4192534.  SPI for now.
justing's avatar
justing committed
466
- (void)webView:(WebView *)sender didHandleOnloadEventsForFrame:(WebFrame *)frame;
ggaren's avatar
ggaren committed
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482

/*!
    @method webView:didClearWindowObject:forFrame:
    @abstract Notifies the delegate that the JavaScript window object in a frame has 
    been cleared in preparation for a new load. This is the preferred place to set custom 
    properties on the window object using the WebScriptObject and JavaScriptCore APIs.
    @param webView The webView sending the message.
    @param windowObject The WebScriptObject representing the frame's JavaScript window object.
    @param frame The WebFrame to which windowObject belongs.
    @discussion If a delegate implements both webView:didClearWindowObject:forFrame:
    and webView:windowScriptObjectAvailable:, only webView:didClearWindowObject:forFrame: 
    will be invoked. This enables a delegate to implement both methods for backwards 
    compatibility with older versions of WebKit.
*/
- (void)webView:(WebView *)webView didClearWindowObject:(WebScriptObject *)windowObject forFrame:(WebFrame *)frame;

cblu's avatar
cblu committed
483
@end
mjs's avatar
mjs committed
484

beidson's avatar
beidson committed
485
486
@interface NSObject (WebResourceLoadDelegatePrivate)
// Addresses <rdar://problem/5008925> - SPI for now
ggaren's avatar
ggaren committed
487
- (NSCachedURLResponse *)webView:(WebView *)sender resource:(id)identifier willCacheResponse:(NSCachedURLResponse *)response fromDataSource:(WebDataSource *)dataSource;
beidson's avatar
beidson committed
488
489
@end

mjs's avatar
mjs committed
490
#undef WebNSInteger