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