#import <Foundation/Foundation.h>
#ifdef __cplusplus
class KWQKHTMLPart;
class KHTMLView;
class RenderArena;
namespace khtml {
class RenderPart;
class RenderObject;
}
typedef khtml::RenderPart KHTMLRenderPart;
#else
@class KWQKHTMLPart;
@class KHTMLView;
@class KHTMLRenderPart;
@class RenderArena;
#endif
@class WebError;
@class WebFrame;
@class WebCoreSettings;
@protocol WebCoreDOMTreeCopier;
@protocol WebCoreRenderTreeCopier;
@protocol WebCoreResourceHandle;
@protocol WebCoreResourceLoader;
@protocol WebCoreFileButton;
@protocol WebDOMDocument;
@protocol WebDOMNode;
@protocol WebDOMElement;
extern NSString *WebCoreElementFrameKey;
extern NSString *WebCoreElementImageAltStringKey;
extern NSString *WebCoreElementImageKey;
extern NSString *WebCoreElementImageRectKey;
extern NSString *WebCoreElementImageURLKey;
extern NSString *WebCoreElementIsSelectedKey;
extern NSString *WebCoreElementLinkURLKey;
extern NSString *WebCoreElementLinkTargetFrameKey;
extern NSString *WebCoreElementLinkLabelKey;
extern NSString *WebCoreElementLinkTitleKey;
typedef enum {
WebCoreDeviceScreen,
WebCoreDevicePrinter
} WebCoreDeviceType;
enum FrameBorderStyle {
NoFrameBorder = 1,
SunkenFrameBorder = 2,
PlainFrameBorder = 4
};
@interface WebCoreBridge : NSObject
{
KWQKHTMLPart *_part;
KHTMLRenderPart *_renderPart;
RenderArena *_renderPartArena;
BOOL _drawSelectionOnly;
BOOL _shouldCreateRenderers;
}
- (void)initializeSettings:(WebCoreSettings *)settings;
- (void)setRenderPart:(KHTMLRenderPart *)renderPart;
- (KHTMLRenderPart *)renderPart;
- (void)setName:(NSString *)name;
- (NSString *)name;
- (KWQKHTMLPart *)part;
- (void)setParent:(WebCoreBridge *)parent;
- (void)openURL:(NSString *)URL reload:(BOOL)reload
contentType:(NSString *)contentType refresh:(NSString *)refresh lastModified:(NSDate *)lastModified
pageCache:(NSDictionary *)pageCache;
- (void)setEncoding:(NSString *)encoding userChosen:(BOOL)userChosen;
- (void)addData:(NSData *)data;
- (void)closeURL;
- (void)didNotOpenURL:(NSString *)URL;
- (void)saveDocumentState;
- (void)restoreDocumentState;
- (BOOL)canCachePage;
- (BOOL)saveDocumentToPageCache;
- (void)end;
- (NSString *)URL;
- (NSString *)referrer;
- (void)installInFrame:(NSView *)view;
- (void)removeFromFrame;
- (void)scrollToAnchor:(NSString *)anchor;
- (void)scrollToAnchorWithURL:(NSString *)URL;
- (void)createKHTMLViewWithNSView:(NSView *)view marginWidth:(int)mw marginHeight:(int)mh;
- (BOOL)isFrameSet;
- (void)reapplyStylesForDeviceType:(WebCoreDeviceType)deviceType;
- (void)forceLayout;
- (void)forceLayoutForPageWidth:(float)pageWidth;
- (void)sendResizeEvent;
- (BOOL)needsLayout;
- (void)adjustFrames:(NSRect)rect;
- (void)drawRect:(NSRect)rect;
- (void)adjustPageHeightNew:(float *)newBottom top:(float)oldTop bottom:(float)oldBottom limit:(float)bottomLimit;
- (void)setUsesInactiveTextBackgroundColor:(BOOL)uses;
- (BOOL)usesInactiveTextBackgroundColor;
- (void)mouseDown:(NSEvent *)event;
- (void)mouseUp:(NSEvent *)event;
- (void)mouseMoved:(NSEvent *)event;
- (void)mouseDragged:(NSEvent *)event;
- (NSView *)nextKeyView;
- (NSView *)previousKeyView;
- (NSView *)nextKeyViewInsideWebFrameViews;
- (NSView *)previousKeyViewInsideWebFrameViews;
- (NSObject *)copyDOMTree:(id <WebCoreDOMTreeCopier>)copier;
- (NSObject *)copyRenderTree:(id <WebCoreRenderTreeCopier>)copier;
- (NSString *)renderTreeAsExternalRepresentation;
- (NSDictionary *)elementAtPoint:(NSPoint)point;
- (id <WebDOMElement>)elementWithName:(NSString *)name inForm:(id <WebDOMElement>)form;
- (id <WebDOMElement>)elementForView:(NSView *)view;
- (BOOL)elementDoesAutoComplete:(id <WebDOMElement>)element;
- (BOOL)elementIsPassword:(id <WebDOMElement>)element;
- (id <WebDOMElement>)formForElement:(id <WebDOMElement>)element;
- (id <WebDOMElement>)currentForm;
- (NSArray *)controlsInForm:(id <WebDOMElement>)form;
- (NSString *)searchForLabels:(NSArray *)labels beforeElement:(id <WebDOMElement>)element;
- (NSString *)matchLabels:(NSArray *)labels againstElement:(id <WebDOMElement>)element;
- (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag;
- (void)jumpToSelection;
- (void)setTextSizeMultiplier:(float)multiplier;
- (CFStringEncoding)textEncoding;
- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)string;
- (id <WebDOMDocument>)DOMDocument;
- (void)setSelectionFrom:(id <WebDOMNode>)start startOffset:(int)startOffset to:(id <WebDOMNode>)end endOffset:(int) endOffset;
- (NSString *)selectedString;
- (NSAttributedString *)selectedAttributedString;
- (void)selectAll;
- (void)deselectAll;
- (NSRect)selectionRect;
- (NSImage *)selectionImage;
- (id <WebDOMNode>)selectionStart;
- (int)selectionStartOffset;
- (id <WebDOMNode>)selectionEnd;
- (int)selectionEndOffset;
- (NSAttributedString *)attributedStringFrom:(id <WebDOMNode>)startNode startOffset:(int)startOffset to:(id <WebDOMNode>)endNode endOffset:(int)endOffset;
- (int)frameBorderStyle;
+ (NSString *)stringWithData:(NSData *)data textEncoding:(CFStringEncoding)textEncoding;
+ (NSString *)stringWithData:(NSData *)data textEncodingName:(NSString *)textEncodingName;
- (BOOL)interceptKeyEvent:(NSEvent *)event toView:(NSView *)view;
- (void)setShouldCreateRenderers:(BOOL)f;
- (BOOL)shouldCreateRenderers;
- (int)numPendingOrLoadingRequests;
@end
@protocol WebCoreBridge
- (NSArray *)childFrames; - (WebCoreBridge *)mainFrame;
- (WebCoreBridge *)findFrameNamed:(NSString *)name;
- (NSString *)generateFrameName;
- (void)frameDetached;
- (void)loadURL:(NSString *)URL referrer:(NSString *)referrer reload:(BOOL)reload target:(NSString *)target triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values;
- (void)postWithURL:(NSString *)URL referrer:(NSString *)referrer target:(NSString *)target data:(NSData *)data contentType:(NSString *)contentType triggeringEvent:(NSEvent *)event form:(id <WebDOMElement>)form formValues:(NSDictionary *)values;
- (WebCoreBridge *)createWindowWithURL:(NSString *)URL frameName:(NSString *)name;
- (void)showWindow;
- (NSString *)userAgentForURL:(NSString *)URL;
- (void)setTitle:(NSString *)title;
- (void)setStatusText:(NSString *)status;
- (void)setIconURL:(NSString *)URL;
- (void)setIconURL:(NSString *)URL withType:(NSString *)string;
- (WebCoreBridge *)createChildFrameNamed:(NSString *)frameName withURL:(NSString *)URL
renderPart:(KHTMLRenderPart *)renderPart
allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height;
- (BOOL)areToolbarsVisible;
- (void)setToolbarsVisible:(BOOL)visible;
- (BOOL)isStatusBarVisible;
- (void)setStatusBarVisible:(BOOL)visible;
- (BOOL)areScrollbarsVisible;
- (void)setScrollbarsVisible:(BOOL)visible;
- (NSWindow *)window;
- (void)setWindowFrame:(NSRect)frame;
- (NSRect)windowFrame;
- (void)setWindowContentRect:(NSRect)frame;
- (NSRect)windowContentRect;
- (void)setWindowIsResizable:(BOOL)resizable;
- (BOOL)windowIsResizable;
- (NSResponder *)firstResponder;
- (void)makeFirstResponder:(NSResponder *)view;
- (void)closeWindowSoon;
- (void)runJavaScriptAlertPanelWithMessage:(NSString *)message;
- (BOOL)runJavaScriptConfirmPanelWithMessage:(NSString *)message;
- (BOOL)runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText returningText:(NSString **)result;
- (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)loader withURL:(NSString *)URL;
- (void)objectLoadedFromCacheWithURL:(NSString *)URL response:(id)response size:(unsigned)bytes;
- (BOOL)isReloading;
- (void)reportClientRedirectToURL:(NSString *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date lockHistory:(BOOL)lockHistory isJavaScriptFormAction:(BOOL)isJavaScriptFormAction;
- (void)reportClientRedirectCancelled;
- (void)focusWindow;
- (void)unfocusWindow;
- (NSView *)nextKeyViewOutsideWebFrameViews;
- (NSView *)previousKeyViewOutsideWebFrameViews;
- (BOOL)defersLoading;
- (void)setDefersLoading:(BOOL)loading;
- (void)saveDocumentState:(NSArray *)documentState;
- (NSArray *)documentState;
- (void)setNeedsReapplyStyles;
- (void)setNeedsLayout;
- (NSString *)requestedURL;
- (NSString *)incomingReferrer;
- (NSView *)viewForPluginWithURLString:(NSString *)URLString
attributes:(NSArray *)attributesArray
baseURLString:(NSString *)baseURLString
MIMEType:(NSString *)MIMEType;
- (NSView *)viewForJavaAppletWithFrame:(NSRect)frame
attributes:(NSDictionary *)attributes
baseURLString:(NSString *)baseURLString;
- (BOOL)saveDocumentToPageCache:(id)documentInfo;
- (int)getObjectCacheSize;
- (BOOL)frameRequiredForMIMEType:(NSString*)mimeType;
- (void)loadEmptyDocumentSynchronously;
- (NSString *)MIMETypeForPath:(NSString *)path;
- (void)handleMouseDragged:(NSEvent *)event;
- (void)handleAutoscrollForMouseDragged:(NSEvent *)event;
- (BOOL)mayStartDragWithMouseDragged:(NSEvent *)event;
- (int)historyLength;
- (void)goBackOrForward:(int)distance;
- (void)controlTextDidBeginEditing:(NSNotification *)obj;
- (void)controlTextDidEndEditing:(NSNotification *)obj;
- (void)controlTextDidChange:(NSNotification *)obj;
- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor;
- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor;
- (BOOL)control:(NSControl *)control didFailToFormatString:(NSString *)string errorDescription:(NSString *)error;
- (void)control:(NSControl *)control didFailToValidatePartialString:(NSString *)string errorDescription:(NSString *)error;
- (BOOL)control:(NSControl *)control isValidObject:(id)obj;
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector;
- (NSView <WebCoreFileButton> *)fileButton;
@end
@interface WebCoreBridge (SubclassResponsibility) <WebCoreBridge>
@end
@protocol WebCoreDOMTreeCopier <NSObject>
- (NSObject *)nodeWithName:(NSString *)name value:(NSString *)value source:(NSString *)source children:(NSArray *)children;
@end
@protocol WebCoreRenderTreeCopier <NSObject>
- (NSObject *)nodeWithName:(NSString *)name position:(NSPoint)p rect:(NSRect)rect view:(NSView *)view children:(NSArray *)children;
@end
@protocol WebCoreFileButton <NSObject>
- (void)setFilename:(NSString *)filename;
- (NSString *)filename;
- (float)baseline;
- (void)setVisualFrame:(NSRect)rect;
- (NSRect)visualFrame;
- (NSSize)bestVisualFrameSizeForCharacterCount:(int)count;
@end
extern NSString *WebCoreFileButtonFilenameChanged;
extern NSString *WebCoreFileButtonClicked;