15a776138b049b5c4d1a02b891077ae417170153
[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
120 // WebCoreBridge objects are used by WebCore to abstract away operations that need
121 // to be implemented by library clients, for example WebKit. The objects are also
122 // used in the opposite direction, for simple access to WebCore functions without dealing
123 // directly with the KHTML C++ classes.
124
125 // A WebCoreBridge creates and holds a reference to a KHTMLPart.
126
127 // The WebCoreBridge interface contains methods for use by the non-WebCore side of the bridge.
128
129 @interface WebCoreBridge : NSObject
130 {
131     KWQKHTMLPart *_part;
132     KHTMLRenderPart *_renderPart;
133     RenderArena *_renderPartArena;
134     BOOL _shouldCreateRenderers;
135 }
136
137 + (WebCoreBridge *)bridgeForDOMDocument:(DOMDocument *)document;
138
139 - (void)initializeSettings:(WebCoreSettings *)settings;
140
141 - (void)setRenderPart:(KHTMLRenderPart *)renderPart;
142 - (KHTMLRenderPart *)renderPart;
143
144 - (void)setName:(NSString *)name;
145 - (NSString *)name;
146
147 - (KWQKHTMLPart *)part;
148
149 - (void)setParent:(WebCoreBridge *)parent;
150
151 - (void)provisionalLoadStarted;
152
153 - (void)openURL:(NSURL *)URL reload:(BOOL)reload
154     contentType:(NSString *)contentType refresh:(NSString *)refresh lastModified:(NSDate *)lastModified
155     pageCache:(NSDictionary *)pageCache;
156 - (void)setEncoding:(NSString *)encoding userChosen:(BOOL)userChosen;
157 - (void)addData:(NSData *)data;
158 - (void)closeURL;
159
160 - (void)didNotOpenURL:(NSURL *)URL pageCache:(NSDictionary *)pageCache;
161
162 - (void)saveDocumentState;
163 - (void)restoreDocumentState;
164
165 - (BOOL)canCachePage;
166 - (BOOL)saveDocumentToPageCache;
167
168 - (void)end;
169
170 - (NSURL *)URL;
171 - (NSString *)referrer;
172 - (NSString *)domain;
173
174 - (void)installInFrame:(NSView *)view;
175 - (void)removeFromFrame;
176
177 - (void)scrollToAnchor:(NSString *)anchor;
178 - (void)scrollToAnchorWithURL:(NSURL *)URL;
179
180 - (void)createKHTMLViewWithNSView:(NSView *)view marginWidth:(int)mw marginHeight:(int)mh;
181
182 - (BOOL)isFrameSet;
183
184 - (void)reapplyStylesForDeviceType:(WebCoreDeviceType)deviceType;
185 - (void)forceLayoutAdjustingViewSize:(BOOL)adjustSizeFlag;
186 - (void)forceLayoutWithMinimumPageWidth:(float)minPageWidth maximumPageWidth:(float)maxPageWidth adjustingViewSize:(BOOL)adjustSizeFlag;
187 - (void)sendResizeEvent;
188 - (void)sendScrollEvent;
189 - (BOOL)needsLayout;
190 - (void)setNeedsLayout;
191 - (void)drawRect:(NSRect)rect;
192 - (void)adjustPageHeightNew:(float *)newBottom top:(float)oldTop bottom:(float)oldBottom limit:(float)bottomLimit;
193 - (NSArray*)computePageRectsWithPrintWidthScaleFactor:(float)printWidthScaleFactor printHeight:(float)printHeight;
194
195 - (void)setActivationEventNumber:(int)num;
196 - (void)mouseDown:(NSEvent *)event;
197 - (void)mouseUp:(NSEvent *)event;
198 - (void)mouseMoved:(NSEvent *)event;
199 - (void)mouseDragged:(NSEvent *)event;
200
201 - (BOOL)sendContextMenuEvent:(NSEvent *)event; // return YES if event is eaten by WebCore
202
203 - (NSView *)nextKeyView;
204 - (NSView *)previousKeyView;
205
206 - (NSView *)nextKeyViewInsideWebFrameViews;
207 - (NSView *)previousKeyViewInsideWebFrameViews;
208
209 - (NSObject *)copyDOMTree:(id <WebCoreDOMTreeCopier>)copier;
210 - (NSObject *)copyRenderTree:(id <WebCoreRenderTreeCopier>)copier;
211 - (NSString *)renderTreeAsExternalRepresentation;
212
213 - (NSDictionary *)elementAtPoint:(NSPoint)point;
214 - (NSURL *)URLWithAttributeString:(NSString *)string;
215
216 - (DOMElement *)elementWithName:(NSString *)name inForm:(DOMElement *)form;
217 - (DOMElement *)elementForView:(NSView *)view;
218 - (BOOL)elementDoesAutoComplete:(DOMElement *)element;
219 - (BOOL)elementIsPassword:(DOMElement *)element;
220 - (DOMElement *)formForElement:(DOMElement *)element;
221 - (DOMElement *)currentForm;
222 - (NSArray *)controlsInForm:(DOMElement *)form;
223 - (NSString *)searchForLabels:(NSArray *)labels beforeElement:(DOMElement *)element;
224 - (NSString *)matchLabels:(NSArray *)labels againstElement:(DOMElement *)element;
225
226 - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag;
227 - (void)jumpToSelection;
228 - (NSString *)advanceToNextMisspelling;
229 - (NSString *)advanceToNextMisspellingStartingJustBeforeSelection;
230
231 - (void)setTextSizeMultiplier:(float)multiplier;
232
233 - (CFStringEncoding)textEncoding;
234
235 - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)string;
236
237 - (DOMDocument *)DOMDocument;
238 - (DOMHTMLElement *)frameElement;
239
240 - (BOOL)isSelectionEditable;
241 - (WebSelectionState)selectionState;
242
243 - (NSAttributedString *)selectedAttributedString;
244 - (NSString *)selectedString;
245
246 - (void)setSelectionFromNone;
247 - (void)setDisplaysWithFocusAttributes:(BOOL)flag;
248
249 - (NSString *)stringForRange:(DOMRange *)range;
250
251 - (NSString *)markupStringFromNode:(DOMNode *)node nodes:(NSArray **)nodes;
252 - (NSString *)markupStringFromRange:(DOMRange *)range nodes:(NSArray **)nodes;
253
254 - (void)selectAll;
255 - (void)deselectAll;
256 - (void)deselectText;
257
258 - (NSRect)selectionRect;
259 - (NSRect)visibleSelectionRect;
260 - (NSImage *)selectionImage;
261 - (NSRect)caretRectAtNode:(DOMNode *)node offset:(int)offset;
262
263 - (void)setSelectedDOMRange:(DOMRange *)range affinity:(NSSelectionAffinity)selectionAffinity;
264 - (DOMRange *)selectedDOMRange;
265 - (NSSelectionAffinity)selectionAffinity;
266
267 // Emacs-style-editing "mark"
268 - (void)setMarkDOMRange:(DOMRange *)range;
269 - (DOMRange *)markDOMRange;
270
271 // spelling-checking "marked text"
272 - (void)setMarkedTextDOMRange:(DOMRange *)range;
273 - (DOMRange *)markedTextDOMRange;
274
275 - (NSAttributedString *)attributedStringFrom:(DOMNode *)startNode startOffset:(int)startOffset to:(DOMNode *)endNode endOffset:(int)endOffset;
276
277 - (NSFont *)fontForSelection:(BOOL *)hasMultipleFonts;
278
279 + (NSString *)stringWithData:(NSData *)data textEncoding:(CFStringEncoding)textEncoding;
280 + (NSString *)stringWithData:(NSData *)data textEncodingName:(NSString *)textEncodingName;
281
282 - (BOOL)interceptKeyEvent:(NSEvent *)event toView:(NSView *)view;
283
284 - (void)setShouldCreateRenderers:(BOOL)f;
285 - (BOOL)shouldCreateRenderers;
286
287 - (int)numPendingOrLoadingRequests;
288
289 - (void)setDrawsBackground:(BOOL)drawsBackround;
290
291 - (NSColor *)bodyBackgroundColor;
292 - (NSColor *)selectionColor;
293
294 - (void)adjustViewSize;
295
296 - (id)accessibilityTree;
297
298 - (void)undoEditing:(id)arg;
299 - (void)redoEditing:(id)arg;
300
301 - (DOMRange *)rangeByExpandingSelectionWithGranularity:(WebSelectionGranularity)granularity;
302 - (DOMRange *)rangeOfCharactersAroundCaret;
303 - (DOMRange *)rangeByAlteringCurrentSelection:(WebSelectionAlteration)alteration direction:(WebSelectionDirection)direction granularity:(WebSelectionGranularity)granularity;
304 - (void)alterCurrentSelection:(WebSelectionAlteration)alteration direction:(WebSelectionDirection)direction granularity:(WebSelectionGranularity)granularity;
305 - (DOMRange *)rangeByAlteringCurrentSelection:(WebSelectionAlteration)alteration verticalDistance:(float)distance;
306 - (void)alterCurrentSelection:(WebSelectionAlteration)alteration verticalDistance:(float)distance;
307 - (WebSelectionGranularity)selectionGranularity;
308
309 - (DOMDocumentFragment *)documentFragmentWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString;
310 - (DOMDocumentFragment *)documentFragmentWithText:(NSString *)text;
311
312 - (void)replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
313 - (void)replaceSelectionWithNode:(DOMNode *)node selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
314 - (void)replaceSelectionWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
315 - (void)replaceSelectionWithText:(NSString *)text selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace;
316
317 - (void)insertText:(NSString *)text selectInsertedText:(BOOL)selectInsertedText;
318 - (void)insertNewline;
319
320 - (void)setSelectionToDragCaret;
321 - (void)moveSelectionToDragCaret:(DOMDocumentFragment *)selectionFragment smartMove:(BOOL)smartMove;
322 - (void)moveDragCaretToPoint:(NSPoint)point;
323 - (void)removeDragCaret;
324 - (DOMRange *)dragCaretDOMRange;
325 - (DOMRange *)editableDOMRangeForPoint:(NSPoint)point;
326
327 - (void)deleteSelectionWithSmartDelete:(BOOL)smartDelete;
328 - (void)deleteKeyPressed;
329
330 - (void)applyStyle:(DOMCSSStyleDeclaration *)style;
331 - (BOOL)selectionStartHasStyle:(DOMCSSStyleDeclaration *)style;
332
333 - (void)ensureCaretVisible;
334
335 - (WebScriptObject *)windowScriptObject;
336 - (NPObject *)windowScriptNPObject;
337
338 - (BOOL)eventMayStartDrag:(NSEvent *)event;
339 - (NSDragOperation)dragOperationForDraggingInfo:(id <NSDraggingInfo>)info;
340 - (void)dragExitedWithDraggingInfo:(id <NSDraggingInfo>)info;
341 - (BOOL)concludeDragForDraggingInfo:(id <NSDraggingInfo>)info;
342 - (void)dragSourceMovedTo:(NSPoint)windowLoc;
343 - (void)dragSourceEndedAt:(NSPoint)windowLoc operation:(NSDragOperation)operation;
344
345 - (BOOL)mayDHTMLCut;
346 - (BOOL)mayDHTMLCopy;
347 - (BOOL)mayDHTMLPaste;
348 - (BOOL)tryDHTMLCut;
349 - (BOOL)tryDHTMLCopy;
350 - (BOOL)tryDHTMLPaste;
351
352 - (NSMutableDictionary *)dashboardRegions;
353
354 @end
355
356 // The WebCoreBridge protocol contains methods for use by the WebCore side of the bridge.
357
358 // In NSArray objects for post data, NSData objects represent literal data, and NSString objects represent encoded files.
359 // The encoding is the standard form encoding for uploading files.
360
361 @protocol WebCoreBridge
362
363 - (NSArray *)childFrames; // WebCoreBridge objects
364 - (WebCoreBridge *)mainFrame;
365 - (WebCoreBridge *)findFrameNamed:(NSString *)name;
366 /* Creates a name for an frame unnamed in the HTML.  It should produce repeatable results for loads of the same frameset. */
367 - (NSString *)generateFrameName;
368 - (void)frameDetached;
369 - (NSView *)documentView;
370
371 - (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;
372 - (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;
373
374 - (WebCoreBridge *)createWindowWithURL:(NSURL *)URL frameName:(NSString *)name;
375 - (void)showWindow;
376
377 - (NSString *)userAgentForURL:(NSURL *)URL;
378
379 - (void)setTitle:(NSString *)title;
380 - (void)setStatusText:(NSString *)status;
381
382 - (void)setIconURL:(NSURL *)URL;
383 - (void)setIconURL:(NSURL *)URL withType:(NSString *)string;
384
385 - (WebCoreBridge *)createChildFrameNamed:(NSString *)frameName withURL:(NSURL *)URL
386     renderPart:(KHTMLRenderPart *)renderPart
387     allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height;
388
389 - (BOOL)areToolbarsVisible;
390 - (void)setToolbarsVisible:(BOOL)visible;
391 - (BOOL)isStatusBarVisible;
392 - (void)setStatusBarVisible:(BOOL)visible;
393 - (BOOL)areScrollbarsVisible;
394 - (void)setScrollbarsVisible:(BOOL)visible;
395 - (NSWindow *)window;
396 - (void)setWindowFrame:(NSRect)frame;
397 - (NSRect)windowFrame;
398 - (void)setWindowContentRect:(NSRect)frame;
399 - (NSRect)windowContentRect;
400
401 - (void)setWindowIsResizable:(BOOL)resizable;
402 - (BOOL)windowIsResizable;
403
404 - (NSResponder *)firstResponder;
405 - (void)makeFirstResponder:(NSResponder *)view;
406
407 - (void)closeWindowSoon;
408
409 - (void)runJavaScriptAlertPanelWithMessage:(NSString *)message;
410 - (BOOL)runJavaScriptConfirmPanelWithMessage:(NSString *)message;
411 - (BOOL)runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText returningText:(NSString **)result;
412 - (void)addMessageToConsole:(NSDictionary *)message;
413
414 - (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)loader withURL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders;
415 - (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)loader withURL:(NSURL *)URL customHeaders:(NSDictionary *)customHeaders postData:(NSArray *)data;
416 - (void)objectLoadedFromCacheWithURL:(NSURL *)URL response:(id)response size:(unsigned)bytes;
417
418 - (NSData *)syncLoadResourceWithURL:(NSURL *)URL customHeaders:(NSDictionary *)requestHeaders postData:(NSArray *)postData finalURL:(NSURL **)finalNSURL responseHeaders:(NSDictionary **)responseHeaderDict statusCode:(int *)statusCode;
419
420 - (BOOL)isReloading;
421 - (time_t)expiresTimeForResponse:(NSURLResponse *)response;
422
423 - (void)reportClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date lockHistory:(BOOL)lockHistory isJavaScriptFormAction:(BOOL)isJavaScriptFormAction;
424 - (void)reportClientRedirectCancelled:(BOOL)cancelWithLoadInProgress;
425
426 - (void)focusWindow;
427 - (void)unfocusWindow;
428
429 - (NSView *)nextKeyViewOutsideWebFrameViews;
430 - (NSView *)previousKeyViewOutsideWebFrameViews;
431
432 - (BOOL)defersLoading;
433 - (void)setDefersLoading:(BOOL)loading;
434 - (void)saveDocumentState:(NSArray *)documentState;
435 - (NSArray *)documentState;
436
437 - (void)setNeedsReapplyStyles;
438
439 // OK to be an NSString rather than an NSURL.
440 // This URL is only used for coloring visited links.
441 - (NSString *)requestedURLString;
442 - (NSString *)incomingReferrer;
443
444 - (NSView *)viewForPluginWithURL:(NSURL *)URL
445                   attributeNames:(NSArray *)attributeNames
446                  attributeValues:(NSArray *)attributeValues
447                         MIMEType:(NSString *)MIMEType;
448 - (NSView *)viewForJavaAppletWithFrame:(NSRect)frame
449                         attributeNames:(NSArray *)attributeNames
450                        attributeValues:(NSArray *)attributeValues
451                                baseURL:(NSURL *)baseURL;
452
453 - (BOOL)saveDocumentToPageCache:(id)documentInfo;
454
455 - (int)getObjectCacheSize;
456
457 - (BOOL)frameRequiredForMIMEType:(NSString*)MIMEType URL:(NSURL *)URL;
458
459 - (void)loadEmptyDocumentSynchronously;
460
461 - (NSString *)MIMETypeForPath:(NSString *)path;
462
463 - (void)allowDHTMLDrag:(BOOL *)flagDHTML UADrag:(BOOL *)flagUA;
464 - (BOOL)startDraggingImage:(NSImage *)dragImage at:(NSPoint)dragLoc operation:(NSDragOperation)op event:(NSEvent *)event sourceIsDHTML:(BOOL)flag DHTMLWroteData:(BOOL)dhtmlWroteData;
465 - (void)handleAutoscrollForMouseDragged:(NSEvent *)event;
466 - (BOOL)mayStartDragAtEventLocation:(NSPoint)location;
467
468 - (int)historyLength;
469 - (void)goBackOrForward:(int)distance;
470 - (BOOL)canGoBackOrForward:(int)distance;
471
472 - (void)controlTextDidBeginEditing:(NSNotification *)obj;
473 - (void)controlTextDidEndEditing:(NSNotification *)obj;
474 - (void)controlTextDidChange:(NSNotification *)obj;
475
476 - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor;
477 - (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor;
478 - (BOOL)control:(NSControl *)control didFailToFormatString:(NSString *)string errorDescription:(NSString *)error;
479 - (void)control:(NSControl *)control didFailToValidatePartialString:(NSString *)string errorDescription:(NSString *)error;
480 - (BOOL)control:(NSControl *)control isValidObject:(id)obj;
481 - (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector;
482
483 - (NSView <WebCoreFileButton> *)fileButtonWithDelegate:(id <WebCoreFileButtonDelegate>)delegate;
484
485 - (void)setHasBorder:(BOOL)hasBorder;
486
487 - (WebCoreKeyboardUIMode)keyboardUIMode;
488
489 - (void)didSetName:(NSString *)name;
490
491 - (NSFileWrapper *)fileWrapperForURL:(NSURL *)URL;
492
493 - (void)print;
494
495 - (jobject)getAppletInView:(NSView *)view;
496
497 // Deprecated, use getAppletInView: instead.
498 - (jobject)pollForAppletInView:(NSView *)view;
499
500 - (NSUndoManager *)undoManager;
501 - (void)issueCutCommand;
502 - (void)issueCopyCommand;
503 - (void)issuePasteCommand;
504 - (void)respondToChangedSelection;
505 - (void)respondToChangedContents;
506 - (void)setIsSelected:(BOOL)isSelected forView:(NSView *)view;
507 - (BOOL)isEditable;
508 - (BOOL)shouldBeginEditing:(DOMRange *)range;
509 - (BOOL)shouldEndEditing:(DOMRange *)range;
510
511 - (NSString *)overrideMediaType;
512
513 - (void)windowObjectCleared;
514
515 - (int)spellCheckerDocumentTag;
516 - (BOOL)isContinuousSpellCheckingEnabled;
517
518 - (void)didFirstLayout;
519
520 - (void)dashboardRegionsChanged:(NSMutableDictionary *)regions;
521
522 @end
523
524 // This interface definition allows those who hold a WebCoreBridge * to call all the methods
525 // in the WebCoreBridge protocol without requiring the base implementation to supply the methods.
526 // This idiom is appropriate because WebCoreBridge is an abstract class.
527
528 @interface WebCoreBridge (SubclassResponsibility) <WebCoreBridge>
529 @end
530
531 @protocol WebCoreDOMTreeCopier <NSObject>
532 - (NSObject *)nodeWithName:(NSString *)name value:(NSString *)value source:(NSString *)source children:(NSArray *)children;
533 @end
534
535 @protocol WebCoreRenderTreeCopier <NSObject>
536 - (NSObject *)nodeWithName:(NSString *)name position:(NSPoint)p rect:(NSRect)rect view:(NSView *)view children:(NSArray *)children;
537 @end
538
539 @protocol WebCoreFileButton <NSObject>
540 - (void)setFilename:(NSString *)filename;
541 - (void)performClick;
542 - (NSString *)filename;
543 - (float)baseline;
544 - (void)setVisualFrame:(NSRect)rect;
545 - (NSRect)visualFrame;
546 - (NSSize)bestVisualFrameSizeForCharacterCount:(int)count;
547 @end
548
549 @protocol WebCoreFileButtonDelegate <NSObject>
550 - (void)filenameChanged:(NSString *)filename;
551 - (void)focusChanged:(BOOL)nowHasFocus;
552 - (void)clicked;
553 @end