WebCore:
[WebKit-https.git] / WebCore / kwq / WebCoreBridge.h
1 /*
2  * Copyright (C) 2004 Apple Computer, 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  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24  */
25
26 #import <Cocoa/Cocoa.h>
27
28 #import <JavaScriptCore/npruntime.h>
29 #import <JavaVM/jni.h>
30 #import <WebCore/WebCoreKeyboardAccess.h>
31
32 #ifdef __cplusplus
33
34 class KWQKHTMLPart;
35 class KHTMLView;
36 class RenderArena;
37
38 namespace khtml {
39     class RenderPart;
40     class RenderObject;
41 }
42
43 typedef khtml::RenderPart KHTMLRenderPart;
44
45 #else
46
47 @class KWQKHTMLPart;
48 @class KHTMLView;
49 @class KHTMLRenderPart;
50 @class RenderArena;
51
52 #endif
53
54 @class DOMCSSStyleDeclaration;
55 @class DOMDocument;
56 @class DOMDocumentFragment;
57 @class DOMElement;
58 @class DOMHTMLElement;
59 @class DOMNode;
60 @class DOMRange;
61 @class WebCoreSettings;
62 @class WebScriptObject;
63
64 @protocol WebCoreDOMTreeCopier;
65 @protocol WebCoreRenderTreeCopier;
66 @protocol WebCoreResourceHandle;
67 @protocol WebCoreResourceLoader;
68 @protocol WebCoreFileButton;
69 @protocol WebCoreFileButtonDelegate;
70
71 extern NSString *WebCoreElementDOMNodeKey;
72 extern NSString *WebCoreElementFrameKey;
73 extern NSString *WebCoreElementImageAltStringKey;
74 extern NSString *WebCoreElementImageKey;
75 extern NSString *WebCoreElementImageRectKey;
76 extern NSString *WebCoreElementImageURLKey;
77 extern NSString *WebCoreElementIsSelectedKey;
78 extern NSString *WebCoreElementLinkURLKey;
79 extern NSString *WebCoreElementLinkTargetFrameKey;
80 extern NSString *WebCoreElementLinkLabelKey;
81 extern NSString *WebCoreElementLinkTitleKey;
82 extern NSString *WebCoreElementTitleKey;
83
84 extern NSString *WebCorePageCacheStateKey;
85
86 typedef enum {
87     WebCoreDeviceScreen,
88     WebCoreDevicePrinter
89 } WebCoreDeviceType;
90
91 typedef enum {
92     WebSelectionStateNone,
93     WebSelectionStateCaret,
94     WebSelectionStateRange,
95 } WebSelectionState;
96
97 typedef enum {
98     WebSelectByMoving,
99     WebSelectByExtending
100 } WebSelectionAlteration;
101
102 typedef enum {
103     WebSelectForward,
104     WebSelectBackward,
105     WebSelectRight,
106     WebSelectLeft
107 } WebSelectionDirection;
108
109 typedef enum {
110     WebSelectByCharacter,
111     WebSelectByWord,
112     WebSelectByLine,
113     WebSelectByParagraph,
114     WebSelectToLineBoundary,
115     WebSelectToParagraphBoundary,
116     WebSelectToDocumentBoundary
117 } WebSelectionGranularity;
118
119 typedef enum {
120     WebScrollUp,
121     WebScrollDown,
122     WebScrollLeft,
123     WebScrollRight
124 } WebScrollDirection;
125
126 typedef enum {
127     WebScrollLine,
128     WebScrollPage,
129     WebScrollDocument,
130     WebScrollWheel
131 } WebScrollGranularity;
132
133 typedef enum {
134     WebUndoActionUnspecified,
135     WebUndoActionSetColor,
136     WebUndoActionSetBackgroundColor,
137     WebUndoActionTurnOffKerning,
138     WebUndoActionTightenKerning,
139     WebUndoActionLoosenKerning,
140     WebUndoActionUseStandardKerning,
141     WebUndoActionTurnOffLigatures,
142     WebUndoActionUseStandardLigatures,
143     WebUndoActionUseAllLigatures,
144     WebUndoActionRaiseBaseline,
145     WebUndoActionLowerBaseline,
146     WebUndoActionSetTraditionalCharacterShape,
147     WebUndoActionSetFont,
148     WebUndoActionChangeAttributes,
149     WebUndoActionAlignLeft,
150     WebUndoActionAlignRight,
151     WebUndoActionCenter,
152     WebUndoActionJustify,
153     WebUndoActionSetWritingDirection,
154     WebUndoActionSubscript,
155     WebUndoActionSuperscript,
156     WebUndoActionUnderline,
157     WebUndoActionOutline,
158     WebUndoActionUnscript,
159     WebUndoActionDrag,
160     WebUndoActionCut,
161     WebUndoActionPaste,
162     WebUndoActionPasteFont,
163     WebUndoActionPasteRuler,
164     WebUndoActionTyping,
165 } WebUndoAction;
166
167 // WebCoreBridge objects are used by WebCore to abstract away operations that need
168 // to be implemented by library clients, for example WebKit. The objects are also
169 // used in the opposite direction, for simple access to WebCore functions without dealing
170 // directly with the KHTML C++ classes.
171
172 // A WebCoreBridge creates and holds a reference to a KHTMLPart.
173
174 // The WebCoreBridge interface contains methods for use by the non-WebCore side of the bridge.
175
176 @interface WebCoreBridge : NSObject
177 {
178     KWQKHTMLPart *_part;
179     KHTMLRenderPart *_renderPart;
180     RenderArena *_renderPartArena;
181     BOOL _shouldCreateRenderers;
182 }
183
184 + (WebCoreBridge *)bridgeForDOMDocument:(DOMDocument *)document;
185
186 - (void)initializeSettings:(WebCoreSettings *)settings;
187
188 - (void)setRenderPart:(KHTMLRenderPart *)renderPart;
189 - (KHTMLRenderPart *)renderPart;
190
191 - (void)setName:(NSString *)name;
192 - (NSString *)name;
193
194 - (KWQKHTMLPart *)part;
195
196 - (void)setParent:(WebCoreBridge *)parent;
197
198 - (void)provisionalLoadStarted;
199
200 - (void)openURL:(NSURL *)URL reload:(BOOL)reload
201     contentType:(NSString *)contentType refresh:(NSString *)refresh lastModified:(NSDate *)lastModified
202     pageCache:(NSDictionary *)pageCache;
203 - (void)setEncoding:(NSString *)encoding userChosen:(BOOL)userChosen;
204 - (void)addData:(NSData *)data;
205 - (void)closeURL;
206
207 - (void)didNotOpenURL:(NSURL *)URL pageCache:(NSDictionary *)pageCache;
208
209 - (void)saveDocumentState;
210 - (void)restoreDocumentState;
211
212 - (BOOL)canCachePage;
213 - (BOOL)saveDocumentToPageCache;
214
215 - (void)end;
216 - (void)stop;
217
218 - (NSURL *)URL;
219 - (NSURL *)baseURL;
220 - (NSString *)referrer;
221 - (NSString *)domain;
222 - (WebCoreBridge *)opener;
223
224 - (void)installInFrame:(NSView *)view;
225 - (void)removeFromFrame;
226
227 - (void)scrollToAnchor:(NSString *)anchor;
228 - (void)scrollToAnchorWithURL:(NSURL *)URL;
229
230 - (BOOL)scrollOverflowInDirection:(WebScrollDirection)direction granularity:(WebScrollGranularity)granularity;
231 - (BOOL)scrollOverflowWithScrollWheelEvent:(NSEvent *)event;
232
233 - (void)createKHTMLViewWithNSView:(NSView *)view marginWidth:(int)mw marginHeight:(int)mh;
234
235 - (BOOL)isFrameSet;
236
237 - (void)reapplyStylesForDeviceType:(WebCoreDeviceType)deviceType;
238 - (void)forceLayoutAdjustingViewSize:(BOOL)adjustSizeFlag;
239 - (void)forceLayoutWithMinimumPageWidth:(float)minPageWidth maximumPageWidth:(float)maxPageWidth adjustingViewSize:(BOOL)adjustSizeFlag;
240 - (void)sendResizeEvent;
241 - (void)sendScrollEvent;
242 - (BOOL)needsLayout;
243 - (void)setNeedsLayout;
244 - (void)drawRect:(NSRect)rect;
245 - (void)adjustPageHeightNew:(float *)newBottom top:(float)oldTop bottom:(float)oldBottom limit:(float)bottomLimit;
246 - (NSArray*)computePageRectsWithPrintWidthScaleFactor:(float)printWidthScaleFactor printHeight:(float)printHeight;
247
248 - (void)setActivationEventNumber:(int)num;
249 - (void)mouseDown:(NSEvent *)event;
250 - (void)mouseUp:(NSEvent *)event;
251 - (void)mouseMoved:(NSEvent *)event;
252 - (void)mouseDragged:(NSEvent *)event;
253
254 - (BOOL)sendContextMenuEvent:(NSEvent *)event; // return YES if event is eaten by WebCore
255
256 - (NSView *)nextKeyView;
257 - (NSView *)previousKeyView;
258
259 - (NSView *)nextKeyViewInsideWebFrameViews;
260 - (NSView *)previousKeyViewInsideWebFrameViews;
261
262 - (NSObject *)copyDOMTree:(id <WebCoreDOMTreeCopier>)copier;
263 - (NSObject *)copyRenderTree:(id <WebCoreRenderTreeCopier>)copier;
264 - (NSString *)renderTreeAsExternalRepresentation;
265
266 - (NSDictionary *)elementAtPoint:(NSPoint)point;
267 - (NSURL *)URLWithAttributeString:(NSString *)string;
268
269 - (DOMElement *)elementWithName:(NSString *)name inForm:(DOMElement *)form;
270 - (DOMElement *)elementForView:(NSView *)view;
271 - (BOOL)elementDoesAutoComplete:(DOMElement *)element;
272 - (BOOL)elementIsPassword:(DOMElement *)element;
273 - (DOMElement *)formForElement:(DOMElement *)element;
274 - (DOMElement *)currentForm;
275 - (NSArray *)controlsInForm:(DOMElement *)form;
276 - (NSString *)searchForLabels:(NSArray *)labels beforeElement:(DOMElement *)element;
277 - (NSString *)matchLabels:(NSArray *)labels againstElement:(DOMElement *)element;
278
279 - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag;
280 - (void)jumpToSelection;
281 - (NSString *)advanceToNextMisspelling;
282 - (NSString *)advanceToNextMisspellingStartingJustBeforeSelection;
283
284 - (void)setTextSizeMultiplier:(float)multiplier;
285
286 - (CFStringEncoding)textEncoding;
287
288 - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)string;
289 - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)string forceUserGesture:(BOOL)forceUserGesture;
290
291 - (DOMDocument *)DOMDocument;
292 - (DOMHTMLElement *)frameElement;
293
294 - (BOOL)isSelectionEditable;
295 - (WebSelectionState)selectionState;
296
297 - (NSAttributedString *)selectedAttributedString;
298 - (NSString *)selectedString;
299
300 - (void)setSelectionFromNone;
301 - (void)setDisplaysWithFocusAttributes:(BOOL)flag;
302
303 - (NSString *)stringForRange:(DOMRange *)range;
304
305 - (NSString *)markupStringFromNode:(DOMNode *)node nodes:(NSArray **)nodes;
306 - (NSString *)markupStringFromRange:(DOMRange *)range nodes:(NSArray **)nodes;
307
308 - (void)selectAll;
309 - (void)deselectAll;
310 - (void)deselectText;
311
312 - (NSRect)selectionRect;
313 - (NSRect)visibleSelectionRect;
314 - (void)centerSelectionInVisibleArea;
315 - (NSImage *)selectionImage;
316 - (NSRect)caretRectAtNode:(DOMNode *)node offset:(int)offset affinity:(NSSelectionAffinity)affinity;
317 - (NSRect)firstRectForDOMRange:(DOMRange *)range;
318
319 - (void)setSelectedDOMRange:(DOMRange *)range affinity:(NSSelectionAffinity)selectionAffinity;
320 - (DOMRange *)selectedDOMRange;
321 - (NSSelectionAffinity)selectionAffinity;
322
323 // Emacs-style-editing "mark"
324 - (void)setMarkDOMRange:(DOMRange *)range;
325 - (DOMRange *)markDOMRange;
326
327 // international text input "marked text"
328 - (void)setMarkedTextDOMRange:(DOMRange *)range customAttributes:(NSArray *)attributes ranges:(NSArray *)ranges;
329 - (DOMRange *)markedTextDOMRange;
330
331 - (NSAttributedString *)attributedStringFrom:(DOMNode *)startNode startOffset:(int)startOffset to:(DOMNode *)endNode endOffset:(int)endOffset;
332
333 - (NSFont *)fontForSelection:(BOOL *)hasMultipleFonts;
334 - (NSDictionary *)fontAttributesForSelectionStart;
335 - (NSWritingDirection)baseWritingDirectionForSelectionStart;
336
337 + (NSString *)stringWithData:(NSData *)data textEncoding:(CFStringEncoding)textEncoding;
338 + (NSString *)stringWithData:(NSData *)data textEncodingName:(NSString *)textEncodingName;
339
340 - (BOOL)interceptKeyEvent:(NSEvent *)event toView:(NSView *)view;
341
342 - (void)setShouldCreateRenderers:(BOOL)f;
343 - (BOOL)shouldCreateRenderers;
344
345 - (int)numPendingOrLoadingRequests;
346 - (BOOL)doneProcessingData;
347
348 - (void)setDrawsBackground:(BOOL)drawsBackround;
349
350 - (NSColor *)bodyBackgroundColor;
351 - (NSColor *)selectionColor;
352
353 - (void)adjustViewSize;
354
355 - (id)accessibilityTree;
356
357 - (void)undoEditing:(id)arg;
358 - (void)redoEditing:(id)arg;
359
360 - (DOMRange *)rangeByExpandingSelectionWithGranularity:(WebSelectionGranularity)granularity;
361 - (DOMRange *)rangeOfCharactersAroundCaret;
362 - (DOMRange *)rangeByAlteringCurrentSelection:(WebSelectionAlteration)alteration direction:(WebSelectionDirection)direction granularity:(WebSelectionGranularity)granularity;
363 - (void)alterCurrentSelection:(WebSelectionAlteration)alteration direction:(WebSelectionDirection)direction granularity:(WebSelectionGranularity)granularity;
364 - (DOMRange *)rangeByAlteringCurrentSelection:(WebSelectionAlteration)alteration verticalDistance:(float)distance;
365 - (void)alterCurrentSelection:(WebSelectionAlteration)alteration verticalDistance:(float)distance;
366 - (WebSelectionGranularity)selectionGranularity;
367
368 - (DOMDocumentFragment *)documentFragmentWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString;
369 - (DOMDocumentFragment *)documentFragmentWithText:(NSString *)text;
370
371 - (void)replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle;
372 - (void)replaceSelectionWithNode:(DOMNode *)node selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
373 - (void)replaceSelectionWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
374 - (void)replaceSelectionWithText:(NSString *)text selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
375
376 - (void)insertLineBreak;
377 - (void)insertParagraphSeparator;
378 - (void)insertParagraphSeparatorInQuotedContent;
379 - (void)insertText:(NSString *)text selectInsertedText:(BOOL)selectInsertedText;
380
381 - (void)setSelectionToDragCaret;
382 - (void)moveSelectionToDragCaret:(DOMDocumentFragment *)selectionFragment smartMove:(BOOL)smartMove;
383 - (void)moveDragCaretToPoint:(NSPoint)point;
384 - (void)removeDragCaret;
385 - (DOMRange *)dragCaretDOMRange;
386 - (DOMRange *)editableDOMRangeForPoint:(NSPoint)point;
387
388 - (void)deleteSelectionWithSmartDelete:(BOOL)smartDelete;
389 - (void)deleteKeyPressedWithSmartDelete:(BOOL)smartDelete;
390 - (void)forwardDeleteKeyPressedWithSmartDelete:(BOOL)smartDelete;
391
392 - (DOMCSSStyleDeclaration *)typingStyle;
393 - (void)setTypingStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
394 - (void)applyStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
395 - (void)applyParagraphStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
396 - (BOOL)selectionStartHasStyle:(DOMCSSStyleDeclaration *)style;
397 - (NSCellStateValue)selectionHasStyle:(DOMCSSStyleDeclaration *)style;
398 - (void)applyEditingStyleToBodyElement;
399 - (void)removeEditingStyleFromBodyElement;
400 - (void)applyEditingStyleToElement:(DOMElement *)element;
401 - (void)removeEditingStyleFromElement:(DOMElement *)element;
402
403 - (void)ensureSelectionVisible;
404
405 - (WebScriptObject *)windowScriptObject;
406 - (NPObject *)windowScriptNPObject;
407
408 - (BOOL)eventMayStartDrag:(NSEvent *)event;
409 - (NSDragOperation)dragOperationForDraggingInfo:(id <NSDraggingInfo>)info;
410 - (void)dragExitedWithDraggingInfo:(id <NSDraggingInfo>)info;
411 - (BOOL)concludeDragForDraggingInfo:(id <NSDraggingInfo>)info;
412 - (void)dragSourceMovedTo:(NSPoint)windowLoc;
413 - (void)dragSourceEndedAt:(NSPoint)windowLoc operation:(NSDragOperation)operation;
414
415 - (BOOL)mayDHTMLCut;
416 - (BOOL)mayDHTMLCopy;
417 - (BOOL)mayDHTMLPaste;
418 - (BOOL)tryDHTMLCut;
419 - (BOOL)tryDHTMLCopy;
420 - (BOOL)tryDHTMLPaste;
421
422 - (NSMutableDictionary *)dashboardRegions;
423
424 - (void)clear;
425
426 @end
427
428 // The WebCoreBridge protocol contains methods for use by the WebCore side of the bridge.
429
430 // In NSArray objects for post data, NSData objects represent literal data, and NSString objects represent encoded files.
431 // The encoding is the standard form encoding for uploading files.
432
433 @protocol WebCoreBridge
434
435 - (NSArray *)childFrames; // WebCoreBridge objects
436 - (WebCoreBridge *)mainFrame;
437 - (WebCoreBridge *)findFrameNamed:(NSString *)name;
438 /* Creates a name for an frame unnamed in the HTML.  It should produce repeatable results for loads of the same frameset. */
439 - (NSString *)generateFrameName;
440 - (void)frameDetached;
441 - (NSView *)documentView;
442
443 - (void)loadURL:(NSURL *)URL referrer:(NSString *)referrer reload:(BOOL)reload userGesture:(BOOL)forUser target:(NSString *)target triggeringEvent:(NSEvent *)event form:(DOMElement *)form formValues:(NSDictionary *)values;
444 - (void)postWithURL:(NSURL *)URL referrer:(NSString *)referrer target:(NSString *)target data:(NSArray *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(DOMElement *)form formValues:(NSDictionary *)values;
445
446 - (WebCoreBridge *)createWindowWithURL:(NSURL *)URL frameName:(NSString *)name;
447 - (void)showWindow;
448
449 - (NSString *)userAgentForURL:(NSURL *)URL;
450
451 - (void)setTitle:(NSString *)title;
452 - (void)setStatusText:(NSString *)status;
453
454 - (void)setIconURL:(NSURL *)URL;
455 - (void)setIconURL:(NSURL *)URL withType:(NSString *)string;
456
457 - (WebCoreBridge *)createChildFrameNamed:(NSString *)frameName withURL:(NSURL *)URL
458     renderPart:(KHTMLRenderPart *)renderPart
459     allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height;
460
461 - (BOOL)areToolbarsVisible;
462 - (void)setToolbarsVisible:(BOOL)visible;
463 - (BOOL)isStatusBarVisible;
464 - (void)setStatusBarVisible:(BOOL)visible;
465 - (BOOL)areScrollbarsVisible;
466 - (void)setScrollbarsVisible:(BOOL)visible;
467 - (NSWindow *)window;
468 - (void)setWindowFrame:(NSRect)frame;
469 - (NSRect)windowFrame;
470 - (void)setWindowContentRect:(NSRect)frame;
471 - (NSRect)windowContentRect;
472
473 - (void)setWindowIsResizable:(BOOL)resizable;
474 - (BOOL)windowIsResizable;
475
476 - (NSResponder *)firstResponder;
477 - (void)makeFirstResponder:(NSResponder *)responder;
478
479 - (BOOL)wasFirstResponderAtMouseDownTime:(NSResponder *)responder;
480
481 - (void)closeWindowSoon;
482
483 - (void)runJavaScriptAlertPanelWithMessage:(NSString *)message;
484 - (BOOL)runJavaScriptConfirmPanelWithMessage:(NSString *)message;
485 - (BOOL)runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText returningText:(NSString **)result;
486 - (void)addMessageToConsole:(NSDictionary *)message;
487
488 - (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)loader withURL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders;
489 - (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)loader withURL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders postData:(NSArray *)data;
490 - (void)objectLoadedFromCacheWithURL:(NSURL *)URL response:(NSURLResponse *)response data:(NSData *)data;
491
492 - (NSData *)syncLoadResourceWithURL:(NSURL *)URL customHeaders:(NSDictionary *)requestHeaders postData:(NSArray *)postData finalURL:(NSURL **)finalNSURL responseHeaders:(NSDictionary **)responseHeaderDict statusCode:(int *)statusCode;
493
494 - (BOOL)isReloading;
495 - (time_t)expiresTimeForResponse:(NSURLResponse *)response;
496
497 - (void)reportClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date lockHistory:(BOOL)lockHistory isJavaScriptFormAction:(BOOL)isJavaScriptFormAction;
498 - (void)reportClientRedirectCancelled:(BOOL)cancelWithLoadInProgress;
499
500 - (void)focusWindow;
501 - (void)unfocusWindow;
502
503 - (NSView *)nextKeyViewOutsideWebFrameViews;
504 - (NSView *)previousKeyViewOutsideWebFrameViews;
505
506 - (BOOL)defersLoading;
507 - (void)setDefersLoading:(BOOL)loading;
508 - (void)saveDocumentState:(NSArray *)documentState;
509 - (NSArray *)documentState;
510
511 - (void)setNeedsReapplyStyles;
512
513 - (void)tokenizerProcessedData;
514
515 // OK to be an NSString rather than an NSURL.
516 // This URL is only used for coloring visited links.
517 - (NSString *)requestedURLString;
518 - (NSString *)incomingReferrer;
519
520 - (NSView *)viewForPluginWithURL:(NSURL *)URL
521                   attributeNames:(NSArray *)attributeNames
522                  attributeValues:(NSArray *)attributeValues
523                         MIMEType:(NSString *)MIMEType;
524 - (NSView *)viewForJavaAppletWithFrame:(NSRect)frame
525                         attributeNames:(NSArray *)attributeNames
526                        attributeValues:(NSArray *)attributeValues
527                                baseURL:(NSURL *)baseURL;
528
529 - (BOOL)saveDocumentToPageCache:(id)documentInfo;
530
531 - (int)getObjectCacheSize;
532
533 - (BOOL)frameRequiredForMIMEType:(NSString*)MIMEType URL:(NSURL *)URL;
534
535 - (void)loadEmptyDocumentSynchronously;
536
537 - (NSString *)MIMETypeForPath:(NSString *)path;
538
539 - (void)allowDHTMLDrag:(BOOL *)flagDHTML UADrag:(BOOL *)flagUA;
540 - (BOOL)startDraggingImage:(NSImage *)dragImage at:(NSPoint)dragLoc operation:(NSDragOperation)op event:(NSEvent *)event sourceIsDHTML:(BOOL)flag DHTMLWroteData:(BOOL)dhtmlWroteData;
541 - (void)handleAutoscrollForMouseDragged:(NSEvent *)event;
542 - (BOOL)mayStartDragAtEventLocation:(NSPoint)location;
543
544 - (BOOL)selectWordBeforeMenuEvent;
545
546 - (int)historyLength;
547 - (void)goBackOrForward:(int)distance;
548 - (BOOL)canGoBackOrForward:(int)distance;
549
550 - (void)controlTextDidBeginEditing:(NSNotification *)obj;
551 - (void)controlTextDidEndEditing:(NSNotification *)obj;
552 - (void)controlTextDidChange:(NSNotification *)obj;
553
554 - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor;
555 - (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor;
556 - (BOOL)control:(NSControl *)control didFailToFormatString:(NSString *)string errorDescription:(NSString *)error;
557 - (void)control:(NSControl *)control didFailToValidatePartialString:(NSString *)string errorDescription:(NSString *)error;
558 - (BOOL)control:(NSControl *)control isValidObject:(id)obj;
559 - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector;
560 - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView shouldHandleEvent:(NSEvent *)event;
561
562 - (NSView <WebCoreFileButton> *)fileButtonWithDelegate:(id <WebCoreFileButtonDelegate>)delegate;
563
564 - (void)setHasBorder:(BOOL)hasBorder;
565
566 - (WebCoreKeyboardUIMode)keyboardUIMode;
567
568 - (void)didSetName:(NSString *)name;
569
570 - (NSFileWrapper *)fileWrapperForURL:(NSURL *)URL;
571
572 - (void)print;
573
574 - (jobject)getAppletInView:(NSView *)view;
575
576 // Deprecated, use getAppletInView: instead.
577 - (jobject)pollForAppletInView:(NSView *)view;
578
579 - (NSUndoManager *)undoManager;
580 - (NSString *)nameForUndoAction:(WebUndoAction)undoAction;
581 - (void)issueCutCommand;
582 - (void)issueCopyCommand;
583 - (void)issuePasteCommand;
584 - (void)issuePasteAndMatchStyleCommand;
585 - (void)respondToChangedSelection;
586 - (void)respondToChangedContents;
587 - (void)setIsSelected:(BOOL)isSelected forView:(NSView *)view;
588 - (BOOL)isEditable;
589 - (BOOL)shouldBeginEditing:(DOMRange *)range;
590 - (BOOL)shouldEndEditing:(DOMRange *)range;
591 - (BOOL)canPaste;
592
593 - (NSString *)overrideMediaType;
594
595 - (void)windowObjectCleared;
596
597 - (int)spellCheckerDocumentTag;
598 - (BOOL)isContinuousSpellCheckingEnabled;
599
600 - (void)didFirstLayout;
601
602 - (void)dashboardRegionsChanged:(NSMutableDictionary *)regions;
603
604 - (BOOL)isCharacterSmartReplaceExempt:(unichar)c isPreviousCharacter:(BOOL)isPreviousCharacter;
605
606 @end
607
608 // This interface definition allows those who hold a WebCoreBridge * to call all the methods
609 // in the WebCoreBridge protocol without requiring the base implementation to supply the methods.
610 // This idiom is appropriate because WebCoreBridge is an abstract class.
611
612 @interface WebCoreBridge (SubclassResponsibility) <WebCoreBridge>
613 @end
614
615 @protocol WebCoreDOMTreeCopier <NSObject>
616 - (NSObject *)nodeWithName:(NSString *)name value:(NSString *)value source:(NSString *)source children:(NSArray *)children;
617 @end
618
619 @protocol WebCoreRenderTreeCopier <NSObject>
620 - (NSObject *)nodeWithName:(NSString *)name position:(NSPoint)p rect:(NSRect)rect view:(NSView *)view children:(NSArray *)children;
621 @end
622
623 @protocol WebCoreFileButton <NSObject>
624 - (void)setFilename:(NSString *)filename;
625 - (void)performClick;
626 - (NSString *)filename;
627 - (float)baseline;
628 - (void)setVisualFrame:(NSRect)rect;
629 - (NSRect)visualFrame;
630 - (NSSize)bestVisualFrameSizeForCharacterCount:(int)count;
631 @end
632
633 @protocol WebCoreFileButtonDelegate <NSObject>
634 - (void)filenameChanged:(NSString *)filename;
635 - (void)focusChanged:(BOOL)nowHasFocus;
636 - (void)clicked;
637 @end