WebCore:
[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 - (BOOL)canTargetLoadInFrame:(WebCoreFrameBridge *)targetFrame;
232
233 - (void)saveDocumentState;
234 - (void)restoreDocumentState;
235
236 - (BOOL)canCachePage;
237 - (BOOL)saveDocumentToPageCache;
238
239 - (void)end;
240 - (void)stop;
241
242 - (void)clearFrame;
243 - (void)handleFallbackContent;
244
245 - (NSURL *)URL;
246 - (NSURL *)baseURL;
247 - (NSString *)referrer;
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 - (BOOL)isCharacterSmartReplaceExempt:(unichar)c isPreviousCharacter:(BOOL)isPreviousCharacter;
481
482 - (BOOL)getData:(NSData **)data andResponse:(NSURLResponse **)response forURL:(NSURL *)URL;
483 - (void)getAllResourceDatas:(NSArray **)datas andResponses:(NSArray **)responses;
484
485 - (BOOL)canProvideDocumentSource;
486 - (BOOL)canSaveAsWebArchive;
487 @end
488
489 // The WebCoreFrameBridge protocol contains methods for use by the WebCore side of the bridge.
490
491 // In NSArray objects for post data, NSData objects represent literal data, and NSString objects represent encoded files.
492 // The encoding is the standard form encoding for uploading files.
493
494 @protocol WebCoreFrameBridge
495
496 - (void)frameDetached;
497 - (NSView *)documentView;
498
499 - (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;
500 - (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;
501
502 - (WebCorePageBridge *)createWindowWithURL:(NSURL *)URL;
503 - (void)showWindow;
504
505 - (BOOL)canRunModal;
506 - (BOOL)canRunModalNow;
507 - (WebCorePageBridge *)createModalDialogWithURL:(NSURL *)URL;
508 - (void)runModal;
509
510 - (NSString *)userAgentForURL:(NSURL *)URL;
511
512 - (void)setTitle:(NSString *)title;
513 - (void)setStatusText:(NSString *)status;
514
515 - (void)setIconURL:(NSURL *)URL;
516 - (void)setIconURL:(NSURL *)URL withType:(NSString *)string;
517
518 - (WebCoreFrameBridge *)createChildFrameNamed:(NSString *)frameName withURL:(NSURL *)URL
519     referrer:(NSString *)referrer
520     renderPart:(WebCoreRenderPart *)renderPart
521     allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height;
522
523 - (BOOL)areToolbarsVisible;
524 - (void)setToolbarsVisible:(BOOL)visible;
525 - (BOOL)isStatusbarVisible;
526 - (void)setStatusbarVisible:(BOOL)visible;
527 - (BOOL)areScrollbarsVisible;
528 - (void)setScrollbarsVisible:(BOOL)visible;
529 - (NSWindow *)window;
530
531 - (void)setWindowIsResizable:(BOOL)resizable;
532 - (BOOL)windowIsResizable;
533
534 - (NSResponder *)firstResponder;
535 - (void)makeFirstResponder:(NSResponder *)responder;
536 - (void)willMakeFirstResponderForNodeFocus;
537
538 - (BOOL)wasFirstResponderAtMouseDownTime:(NSResponder *)responder;
539
540 - (void)closeWindowSoon;
541
542 - (void)runJavaScriptAlertPanelWithMessage:(NSString *)message;
543 - (BOOL)runJavaScriptConfirmPanelWithMessage:(NSString *)message;
544 - (BOOL)runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText returningText:(NSString **)result;
545 - (BOOL)canRunBeforeUnloadConfirmPanel;
546 - (BOOL)runBeforeUnloadConfirmPanelWithMessage:(NSString *)message;
547 - (void)addMessageToConsole:(NSDictionary *)message;
548 - (void)runOpenPanelForFileButtonWithResultListener:(id <WebCoreOpenPanelResultListener>)resultListener;
549
550 - (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)loader withMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders;
551 - (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)loader withMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders postData:(NSArray *)data;
552 - (void)objectLoadedFromCacheWithURL:(NSURL *)URL response:(NSURLResponse *)response data:(NSData *)data;
553
554 - (NSData *)syncLoadResourceWithMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)requestHeaders postData:(NSArray *)postData finalURL:(NSURL **)finalNSURL responseHeaders:(NSDictionary **)responseHeaderDict statusCode:(int *)statusCode;
555
556 - (BOOL)isReloading;
557 - (time_t)expiresTimeForResponse:(NSURLResponse *)response;
558
559 - (void)reportClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date lockHistory:(BOOL)lockHistory isJavaScriptFormAction:(BOOL)isJavaScriptFormAction;
560 - (void)reportClientRedirectCancelled:(BOOL)cancelWithLoadInProgress;
561
562 - (void)focusWindow;
563 - (void)unfocusWindow;
564
565 - (void)formControlIsBecomingFirstResponder:(NSView *)formControl;
566 - (void)formControlIsResigningFirstResponder:(NSView *)formControl;
567
568 - (NSView *)nextKeyViewOutsideWebFrameViews;
569 - (NSView *)nextValidKeyViewOutsideWebFrameViews;
570 - (NSView *)previousKeyViewOutsideWebFrameViews;
571
572 - (BOOL)defersLoading;
573 - (void)setDefersLoading:(BOOL)loading;
574 - (void)saveDocumentState:(NSArray *)documentState;
575 - (NSArray *)documentState;
576
577 - (void)setNeedsReapplyStyles;
578
579 - (void)tokenizerProcessedData;
580
581 - (NSString *)incomingReferrer;
582
583 - (NSView *)viewForPluginWithURL:(NSURL *)URL
584                   attributeNames:(NSArray *)attributeNames
585                  attributeValues:(NSArray *)attributeValues
586                         MIMEType:(NSString *)MIMEType
587                       DOMElement:(DOMElement *)element;
588 - (NSView *)viewForJavaAppletWithFrame:(NSRect)frame
589                         attributeNames:(NSArray *)attributeNames
590                        attributeValues:(NSArray *)attributeValues
591                                baseURL:(NSURL *)baseURL
592                             DOMElement:(DOMElement *)element;
593
594 - (BOOL)saveDocumentToPageCache:(id)documentInfo;
595
596 - (int)getObjectCacheSize;
597
598 - (ObjectElementType)determineObjectFromMIMEType:(NSString*)MIMEType URL:(NSURL*)URL;
599
600 - (void)loadEmptyDocumentSynchronously;
601
602 - (NSString *)MIMETypeForPath:(NSString *)path;
603
604 - (void)allowDHTMLDrag:(BOOL *)flagDHTML UADrag:(BOOL *)flagUA;
605 - (BOOL)startDraggingImage:(NSImage *)dragImage at:(NSPoint)dragLoc operation:(NSDragOperation)op event:(NSEvent *)event sourceIsDHTML:(BOOL)flag DHTMLWroteData:(BOOL)dhtmlWroteData;
606 - (void)handleAutoscrollForMouseDragged:(NSEvent *)event;
607 - (BOOL)mayStartDragAtEventLocation:(NSPoint)location;
608
609 - (BOOL)selectWordBeforeMenuEvent;
610
611 - (int)historyLength;
612 - (void)goBackOrForward:(int)distance;
613 - (BOOL)canGoBackOrForward:(int)distance;
614
615 - (void)textFieldDidBeginEditing:(DOMHTMLInputElement *)element;
616 - (void)textFieldDidEndEditing:(DOMHTMLInputElement *)element;
617 - (void)textDidChangeInTextField:(DOMHTMLInputElement *)element;
618 - (void)textDidChangeInTextArea:(DOMHTMLTextAreaElement *)element;
619
620 - (BOOL)textField:(DOMHTMLInputElement *)element doCommandBySelector:(SEL)commandSelector;
621 - (BOOL)textField:(DOMHTMLInputElement *)element shouldHandleEvent:(NSEvent *)event;
622
623 - (void)setHasBorder:(BOOL)hasBorder;
624
625 - (NSFileWrapper *)fileWrapperForURL:(NSURL *)URL;
626
627 - (void)print;
628
629 - (jobject)getAppletInView:(NSView *)view;
630
631 // Deprecated, use getAppletInView: instead.
632 - (jobject)pollForAppletInView:(NSView *)view;
633
634 - (NSUndoManager *)undoManager;
635 - (NSString *)nameForUndoAction:(WebUndoAction)undoAction;
636 - (void)issueCutCommand;
637 - (void)issueCopyCommand;
638 - (void)issuePasteCommand;
639 - (void)issuePasteAndMatchStyleCommand;
640 - (void)issueTransposeCommand;
641 - (void)respondToChangedSelection;
642 - (void)respondToChangedContents;
643 - (void)setIsSelected:(BOOL)isSelected forView:(NSView *)view;
644 - (BOOL)isEditable;
645 - (BOOL)shouldChangeSelectedDOMRange:(DOMRange *)currentRange toDOMRange:(DOMRange *)proposedRange affinity:(NSSelectionAffinity)selectionAffinity stillSelecting:(BOOL)flag;
646 - (BOOL)shouldBeginEditing:(DOMRange *)range;
647 - (BOOL)shouldEndEditing:(DOMRange *)range;
648 - (void)didBeginEditing;
649 - (void)didEndEditing;
650 - (BOOL)canPaste;
651
652 - (NSString *)overrideMediaType;
653
654 - (void)windowObjectCleared;
655
656 - (int)spellCheckerDocumentTag;
657 - (BOOL)isContinuousSpellCheckingEnabled;
658
659 - (void)didFirstLayout;
660
661 - (void)dashboardRegionsChanged:(NSMutableDictionary *)regions;
662
663 - (void)handledOnloadEvents;
664
665 - (WebCoreKeyboardUIMode)keyboardUIMode;
666
667 @end
668
669 // This interface definition allows those who hold a WebCoreFrameBridge * to call all the methods
670 // in the WebCoreFrameBridge protocol without requiring the base implementation to supply the methods.
671 // This idiom is appropriate because WebCoreFrameBridge is an abstract class.
672
673 @interface WebCoreFrameBridge (SubclassResponsibility) <WebCoreFrameBridge>
674 @end
675
676 // One method for internal use within WebCore itself.
677 // Could move this to another header, but would be a pity to create an entire header just for that.
678
679 @interface WebCoreFrameBridge (WebCoreInternalUse)
680 - (WebCoreMacFrame*)impl;
681 @end
682
683 // Protocols that make up part of the interaces above.
684
685 @protocol WebCoreRenderTreeCopier <NSObject>
686 - (NSObject *)nodeWithName:(NSString *)name position:(NSPoint)p rect:(NSRect)rect view:(NSView *)view children:(NSArray *)children;
687 @end
688