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 - (BOOL)canLoadURL:(NSURL *)URL fromReferrer:(NSString *)referrer hideReferrer:(BOOL *)hideReferrer;
210
211 - (void)saveDocumentState;
212 - (void)restoreDocumentState;
213
214 - (BOOL)canCachePage;
215 - (BOOL)saveDocumentToPageCache;
216
217 - (void)end;
218 - (void)stop;
219
220 - (NSURL *)URL;
221 - (NSURL *)baseURL;
222 - (NSString *)referrer;
223 - (NSString *)domain;
224 - (WebCoreBridge *)opener;
225
226 - (void)installInFrame:(NSView *)view;
227 - (void)removeFromFrame;
228
229 - (void)scrollToAnchor:(NSString *)anchor;
230 - (void)scrollToAnchorWithURL:(NSURL *)URL;
231
232 - (BOOL)scrollOverflowInDirection:(WebScrollDirection)direction granularity:(WebScrollGranularity)granularity;
233 - (BOOL)scrollOverflowWithScrollWheelEvent:(NSEvent *)event;
234
235 - (void)createKHTMLViewWithNSView:(NSView *)view marginWidth:(int)mw marginHeight:(int)mh;
236
237 - (BOOL)isFrameSet;
238
239 - (void)reapplyStylesForDeviceType:(WebCoreDeviceType)deviceType;
240 - (void)forceLayoutAdjustingViewSize:(BOOL)adjustSizeFlag;
241 - (void)forceLayoutWithMinimumPageWidth:(float)minPageWidth maximumPageWidth:(float)maxPageWidth adjustingViewSize:(BOOL)adjustSizeFlag;
242 - (void)sendResizeEvent;
243 - (void)sendScrollEvent;
244 - (BOOL)needsLayout;
245 - (void)setNeedsLayout;
246 - (void)drawRect:(NSRect)rect;
247 - (void)adjustPageHeightNew:(float *)newBottom top:(float)oldTop bottom:(float)oldBottom limit:(float)bottomLimit;
248 - (NSArray*)computePageRectsWithPrintWidthScaleFactor:(float)printWidthScaleFactor printHeight:(float)printHeight;
249
250 - (void)setActivationEventNumber:(int)num;
251 - (void)mouseDown:(NSEvent *)event;
252 - (void)mouseUp:(NSEvent *)event;
253 - (void)mouseMoved:(NSEvent *)event;
254 - (void)mouseDragged:(NSEvent *)event;
255
256 - (BOOL)sendContextMenuEvent:(NSEvent *)event; // return YES if event is eaten by WebCore
257
258 - (NSView *)nextKeyView;
259 - (NSView *)previousKeyView;
260
261 - (NSView *)nextKeyViewInsideWebFrameViews;
262 - (NSView *)previousKeyViewInsideWebFrameViews;
263
264 - (NSObject *)copyDOMTree:(id <WebCoreDOMTreeCopier>)copier;
265 - (NSObject *)copyRenderTree:(id <WebCoreRenderTreeCopier>)copier;
266 - (NSString *)renderTreeAsExternalRepresentation;
267
268 - (NSDictionary *)elementAtPoint:(NSPoint)point;
269 - (NSURL *)URLWithAttributeString:(NSString *)string;
270
271 - (DOMElement *)elementWithName:(NSString *)name inForm:(DOMElement *)form;
272 - (DOMElement *)elementForView:(NSView *)view;
273 - (BOOL)elementDoesAutoComplete:(DOMElement *)element;
274 - (BOOL)elementIsPassword:(DOMElement *)element;
275 - (DOMElement *)formForElement:(DOMElement *)element;
276 - (DOMElement *)currentForm;
277 - (NSArray *)controlsInForm:(DOMElement *)form;
278 - (NSString *)searchForLabels:(NSArray *)labels beforeElement:(DOMElement *)element;
279 - (NSString *)matchLabels:(NSArray *)labels againstElement:(DOMElement *)element;
280
281 - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag;
282 - (void)jumpToSelection;
283
284 - (NSString *)advanceToNextMisspelling;
285 - (NSString *)advanceToNextMisspellingStartingJustBeforeSelection;
286 - (void)unmarkAllMisspellings;
287
288 - (void)setTextSizeMultiplier:(float)multiplier;
289
290 - (CFStringEncoding)textEncoding;
291
292 - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)string;
293 - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)string forceUserGesture:(BOOL)forceUserGesture;
294
295 - (DOMDocument *)DOMDocument;
296 - (DOMHTMLElement *)frameElement;
297
298 - (BOOL)isSelectionEditable;
299 - (WebSelectionState)selectionState;
300
301 - (NSAttributedString *)selectedAttributedString;
302 - (NSString *)selectedString;
303
304 - (void)setSelectionFromNone;
305 - (void)setDisplaysWithFocusAttributes:(BOOL)flag;
306
307 - (void)setWindowHasFocus:(BOOL)flag;
308
309 - (NSString *)stringForRange:(DOMRange *)range;
310
311 - (NSString *)markupStringFromNode:(DOMNode *)node nodes:(NSArray **)nodes;
312 - (NSString *)markupStringFromRange:(DOMRange *)range nodes:(NSArray **)nodes;
313
314 - (void)selectAll;
315 - (void)deselectAll;
316 - (void)deselectText;
317
318 - (NSRect)selectionRect;
319 - (NSRect)visibleSelectionRect;
320 - (void)centerSelectionInVisibleArea;
321 - (NSImage *)selectionImage;
322 - (NSRect)caretRectAtNode:(DOMNode *)node offset:(int)offset affinity:(NSSelectionAffinity)affinity;
323 - (NSRect)firstRectForDOMRange:(DOMRange *)range;
324
325 - (void)setSelectedDOMRange:(DOMRange *)range affinity:(NSSelectionAffinity)selectionAffinity closeTyping:(BOOL)closeTyping;
326 - (DOMRange *)selectedDOMRange;
327 - (NSSelectionAffinity)selectionAffinity;
328
329 // Emacs-style-editing "mark"
330 - (void)setMarkDOMRange:(DOMRange *)range;
331 - (DOMRange *)markDOMRange;
332
333 // international text input "marked text"
334 - (void)setMarkedTextDOMRange:(DOMRange *)range customAttributes:(NSArray *)attributes ranges:(NSArray *)ranges;
335 - (DOMRange *)markedTextDOMRange;
336 - (void)replaceMarkedTextWithText:(NSString *)text;
337
338 - (NSAttributedString *)attributedStringFrom:(DOMNode *)startNode startOffset:(int)startOffset to:(DOMNode *)endNode endOffset:(int)endOffset;
339
340 - (NSFont *)fontForSelection:(BOOL *)hasMultipleFonts;
341 - (NSDictionary *)fontAttributesForSelectionStart;
342 - (NSWritingDirection)baseWritingDirectionForSelectionStart;
343
344 + (NSString *)stringWithData:(NSData *)data textEncoding:(CFStringEncoding)textEncoding;
345 + (NSString *)stringWithData:(NSData *)data textEncodingName:(NSString *)textEncodingName;
346
347 - (BOOL)interceptKeyEvent:(NSEvent *)event toView:(NSView *)view;
348
349 - (void)setShouldCreateRenderers:(BOOL)f;
350 - (BOOL)shouldCreateRenderers;
351
352 - (int)numPendingOrLoadingRequests;
353 - (BOOL)doneProcessingData;
354
355 - (void)setDrawsBackground:(BOOL)drawsBackround;
356
357 - (NSColor *)bodyBackgroundColor;
358 - (NSColor *)selectionColor;
359
360 - (void)adjustViewSize;
361
362 - (id)accessibilityTree;
363
364 - (void)undoEditing:(id)arg;
365 - (void)redoEditing:(id)arg;
366
367 - (DOMRange *)rangeByExpandingSelectionWithGranularity:(WebSelectionGranularity)granularity;
368 - (DOMRange *)rangeOfCharactersAroundCaret;
369 - (DOMRange *)rangeByAlteringCurrentSelection:(WebSelectionAlteration)alteration direction:(WebSelectionDirection)direction granularity:(WebSelectionGranularity)granularity;
370 - (void)alterCurrentSelection:(WebSelectionAlteration)alteration direction:(WebSelectionDirection)direction granularity:(WebSelectionGranularity)granularity;
371 - (DOMRange *)rangeByAlteringCurrentSelection:(WebSelectionAlteration)alteration verticalDistance:(float)distance;
372 - (void)alterCurrentSelection:(WebSelectionAlteration)alteration verticalDistance:(float)distance;
373 - (WebSelectionGranularity)selectionGranularity;
374 - (DOMRange *)smartDeleteRangeForProposedRange:(DOMRange *)proposedCharRange;
375 - (void)smartInsertForString:(NSString *)pasteString replacingRange:(DOMRange *)charRangeToReplace beforeString:(NSString **)beforeString afterString:(NSString **)afterString;
376 - (BOOL)canDeleteRange:(DOMRange *)range;
377 - (void)selectNSRange:(NSRange)range;
378 - (NSRange)selectedNSRange;
379 - (NSRange)markedTextNSRange;
380 - (DOMRange *)convertToObjCDOMRange:(NSRange)range;
381
382 - (DOMDocumentFragment *)documentFragmentWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString;
383 - (DOMDocumentFragment *)documentFragmentWithText:(NSString *)text;
384
385 - (void)replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle;
386 - (void)replaceSelectionWithNode:(DOMNode *)node selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
387 - (void)replaceSelectionWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
388 - (void)replaceSelectionWithText:(NSString *)text selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
389
390 - (void)insertLineBreak;
391 - (void)insertParagraphSeparator;
392 - (void)insertParagraphSeparatorInQuotedContent;
393 - (void)insertText:(NSString *)text selectInsertedText:(BOOL)selectInsertedText;
394
395 - (void)setSelectionToDragCaret;
396 - (void)moveSelectionToDragCaret:(DOMDocumentFragment *)selectionFragment smartMove:(BOOL)smartMove;
397 - (void)moveDragCaretToPoint:(NSPoint)point;
398 - (void)removeDragCaret;
399 - (DOMRange *)dragCaretDOMRange;
400 - (DOMRange *)editableDOMRangeForPoint:(NSPoint)point;
401
402 - (void)deleteSelectionWithSmartDelete:(BOOL)smartDelete;
403 - (void)deleteKeyPressedWithSmartDelete:(BOOL)smartDelete;
404 - (void)forwardDeleteKeyPressedWithSmartDelete:(BOOL)smartDelete;
405
406 - (DOMCSSStyleDeclaration *)typingStyle;
407 - (void)setTypingStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
408 - (void)applyStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
409 - (void)applyParagraphStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
410 - (BOOL)selectionStartHasStyle:(DOMCSSStyleDeclaration *)style;
411 - (NSCellStateValue)selectionHasStyle:(DOMCSSStyleDeclaration *)style;
412 - (void)applyEditingStyleToBodyElement;
413 - (void)removeEditingStyleFromBodyElement;
414 - (void)applyEditingStyleToElement:(DOMElement *)element;
415 - (void)removeEditingStyleFromElement:(DOMElement *)element;
416
417 - (void)ensureSelectionVisible;
418
419 - (WebScriptObject *)windowScriptObject;
420 - (NPObject *)windowScriptNPObject;
421
422 - (BOOL)eventMayStartDrag:(NSEvent *)event;
423 - (NSDragOperation)dragOperationForDraggingInfo:(id <NSDraggingInfo>)info;
424 - (void)dragExitedWithDraggingInfo:(id <NSDraggingInfo>)info;
425 - (BOOL)concludeDragForDraggingInfo:(id <NSDraggingInfo>)info;
426 - (void)dragSourceMovedTo:(NSPoint)windowLoc;
427 - (void)dragSourceEndedAt:(NSPoint)windowLoc operation:(NSDragOperation)operation;
428
429 - (BOOL)mayDHTMLCut;
430 - (BOOL)mayDHTMLCopy;
431 - (BOOL)mayDHTMLPaste;
432 - (BOOL)tryDHTMLCut;
433 - (BOOL)tryDHTMLCopy;
434 - (BOOL)tryDHTMLPaste;
435
436 - (NSMutableDictionary *)dashboardRegions;
437
438 - (void)clear;
439
440 @end
441
442 // The WebCoreBridge protocol contains methods for use by the WebCore side of the bridge.
443
444 // In NSArray objects for post data, NSData objects represent literal data, and NSString objects represent encoded files.
445 // The encoding is the standard form encoding for uploading files.
446
447 @protocol WebCoreBridge
448
449 - (NSArray *)childFrames; // WebCoreBridge objects
450 - (WebCoreBridge *)mainFrame;
451 - (WebCoreBridge *)findFrameNamed:(NSString *)name;
452 /* Creates a name for an frame unnamed in the HTML.  It should produce repeatable results for loads of the same frameset. */
453 - (NSString *)generateFrameName;
454 - (void)frameDetached;
455 - (NSView *)documentView;
456
457 - (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;
458 - (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;
459
460 - (WebCoreBridge *)createWindowWithURL:(NSURL *)URL frameName:(NSString *)name;
461 - (void)showWindow;
462
463 - (NSString *)userAgentForURL:(NSURL *)URL;
464
465 - (void)setTitle:(NSString *)title;
466 - (void)setStatusText:(NSString *)status;
467
468 - (void)setIconURL:(NSURL *)URL;
469 - (void)setIconURL:(NSURL *)URL withType:(NSString *)string;
470
471 - (WebCoreBridge *)createChildFrameNamed:(NSString *)frameName withURL:(NSURL *)URL
472     referrer:(NSString *)referrer
473     renderPart:(KHTMLRenderPart *)renderPart
474     allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height;
475
476 - (BOOL)areToolbarsVisible;
477 - (void)setToolbarsVisible:(BOOL)visible;
478 - (BOOL)isStatusBarVisible;
479 - (void)setStatusBarVisible:(BOOL)visible;
480 - (BOOL)areScrollbarsVisible;
481 - (void)setScrollbarsVisible:(BOOL)visible;
482 - (NSWindow *)window;
483 - (void)setWindowFrame:(NSRect)frame;
484 - (NSRect)windowFrame;
485 - (void)setWindowContentRect:(NSRect)frame;
486 - (NSRect)windowContentRect;
487
488 - (void)setWindowIsResizable:(BOOL)resizable;
489 - (BOOL)windowIsResizable;
490
491 - (NSResponder *)firstResponder;
492 - (void)makeFirstResponder:(NSResponder *)responder;
493
494 - (BOOL)wasFirstResponderAtMouseDownTime:(NSResponder *)responder;
495
496 - (void)closeWindowSoon;
497
498 - (void)runJavaScriptAlertPanelWithMessage:(NSString *)message;
499 - (BOOL)runJavaScriptConfirmPanelWithMessage:(NSString *)message;
500 - (BOOL)runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText returningText:(NSString **)result;
501 - (void)addMessageToConsole:(NSDictionary *)message;
502
503 - (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)loader withURL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders;
504 - (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)loader withURL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders postData:(NSArray *)data;
505 - (void)objectLoadedFromCacheWithURL:(NSURL *)URL response:(NSURLResponse *)response data:(NSData *)data;
506
507 - (NSData *)syncLoadResourceWithURL:(NSURL *)URL customHeaders:(NSDictionary *)requestHeaders postData:(NSArray *)postData finalURL:(NSURL **)finalNSURL responseHeaders:(NSDictionary **)responseHeaderDict statusCode:(int *)statusCode;
508
509 - (BOOL)isReloading;
510 - (time_t)expiresTimeForResponse:(NSURLResponse *)response;
511
512 - (void)reportClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date lockHistory:(BOOL)lockHistory isJavaScriptFormAction:(BOOL)isJavaScriptFormAction;
513 - (void)reportClientRedirectCancelled:(BOOL)cancelWithLoadInProgress;
514
515 - (void)focusWindow;
516 - (void)unfocusWindow;
517
518 - (NSView *)nextKeyViewOutsideWebFrameViews;
519 - (NSView *)nextValidKeyViewOutsideWebFrameViews;
520 - (NSView *)previousKeyViewOutsideWebFrameViews;
521
522 - (BOOL)defersLoading;
523 - (void)setDefersLoading:(BOOL)loading;
524 - (void)saveDocumentState:(NSArray *)documentState;
525 - (NSArray *)documentState;
526
527 - (void)setNeedsReapplyStyles;
528
529 - (void)tokenizerProcessedData;
530
531 // OK to be an NSString rather than an NSURL.
532 // This URL is only used for coloring visited links.
533 - (NSString *)requestedURLString;
534 - (NSString *)incomingReferrer;
535
536 - (NSView *)viewForPluginWithURL:(NSURL *)URL
537                   attributeNames:(NSArray *)attributeNames
538                  attributeValues:(NSArray *)attributeValues
539                         MIMEType:(NSString *)MIMEType;
540 - (NSView *)viewForJavaAppletWithFrame:(NSRect)frame
541                         attributeNames:(NSArray *)attributeNames
542                        attributeValues:(NSArray *)attributeValues
543                                baseURL:(NSURL *)baseURL;
544
545 - (BOOL)saveDocumentToPageCache:(id)documentInfo;
546
547 - (int)getObjectCacheSize;
548
549 - (BOOL)frameRequiredForMIMEType:(NSString*)MIMEType URL:(NSURL *)URL;
550
551 - (void)loadEmptyDocumentSynchronously;
552
553 - (NSString *)MIMETypeForPath:(NSString *)path;
554
555 - (void)allowDHTMLDrag:(BOOL *)flagDHTML UADrag:(BOOL *)flagUA;
556 - (BOOL)startDraggingImage:(NSImage *)dragImage at:(NSPoint)dragLoc operation:(NSDragOperation)op event:(NSEvent *)event sourceIsDHTML:(BOOL)flag DHTMLWroteData:(BOOL)dhtmlWroteData;
557 - (void)handleAutoscrollForMouseDragged:(NSEvent *)event;
558 - (BOOL)mayStartDragAtEventLocation:(NSPoint)location;
559
560 - (BOOL)selectWordBeforeMenuEvent;
561
562 - (int)historyLength;
563 - (void)goBackOrForward:(int)distance;
564 - (BOOL)canGoBackOrForward:(int)distance;
565
566 - (void)controlTextDidBeginEditing:(NSNotification *)obj;
567 - (void)controlTextDidEndEditing:(NSNotification *)obj;
568 - (void)controlTextDidChange:(NSNotification *)obj;
569
570 - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor;
571 - (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor;
572 - (BOOL)control:(NSControl *)control didFailToFormatString:(NSString *)string errorDescription:(NSString *)error;
573 - (void)control:(NSControl *)control didFailToValidatePartialString:(NSString *)string errorDescription:(NSString *)error;
574 - (BOOL)control:(NSControl *)control isValidObject:(id)obj;
575 - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector;
576 - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView shouldHandleEvent:(NSEvent *)event;
577
578 - (NSView <WebCoreFileButton> *)fileButtonWithDelegate:(id <WebCoreFileButtonDelegate>)delegate;
579
580 - (void)setHasBorder:(BOOL)hasBorder;
581
582 - (WebCoreKeyboardUIMode)keyboardUIMode;
583
584 - (void)didSetName:(NSString *)name;
585
586 - (NSFileWrapper *)fileWrapperForURL:(NSURL *)URL;
587
588 - (void)print;
589
590 - (jobject)getAppletInView:(NSView *)view;
591
592 // Deprecated, use getAppletInView: instead.
593 - (jobject)pollForAppletInView:(NSView *)view;
594
595 - (NSUndoManager *)undoManager;
596 - (NSString *)nameForUndoAction:(WebUndoAction)undoAction;
597 - (void)issueCutCommand;
598 - (void)issueCopyCommand;
599 - (void)issuePasteCommand;
600 - (void)issuePasteAndMatchStyleCommand;
601 - (void)respondToChangedSelection;
602 - (void)respondToChangedContents;
603 - (void)setIsSelected:(BOOL)isSelected forView:(NSView *)view;
604 - (BOOL)isEditable;
605 - (BOOL)shouldBeginEditing:(DOMRange *)range;
606 - (BOOL)shouldEndEditing:(DOMRange *)range;
607 - (BOOL)canPaste;
608
609 - (NSString *)overrideMediaType;
610
611 - (void)windowObjectCleared;
612
613 - (int)spellCheckerDocumentTag;
614 - (BOOL)isContinuousSpellCheckingEnabled;
615
616 - (void)didFirstLayout;
617
618 - (void)dashboardRegionsChanged:(NSMutableDictionary *)regions;
619
620 - (BOOL)isCharacterSmartReplaceExempt:(unichar)c isPreviousCharacter:(BOOL)isPreviousCharacter;
621
622 @end
623
624 // This interface definition allows those who hold a WebCoreBridge * to call all the methods
625 // in the WebCoreBridge protocol without requiring the base implementation to supply the methods.
626 // This idiom is appropriate because WebCoreBridge is an abstract class.
627
628 @interface WebCoreBridge (SubclassResponsibility) <WebCoreBridge>
629 @end
630
631 @protocol WebCoreDOMTreeCopier <NSObject>
632 - (NSObject *)nodeWithName:(NSString *)name value:(NSString *)value source:(NSString *)source children:(NSArray *)children;
633 @end
634
635 @protocol WebCoreRenderTreeCopier <NSObject>
636 - (NSObject *)nodeWithName:(NSString *)name position:(NSPoint)p rect:(NSRect)rect view:(NSView *)view children:(NSArray *)children;
637 @end
638
639 @protocol WebCoreFileButton <NSObject>
640 - (void)setFilename:(NSString *)filename;
641 - (void)performClick;
642 - (NSString *)filename;
643 - (float)baseline;
644 - (void)setVisualFrame:(NSRect)rect;
645 - (NSRect)visualFrame;
646 - (NSSize)bestVisualFrameSizeForCharacterCount:(int)count;
647 @end
648
649 @protocol WebCoreFileButtonDelegate <NSObject>
650 - (void)filenameChanged:(NSString *)filename;
651 - (void)focusChanged:(BOOL)nowHasFocus;
652 - (void)clicked;
653 @end