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