a2259bddb6a5f7983a0a7fbf33a6418bb0cd10d2
[WebKit-https.git] / WebCore / bridge / mac / WebCoreFrameBridge.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 RenderArena;
35
36 namespace WebCore {
37     class FrameMac;
38     class RenderPart;
39 }
40
41 typedef WebCore::FrameMac WebCoreMacFrame;
42 typedef WebCore::RenderPart WebCoreRenderPart;
43
44 #else
45
46 @class WebCoreMacFrame;
47 @class WebCoreRenderPart;
48 @class RenderArena;
49
50 #endif
51
52 @class DOMCSSStyleDeclaration;
53 @class DOMDocument;
54 @class DOMDocumentFragment;
55 @class DOMElement;
56 @class DOMHTMLElement;
57 @class DOMHTMLInputElement;
58 @class DOMHTMLTextAreaElement;
59 @class DOMNode;
60 @class DOMRange;
61 @class WebCorePageBridge;
62 @class WebCoreSettings;
63 @class WebScriptObject;
64 @class WebView;
65
66 @protocol WebCoreRenderTreeCopier;
67 @protocol WebCoreResourceHandle;
68 @protocol WebCoreResourceLoader;
69
70 extern NSString *WebCorePageCacheStateKey;
71
72 typedef enum {
73     WebCoreDeviceScreen,
74     WebCoreDevicePrinter
75 } WebCoreDeviceType;
76
77 typedef enum {
78     WebSelectionStateNone,
79     WebSelectionStateCaret,
80     WebSelectionStateRange,
81 } WebSelectionState;
82
83 typedef enum {
84     WebSelectByMoving,
85     WebSelectByExtending
86 } WebSelectionAlteration;
87
88 typedef enum {
89     WebBridgeSelectForward,
90     WebBridgeSelectBackward,
91     WebBridgeSelectRight,
92     WebBridgeSelectLeft
93 } WebBridgeSelectionDirection;
94
95 typedef enum {
96     WebBridgeSelectByCharacter,
97     WebBridgeSelectByWord,
98     WebBridgeSelectBySentence,
99     WebBridgeSelectByLine,
100     WebBridgeSelectByParagraph,
101     WebBridgeSelectToSentenceBoundary,
102     WebBridgeSelectToLineBoundary,
103     WebBridgeSelectToParagraphBoundary,
104     WebBridgeSelectToDocumentBoundary
105 } WebBridgeSelectionGranularity;
106
107 typedef enum {
108     WebScrollUp,
109     WebScrollDown,
110     WebScrollLeft,
111     WebScrollRight
112 } WebScrollDirection;
113
114 typedef enum {
115     WebScrollLine,
116     WebScrollPage,
117     WebScrollDocument,
118     WebScrollWheel
119 } WebScrollGranularity;
120
121 typedef enum {
122     WebUndoActionUnspecified,
123     WebUndoActionSetColor,
124     WebUndoActionSetBackgroundColor,
125     WebUndoActionTurnOffKerning,
126     WebUndoActionTightenKerning,
127     WebUndoActionLoosenKerning,
128     WebUndoActionUseStandardKerning,
129     WebUndoActionTurnOffLigatures,
130     WebUndoActionUseStandardLigatures,
131     WebUndoActionUseAllLigatures,
132     WebUndoActionRaiseBaseline,
133     WebUndoActionLowerBaseline,
134     WebUndoActionSetTraditionalCharacterShape,
135     WebUndoActionSetFont,
136     WebUndoActionChangeAttributes,
137     WebUndoActionAlignLeft,
138     WebUndoActionAlignRight,
139     WebUndoActionCenter,
140     WebUndoActionJustify,
141     WebUndoActionSetWritingDirection,
142     WebUndoActionSubscript,
143     WebUndoActionSuperscript,
144     WebUndoActionUnderline,
145     WebUndoActionOutline,
146     WebUndoActionUnscript,
147     WebUndoActionDrag,
148     WebUndoActionCut,
149     WebUndoActionPaste,
150     WebUndoActionPasteFont,
151     WebUndoActionPasteRuler,
152     WebUndoActionTyping,
153     WebUndoActionCreateLink,
154     WebUndoActionUnlink,
155 } WebUndoAction;
156
157 typedef enum {
158     ObjectElementNone,
159     ObjectElementImage,
160     ObjectElementFrame,
161     ObjectElementPlugin,
162 } ObjectElementType;
163
164 @protocol WebCoreOpenPanelResultListener <NSObject>
165 - (void)chooseFilename:(NSString *)fileName;
166 - (void)cancel;
167 @end
168
169 // WebCoreFrameBridge objects are used by WebCore to abstract away operations that need
170 // to be implemented by library clients, for example WebKit. The objects are also
171 // used in the opposite direction, for simple access to WebCore functions without dealing
172 // directly with the KHTML C++ classes.
173
174 // A WebCoreFrameBridge creates and holds a reference to a Frame.
175
176 // The WebCoreFrameBridge interface contains methods for use by the non-WebCore side of the bridge.
177
178 @interface WebCoreFrameBridge : NSObject
179 {
180     WebCoreMacFrame *m_frame;
181     BOOL _shouldCreateRenderers;
182 }
183
184 + (WebCoreFrameBridge *)bridgeForDOMDocument:(DOMDocument *)document;
185
186 - (id)initMainFrameWithPage:(WebCorePageBridge *)page;
187 - (id)initSubframeWithRenderer:(WebCoreRenderPart *)renderer;
188
189 + (NSArray *)supportedMIMETypes;
190
191 - (void)initializeSettings:(WebCoreSettings *)settings;
192
193 - (void)setName:(NSString *)name;
194 - (NSString *)name;
195
196 - (WebCorePageBridge *)page;
197
198 - (WebCoreFrameBridge *)parent;
199
200 - (WebCoreFrameBridge *)firstChild;
201 - (WebCoreFrameBridge *)lastChild;
202 - (WebCoreFrameBridge *)previousSibling;
203 - (WebCoreFrameBridge *)nextSibling;
204
205 - (void)appendChild:(WebCoreFrameBridge *)child;
206 - (void)removeChild:(WebCoreFrameBridge *)child;
207
208 - (unsigned)childCount;
209 - (BOOL)isDescendantOfFrame:(WebCoreFrameBridge *)ancestor;
210 - (WebCoreFrameBridge *)traverseNextFrameStayWithin:(WebCoreFrameBridge *)stayWithin;
211
212 - (WebCoreFrameBridge *)nextFrameWithWrap:(BOOL)wrap;
213 - (WebCoreFrameBridge *)previousFrameWithWrap:(BOOL)wrap;
214
215 - (WebCoreFrameBridge *)childFrameNamed:(NSString *)name;
216 - (WebCoreFrameBridge *)findFrameNamed:(NSString *)name;
217
218 - (void)provisionalLoadStarted;
219
220 - (void)openURL:(NSURL *)URL reload:(BOOL)reload
221     contentType:(NSString *)contentType refresh:(NSString *)refresh lastModified:(NSDate *)lastModified
222     pageCache:(NSDictionary *)pageCache;
223 - (void)setEncoding:(NSString *)encoding userChosen:(BOOL)userChosen;
224 - (void)addData:(NSData *)data;
225 - (void)closeURL;
226 - (void)stopLoading;
227
228 - (void)didNotOpenURL:(NSURL *)URL pageCache:(NSDictionary *)pageCache;
229
230 - (BOOL)canLoadURL:(NSURL *)URL fromReferrer:(NSString *)referrer hideReferrer:(BOOL *)hideReferrer;
231
232 - (void)saveDocumentState;
233 - (void)restoreDocumentState;
234
235 - (BOOL)canCachePage;
236 - (BOOL)saveDocumentToPageCache;
237
238 - (void)end;
239 - (void)stop;
240
241 - (void)clearFrame;
242 - (void)handleFallbackContent;
243
244 - (NSURL *)URL;
245 - (NSURL *)baseURL;
246 - (NSString *)referrer;
247 - (NSString *)domain;
248 - (WebCoreFrameBridge *)opener;
249 - (void)setOpener:(WebCoreFrameBridge *)bridge;
250
251 - (void)installInFrame:(NSView *)view;
252 - (void)removeFromFrame;
253
254 - (void)scrollToAnchor:(NSString *)anchor;
255 - (void)scrollToAnchorWithURL:(NSURL *)URL;
256
257 - (BOOL)scrollOverflowInDirection:(WebScrollDirection)direction granularity:(WebScrollGranularity)granularity;
258
259 - (void)createFrameViewWithNSView:(NSView *)view marginWidth:(int)mw marginHeight:(int)mh;
260
261 - (BOOL)isFrameSet;
262
263 - (void)reapplyStylesForDeviceType:(WebCoreDeviceType)deviceType;
264 - (void)forceLayoutAdjustingViewSize:(BOOL)adjustSizeFlag;
265 - (void)forceLayoutWithMinimumPageWidth:(float)minPageWidth maximumPageWidth:(float)maxPageWidth adjustingViewSize:(BOOL)adjustSizeFlag;
266 - (void)sendResizeEvent;
267 - (void)sendScrollEvent;
268 - (BOOL)needsLayout;
269 - (void)setNeedsLayout;
270 - (void)drawRect:(NSRect)rect;
271 - (void)adjustPageHeightNew:(float *)newBottom top:(float)oldTop bottom:(float)oldBottom limit:(float)bottomLimit;
272 - (NSArray*)computePageRectsWithPrintWidthScaleFactor:(float)printWidthScaleFactor printHeight:(float)printHeight;
273
274 - (void)setActivationEventNumber:(int)num;
275 - (void)mouseDown:(NSEvent *)event;
276 - (void)mouseUp:(NSEvent *)event;
277 - (void)mouseMoved:(NSEvent *)event;
278 - (void)mouseDragged:(NSEvent *)event;
279
280 // these return YES if event is eaten by WebCore
281 - (BOOL)sendScrollWheelEvent:(NSEvent *)event;
282 - (BOOL)sendContextMenuEvent:(NSEvent *)event;
283
284 - (NSView *)nextKeyView;
285 - (NSView *)previousKeyView;
286
287 - (NSView *)nextKeyViewInsideWebFrameViews;
288 - (NSView *)previousKeyViewInsideWebFrameViews;
289
290 - (NSObject *)copyRenderTree:(id <WebCoreRenderTreeCopier>)copier;
291 - (NSString *)renderTreeAsExternalRepresentation;
292
293 - (void)getInnerNonSharedNode:(DOMNode **)innerNonSharedNode innerNode:(DOMNode **)innerNode URLElement:(DOMElement **)URLElement atPoint:(NSPoint)point allowShadowContent:(BOOL)allow;
294 - (BOOL)isPointInsideSelection:(NSPoint)point;
295
296 - (NSURL *)URLWithAttributeString:(NSString *)string;
297
298 - (DOMElement *)elementWithName:(NSString *)name inForm:(DOMElement *)form;
299 - (DOMElement *)elementForView:(NSView *)view;
300 - (BOOL)elementDoesAutoComplete:(DOMElement *)element;
301 - (BOOL)elementIsPassword:(DOMElement *)element;
302 - (DOMElement *)formForElement:(DOMElement *)element;
303 - (DOMElement *)currentForm;
304 - (NSArray *)controlsInForm:(DOMElement *)form;
305 - (NSString *)searchForLabels:(NSArray *)labels beforeElement:(DOMElement *)element;
306 - (NSString *)matchLabels:(NSArray *)labels againstElement:(DOMElement *)element;
307
308 - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag;
309 - (unsigned)highlightAllMatchesForString:(NSString *)string caseSensitive:(BOOL)caseFlag;
310 - (void)clearHighlightedMatches;
311
312 - (NSString *)advanceToNextMisspelling;
313 - (NSString *)advanceToNextMisspellingStartingJustBeforeSelection;
314 - (void)unmarkAllMisspellings;
315
316 - (void)setTextSizeMultiplier:(float)multiplier;
317
318 - (CFStringEncoding)textEncoding;
319
320 - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)string;
321 - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)string forceUserGesture:(BOOL)forceUserGesture;
322 - (NSAppleEventDescriptor *)aeDescByEvaluatingJavaScriptFromString:(NSString *)string;
323
324 - (DOMDocument *)DOMDocument;
325 - (DOMHTMLElement *)frameElement;
326
327 - (BOOL)isSelectionEditable;
328 - (BOOL)isSelectionRichlyEditable;
329 - (WebSelectionState)selectionState;
330
331 - (NSAttributedString *)selectedAttributedString;
332 - (NSString *)selectedString;
333
334 - (void)setSelectionFromNone;
335 - (void)setDisplaysWithFocusAttributes:(BOOL)flag;
336
337 - (void)setWindowHasFocus:(BOOL)flag;
338
339 - (NSString *)stringForRange:(DOMRange *)range;
340
341 - (NSString *)markupStringFromNode:(DOMNode *)node nodes:(NSArray **)nodes;
342 - (NSString *)markupStringFromRange:(DOMRange *)range nodes:(NSArray **)nodes;
343
344 - (void)selectAll;
345 - (void)deselectAll;
346 - (void)deselectText;
347
348 - (NSRect)selectionRect;
349 - (NSRect)visibleSelectionRect;
350 - (void)centerSelectionInVisibleArea;
351 - (NSImage *)selectionImage;
352 - (NSRect)caretRectAtNode:(DOMNode *)node offset:(int)offset affinity:(NSSelectionAffinity)affinity;
353 - (NSRect)firstRectForDOMRange:(DOMRange *)range;
354
355 - (void)setSelectedDOMRange:(DOMRange *)range affinity:(NSSelectionAffinity)selectionAffinity closeTyping:(BOOL)closeTyping;
356 - (DOMRange *)selectedDOMRange;
357 - (NSSelectionAffinity)selectionAffinity;
358
359 // Emacs-style-editing "mark"
360 - (void)setMarkDOMRange:(DOMRange *)range;
361 - (DOMRange *)markDOMRange;
362
363 // international text input "marked text"
364 - (void)setMarkedTextDOMRange:(DOMRange *)range customAttributes:(NSArray *)attributes ranges:(NSArray *)ranges;
365 - (DOMRange *)markedTextDOMRange;
366 - (void)replaceMarkedTextWithText:(NSString *)text;
367
368 - (NSAttributedString *)attributedStringFrom:(DOMNode *)startNode startOffset:(int)startOffset to:(DOMNode *)endNode endOffset:(int)endOffset;
369
370 - (NSFont *)fontForSelection:(BOOL *)hasMultipleFonts;
371 - (NSDictionary *)fontAttributesForSelectionStart;
372 - (NSWritingDirection)baseWritingDirectionForSelectionStart;
373
374 + (NSString *)stringWithData:(NSData *)data textEncoding:(CFStringEncoding)textEncoding;
375 + (NSString *)stringWithData:(NSData *)data textEncodingName:(NSString *)textEncodingName;
376
377 - (BOOL)interceptKeyEvent:(NSEvent *)event toView:(NSView *)view;
378
379 - (void)setShouldCreateRenderers:(BOOL)f;
380 - (BOOL)shouldCreateRenderers;
381
382 - (int)numPendingOrLoadingRequests;
383 - (BOOL)doneProcessingData;
384 - (BOOL)shouldClose;
385
386 - (void)setDrawsBackground:(BOOL)drawsBackround;
387
388 - (NSColor *)bodyBackgroundColor;
389 - (NSColor *)selectionColor;
390
391 - (void)adjustViewSize;
392
393 - (id)accessibilityTree;
394
395 - (void)undoEditing:(id)arg;
396 - (void)redoEditing:(id)arg;
397
398 - (DOMRange *)rangeByExpandingSelectionWithGranularity:(WebBridgeSelectionGranularity)granularity;
399 - (DOMRange *)rangeOfCharactersAroundCaret;
400 - (DOMRange *)rangeByAlteringCurrentSelection:(WebSelectionAlteration)alteration direction:(WebBridgeSelectionDirection)direction granularity:(WebBridgeSelectionGranularity)granularity;
401 - (void)alterCurrentSelection:(WebSelectionAlteration)alteration direction:(WebBridgeSelectionDirection)direction granularity:(WebBridgeSelectionGranularity)granularity;
402 - (DOMRange *)rangeByAlteringCurrentSelection:(WebSelectionAlteration)alteration verticalDistance:(float)distance;
403 - (void)alterCurrentSelection:(WebSelectionAlteration)alteration verticalDistance:(float)distance;
404 - (WebBridgeSelectionGranularity)selectionGranularity;
405 - (DOMRange *)smartDeleteRangeForProposedRange:(DOMRange *)proposedCharRange;
406 - (void)smartInsertForString:(NSString *)pasteString replacingRange:(DOMRange *)charRangeToReplace beforeString:(NSString **)beforeString afterString:(NSString **)afterString;
407 - (BOOL)canDeleteRange:(DOMRange *)range;
408 - (void)selectNSRange:(NSRange)range;
409 - (NSRange)selectedNSRange;
410 - (NSRange)markedTextNSRange;
411 - (DOMRange *)convertNSRangeToDOMRange:(NSRange)range;
412 - (NSRange)convertDOMRangeToNSRange:(DOMRange *)range;
413
414 - (DOMDocumentFragment *)documentFragmentWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString;
415 - (DOMDocumentFragment *)documentFragmentWithText:(NSString *)text;
416 - (DOMDocumentFragment *)documentFragmentWithNodesAsParagraphs:(NSArray *)nodes;
417
418 - (void)replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle;
419 - (void)replaceSelectionWithNode:(DOMNode *)node selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
420 - (void)replaceSelectionWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
421 - (void)replaceSelectionWithText:(NSString *)text selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
422
423 - (bool)canIncreaseSelectionListLevel;
424 - (bool)canDecreaseSelectionListLevel;
425 - (void)increaseSelectionListLevel;
426 - (void)decreaseSelectionListLevel;
427
428 - (void)insertLineBreak;
429 - (void)insertParagraphSeparator;
430 - (void)insertParagraphSeparatorInQuotedContent;
431 - (void)insertText:(NSString *)text selectInsertedText:(BOOL)selectInsertedText;
432
433 - (void)setSelectionToDragCaret;
434 - (void)moveSelectionToDragCaret:(DOMDocumentFragment *)selectionFragment smartMove:(BOOL)smartMove;
435 - (void)moveDragCaretToPoint:(NSPoint)point;
436 - (void)removeDragCaret;
437 - (DOMRange *)dragCaretDOMRange;
438 - (BOOL)isDragCaretRichlyEditable;
439 - (DOMRange *)editableDOMRangeForPoint:(NSPoint)point;
440 - (DOMRange *)characterRangeAtPoint:(NSPoint)point;
441
442 - (void)deleteSelectionWithSmartDelete:(BOOL)smartDelete;
443 - (void)deleteKeyPressedWithSmartDelete:(BOOL)smartDelete;
444 - (void)forwardDeleteKeyPressedWithSmartDelete:(BOOL)smartDelete;
445
446 - (DOMCSSStyleDeclaration *)typingStyle;
447 - (void)setTypingStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
448 - (void)applyStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
449 - (void)applyParagraphStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
450 - (BOOL)selectionStartHasStyle:(DOMCSSStyleDeclaration *)style;
451 - (NSCellStateValue)selectionHasStyle:(DOMCSSStyleDeclaration *)style;
452 - (void)applyEditingStyleToBodyElement;
453 - (void)removeEditingStyleFromBodyElement;
454 - (void)applyEditingStyleToElement:(DOMElement *)element;
455 - (void)removeEditingStyleFromElement:(DOMElement *)element;
456
457 - (void)ensureSelectionVisible;
458
459 - (WebScriptObject *)windowScriptObject;
460 - (NPObject *)windowScriptNPObject;
461
462 - (BOOL)eventMayStartDrag:(NSEvent *)event;
463 - (NSDragOperation)dragOperationForDraggingInfo:(id <NSDraggingInfo>)info;
464 - (void)dragExitedWithDraggingInfo:(id <NSDraggingInfo>)info;
465 - (BOOL)concludeDragForDraggingInfo:(id <NSDraggingInfo>)info;
466 - (void)dragSourceMovedTo:(NSPoint)windowLoc;
467 - (void)dragSourceEndedAt:(NSPoint)windowLoc operation:(NSDragOperation)operation;
468
469 - (BOOL)mayDHTMLCut;
470 - (BOOL)mayDHTMLCopy;
471 - (BOOL)mayDHTMLPaste;
472 - (BOOL)tryDHTMLCut;
473 - (BOOL)tryDHTMLCopy;
474 - (BOOL)tryDHTMLPaste;
475
476 - (NSMutableDictionary *)dashboardRegions;
477
478 - (void)clear;
479
480 @end
481
482 // The WebCoreFrameBridge protocol contains methods for use by the WebCore side of the bridge.
483
484 // In NSArray objects for post data, NSData objects represent literal data, and NSString objects represent encoded files.
485 // The encoding is the standard form encoding for uploading files.
486
487 @protocol WebCoreFrameBridge
488
489 - (void)frameDetached;
490 - (NSView *)documentView;
491
492 - (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;
493 - (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;
494
495 - (WebCorePageBridge *)createWindowWithURL:(NSURL *)URL;
496 - (void)showWindow;
497
498 - (BOOL)canRunModal;
499 - (BOOL)canRunModalNow;
500 - (WebCorePageBridge *)createModalDialogWithURL:(NSURL *)URL;
501 - (void)runModal;
502
503 - (NSString *)userAgentForURL:(NSURL *)URL;
504
505 - (void)setTitle:(NSString *)title;
506 - (void)setStatusText:(NSString *)status;
507
508 - (void)setIconURL:(NSURL *)URL;
509 - (void)setIconURL:(NSURL *)URL withType:(NSString *)string;
510
511 - (WebCoreFrameBridge *)createChildFrameNamed:(NSString *)frameName withURL:(NSURL *)URL
512     referrer:(NSString *)referrer
513     renderPart:(WebCoreRenderPart *)renderPart
514     allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height;
515
516 - (BOOL)areToolbarsVisible;
517 - (void)setToolbarsVisible:(BOOL)visible;
518 - (BOOL)isStatusbarVisible;
519 - (void)setStatusbarVisible:(BOOL)visible;
520 - (BOOL)areScrollbarsVisible;
521 - (void)setScrollbarsVisible:(BOOL)visible;
522 - (NSWindow *)window;
523
524 - (void)setWindowIsResizable:(BOOL)resizable;
525 - (BOOL)windowIsResizable;
526
527 - (NSResponder *)firstResponder;
528 - (void)makeFirstResponder:(NSResponder *)responder;
529 - (void)willMakeFirstResponderForNodeFocus;
530
531 - (BOOL)wasFirstResponderAtMouseDownTime:(NSResponder *)responder;
532
533 - (void)closeWindowSoon;
534
535 - (void)runJavaScriptAlertPanelWithMessage:(NSString *)message;
536 - (BOOL)runJavaScriptConfirmPanelWithMessage:(NSString *)message;
537 - (BOOL)runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText returningText:(NSString **)result;
538 - (BOOL)canRunBeforeUnloadConfirmPanel;
539 - (BOOL)runBeforeUnloadConfirmPanelWithMessage:(NSString *)message;
540 - (void)addMessageToConsole:(NSDictionary *)message;
541 - (void)runOpenPanelForFileButtonWithResultListener:(id <WebCoreOpenPanelResultListener>)resultListener;
542
543 - (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)loader withMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders;
544 - (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)loader withMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders postData:(NSArray *)data;
545 - (void)objectLoadedFromCacheWithURL:(NSURL *)URL response:(NSURLResponse *)response data:(NSData *)data;
546
547 - (NSData *)syncLoadResourceWithMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)requestHeaders postData:(NSArray *)postData finalURL:(NSURL **)finalNSURL responseHeaders:(NSDictionary **)responseHeaderDict statusCode:(int *)statusCode;
548
549 - (BOOL)isReloading;
550 - (time_t)expiresTimeForResponse:(NSURLResponse *)response;
551
552 - (void)reportClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date lockHistory:(BOOL)lockHistory isJavaScriptFormAction:(BOOL)isJavaScriptFormAction;
553 - (void)reportClientRedirectCancelled:(BOOL)cancelWithLoadInProgress;
554
555 - (void)focusWindow;
556 - (void)unfocusWindow;
557
558 - (void)formControlIsBecomingFirstResponder:(NSView *)formControl;
559 - (void)formControlIsResigningFirstResponder:(NSView *)formControl;
560
561 - (NSView *)nextKeyViewOutsideWebFrameViews;
562 - (NSView *)nextValidKeyViewOutsideWebFrameViews;
563 - (NSView *)previousKeyViewOutsideWebFrameViews;
564
565 - (BOOL)defersLoading;
566 - (void)setDefersLoading:(BOOL)loading;
567 - (void)saveDocumentState:(NSArray *)documentState;
568 - (NSArray *)documentState;
569
570 - (void)setNeedsReapplyStyles;
571
572 - (void)tokenizerProcessedData;
573
574 - (NSString *)incomingReferrer;
575
576 - (NSView *)viewForPluginWithURL:(NSURL *)URL
577                   attributeNames:(NSArray *)attributeNames
578                  attributeValues:(NSArray *)attributeValues
579                         MIMEType:(NSString *)MIMEType;
580 - (NSView *)viewForJavaAppletWithFrame:(NSRect)frame
581                         attributeNames:(NSArray *)attributeNames
582                        attributeValues:(NSArray *)attributeValues
583                                baseURL:(NSURL *)baseURL;
584
585 - (BOOL)saveDocumentToPageCache:(id)documentInfo;
586
587 - (int)getObjectCacheSize;
588
589 - (ObjectElementType)determineObjectFromMIMEType:(NSString*)MIMEType URL:(NSURL*)URL;
590
591 - (void)loadEmptyDocumentSynchronously;
592
593 - (NSString *)MIMETypeForPath:(NSString *)path;
594
595 - (void)allowDHTMLDrag:(BOOL *)flagDHTML UADrag:(BOOL *)flagUA;
596 - (BOOL)startDraggingImage:(NSImage *)dragImage at:(NSPoint)dragLoc operation:(NSDragOperation)op event:(NSEvent *)event sourceIsDHTML:(BOOL)flag DHTMLWroteData:(BOOL)dhtmlWroteData;
597 - (void)handleAutoscrollForMouseDragged:(NSEvent *)event;
598 - (BOOL)mayStartDragAtEventLocation:(NSPoint)location;
599
600 - (BOOL)selectWordBeforeMenuEvent;
601
602 - (int)historyLength;
603 - (void)goBackOrForward:(int)distance;
604 - (BOOL)canGoBackOrForward:(int)distance;
605
606 - (void)textFieldDidBeginEditing:(DOMHTMLInputElement *)element;
607 - (void)textFieldDidEndEditing:(DOMHTMLInputElement *)element;
608 - (void)textDidChangeInTextField:(DOMHTMLInputElement *)element;
609 - (void)textDidChangeInTextArea:(DOMHTMLTextAreaElement *)element;
610
611 - (BOOL)textField:(DOMHTMLInputElement *)element doCommandBySelector:(SEL)commandSelector;
612 - (BOOL)textField:(DOMHTMLInputElement *)element shouldHandleEvent:(NSEvent *)event;
613
614 - (void)setHasBorder:(BOOL)hasBorder;
615
616 - (WebCoreKeyboardUIMode)keyboardUIMode;
617
618 - (NSFileWrapper *)fileWrapperForURL:(NSURL *)URL;
619
620 - (void)print;
621
622 - (jobject)getAppletInView:(NSView *)view;
623
624 // Deprecated, use getAppletInView: instead.
625 - (jobject)pollForAppletInView:(NSView *)view;
626
627 - (NSUndoManager *)undoManager;
628 - (NSString *)nameForUndoAction:(WebUndoAction)undoAction;
629 - (void)issueCutCommand;
630 - (void)issueCopyCommand;
631 - (void)issuePasteCommand;
632 - (void)issuePasteAndMatchStyleCommand;
633 - (void)issueTransposeCommand;
634 - (void)respondToChangedSelection;
635 - (void)respondToChangedContents;
636 - (void)setIsSelected:(BOOL)isSelected forView:(NSView *)view;
637 - (BOOL)isEditable;
638 - (BOOL)shouldChangeSelectedDOMRange:(DOMRange *)currentRange toDOMRange:(DOMRange *)proposedRange affinity:(NSSelectionAffinity)selectionAffinity stillSelecting:(BOOL)flag;
639 - (BOOL)shouldBeginEditing:(DOMRange *)range;
640 - (BOOL)shouldEndEditing:(DOMRange *)range;
641 - (void)didBeginEditing;
642 - (void)didEndEditing;
643 - (BOOL)canPaste;
644
645 - (NSString *)overrideMediaType;
646
647 - (void)windowObjectCleared;
648
649 - (int)spellCheckerDocumentTag;
650 - (BOOL)isContinuousSpellCheckingEnabled;
651
652 - (void)didFirstLayout;
653
654 - (void)dashboardRegionsChanged:(NSMutableDictionary *)regions;
655
656 - (BOOL)isCharacterSmartReplaceExempt:(unichar)c isPreviousCharacter:(BOOL)isPreviousCharacter;
657
658 - (void)handledOnloadEvents;
659
660 @end
661
662 // This interface definition allows those who hold a WebCoreFrameBridge * to call all the methods
663 // in the WebCoreFrameBridge protocol without requiring the base implementation to supply the methods.
664 // This idiom is appropriate because WebCoreFrameBridge is an abstract class.
665
666 @interface WebCoreFrameBridge (SubclassResponsibility) <WebCoreFrameBridge>
667 @end
668
669 // One method for internal use within WebCore itself.
670 // Could move this to another header, but would be a pity to create an entire header just for that.
671
672 @interface WebCoreFrameBridge (WebCoreInternalUse)
673 - (WebCoreMacFrame*)impl;
674 @end
675
676 // Protocols that make up part of the interaces above.
677
678 @protocol WebCoreRenderTreeCopier <NSObject>
679 - (NSObject *)nodeWithName:(NSString *)name position:(NSPoint)p rect:(NSRect)rect view:(NSView *)view children:(NSArray *)children;
680 @end
681