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