#import <WebKit/WebView.h>
#import <WebKit/WebFramePrivate.h>
#import <JavaScriptCore/JSBase.h>
#if !defined(ENABLE_DASHBOARD_SUPPORT)
#define ENABLE_DASHBOARD_SUPPORT 1
#endif
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
#define WebNSInteger int
#define WebNSUInteger unsigned int
#else
#define WebNSInteger NSInteger
#define WebNSUInteger NSUInteger
#endif
@class NSError;
@class WebFrame;
@class WebDeviceOrientation;
@class WebGeolocationPosition;
@class WebInspector;
@class WebPreferences;
@class WebScriptWorld;
@class WebTextIterator;
@protocol WebDeviceOrientationProvider;
@protocol WebFormDelegate;
extern NSString *_WebCanGoBackKey;
extern NSString *_WebCanGoForwardKey;
extern NSString *_WebEstimatedProgressKey;
extern NSString *_WebIsLoadingKey;
extern NSString *_WebMainFrameIconKey;
extern NSString *_WebMainFrameTitleKey;
extern NSString *_WebMainFrameURLKey;
extern NSString *_WebMainFrameDocumentKey;
extern NSString *WebElementTitleKey; extern NSString *WebElementSpellingToolTipKey; extern NSString *WebElementIsContentEditableKey; extern NSString *WebElementMediaURLKey;
extern NSString *WebElementLinkIsLiveKey; extern NSString *WebElementIsInScrollBarKey;
extern NSString *_WebViewDidStartAcceleratedCompositingNotification;
#if ENABLE_DASHBOARD_SUPPORT
typedef enum {
WebDashboardBehaviorAlwaysSendMouseEventsToAllWindows,
WebDashboardBehaviorAlwaysSendActiveNullEventsToPlugIns,
WebDashboardBehaviorAlwaysAcceptsFirstMouse,
WebDashboardBehaviorAllowWheelScrolling,
WebDashboardBehaviorUseBackwardCompatibilityMode
} WebDashboardBehavior;
#endif
typedef enum {
WebInjectAtDocumentStart,
WebInjectAtDocumentEnd,
} WebUserScriptInjectionTime;
typedef enum {
WebInjectInAllFrames,
WebInjectInTopFrameOnly
} WebUserContentInjectedFrames;
enum {
WebFindOptionsCaseInsensitive = 1 << 0,
WebFindOptionsAtWordStarts = 1 << 1,
WebFindOptionsTreatMedialCapitalAsWordStart = 1 << 2,
WebFindOptionsBackwards = 1 << 3,
WebFindOptionsWrapAround = 1 << 4,
WebFindOptionsStartInSelection = 1 << 5
};
typedef NSUInteger WebFindOptions;
@interface WebController : NSTreeController {
IBOutlet WebView *webView;
}
- (WebView *)webView;
- (void)setWebView:(WebView *)newWebView;
@end
@interface WebView (WebViewEditingActionsPendingPublic)
- (void)outdent:(id)sender;
@end
@interface WebView (WebPendingPublic)
- (void)scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode;
- (void)unscheduleFromRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode;
- (BOOL)findString:(NSString *)string options:(WebFindOptions)options;
- (void)setMainFrameDocumentReady:(BOOL)mainFrameDocumentReady;
- (void)setTabKeyCyclesThroughElements:(BOOL)cyclesElements;
- (BOOL)tabKeyCyclesThroughElements;
- (void)scrollDOMRangeToVisible:(DOMRange *)range;
- (void)setHoverFeedbackSuspended:(BOOL)newValue;
- (BOOL)isHoverFeedbackSuspended;
- (void)setScriptDebugDelegate:(id)delegate;
- (id)scriptDebugDelegate;
- (void)setHistoryDelegate:(id)delegate;
- (id)historyDelegate;
- (BOOL)shouldClose;
- (NSAppleEventDescriptor *)aeDescByEvaluatingJavaScriptFromString:(NSString *)script;
- (BOOL)canMarkAllTextMatches;
- (WebNSUInteger)countMatchesForText:(NSString *)string options:(WebFindOptions)options highlight:(BOOL)highlight limit:(WebNSUInteger)limit markMatches:(BOOL)markMatches;
- (WebNSUInteger)countMatchesForText:(NSString *)string inDOMRange:(DOMRange *)range options:(WebFindOptions)options highlight:(BOOL)highlight limit:(WebNSUInteger)limit markMatches:(BOOL)markMatches;
- (void)unmarkAllTextMatches;
- (NSArray *)rectsForTextMatches;
- (BOOL)allowsUndo;
- (void)setAllowsUndo:(BOOL)flag;
- (void)setPageSizeMultiplier:(float)multiplier;
- (float)pageSizeMultiplier;
- (BOOL)canZoomPageIn;
- (IBAction)zoomPageIn:(id)sender;
- (BOOL)canZoomPageOut;
- (IBAction)zoomPageOut:(id)sender;
- (BOOL)canResetPageZoom;
- (IBAction)resetPageZoom:(id)sender;
- (void)setMediaVolume:(float)volume;
- (float)mediaVolume;
- (void)addVisitedLinks:(NSArray *)visitedLinks;
@end
@interface WebView (WebPrivate)
- (WebInspector *)inspector;
- (void)setBackgroundColor:(NSColor *)backgroundColor;
- (NSColor *)backgroundColor;
- (void)_loadBackForwardListFromOtherView:(WebView *)otherView;
+ (void)_reportException:(JSValueRef)exception inContext:(JSContextRef)context;
- (void)_dispatchPendingLoadRequests;
+ (NSArray *)_supportedFileExtensions;
+ (BOOL)canShowFile:(NSString *)path;
+ (NSString *)suggestedFileExtensionForMIMEType: (NSString *)MIMEType;
+ (NSString *)_standardUserAgentWithApplicationName:(NSString *)applicationName;
+ (BOOL)canCloseAllWebViews;
- (void)_setFormDelegate:(id<WebFormDelegate>)delegate;
- (id<WebFormDelegate>)_formDelegate;
- (BOOL)_isClosed;
- (void)_close;
- (BOOL)_isProcessingUserGesture;
- (void)_updateActiveState;
+ (void)_registerViewClass:(Class)viewClass representationClass:(Class)representationClass forURLScheme:(NSString *)URLScheme;
+ (void)_unregisterViewClassAndRepresentationClassForMIMEType:(NSString *)MIMEType;
+ (BOOL)_canHandleRequest:(NSURLRequest *)request;
+ (NSString *)_decodeData:(NSData *)data;
+ (void)_setAlwaysUsesComplexTextCodePath:(BOOL)f;
+ (void)_setAlwaysUseATSU:(BOOL)f;
- (NSCachedURLResponse *)_cachedResponseForURL:(NSURL *)URL;
#if ENABLE_DASHBOARD_SUPPORT
- (void)_addScrollerDashboardRegions:(NSMutableDictionary *)regions;
- (NSDictionary *)_dashboardRegions;
- (void)_setDashboardBehavior:(WebDashboardBehavior)behavior to:(BOOL)flag;
- (BOOL)_dashboardBehavior:(WebDashboardBehavior)behavior;
#endif
+ (void)_setShouldUseFontSmoothing:(BOOL)f;
+ (BOOL)_shouldUseFontSmoothing;
- (void)_setCatchesDelegateExceptions:(BOOL)f;
- (BOOL)_catchesDelegateExceptions;
+ (void)_setUsesTestModeFocusRingColor:(BOOL)f;
+ (BOOL)_usesTestModeFocusRingColor;
- (void)setAlwaysShowVerticalScroller:(BOOL)flag;
- (BOOL)alwaysShowVerticalScroller;
- (void)setAlwaysShowHorizontalScroller:(BOOL)flag;
- (BOOL)alwaysShowHorizontalScroller;
- (void)setProhibitsMainFrameScrolling:(BOOL)prohibits;
- (void)_setAdditionalWebPlugInPaths:(NSArray *)newPaths;
- (void)_setInViewSourceMode:(BOOL)flag;
- (BOOL)_inViewSourceMode;
- (void)_attachScriptDebuggerToAllFrames;
- (void)_detachScriptDebuggerFromAllFrames;
- (BOOL)defersCallbacks; - (void)setDefersCallbacks:(BOOL)defer;
- (BOOL)usesPageCache;
- (void)setUsesPageCache:(BOOL)usesPageCache;
- (WebHistoryItem *)_globalHistoryItem;
- (WebTextIterator *)textIteratorForRect:(NSRect)rect;
#if ENABLE_DASHBOARD_SUPPORT
- (void)handleAuthenticationForResource:(id)identifier challenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource;
#endif
- (void)_clearUndoRedoOperations;
- (BOOL)_inFastImageScalingMode;
- (void)_setUseFastImageScalingMode:(BOOL)flag;
- (BOOL)_cookieEnabled;
- (void)_setCookieEnabled:(BOOL)enable;
- (void)_executeCoreCommandByName:(NSString *)name value:(NSString *)value;
- (void)_clearMainFrameName;
- (void)_setCustomHTMLTokenizerTimeDelay:(double)timeDelay;
- (void)_setCustomHTMLTokenizerChunkSize:(int)chunkSize;
- (id)_initWithFrame:(NSRect)f frameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews;
- (BOOL)_usesDocumentViews;
- (void)setSelectTrailingWhitespaceEnabled:(BOOL)flag;
- (BOOL)isSelectTrailingWhitespaceEnabled;
- (void)setMemoryCacheDelegateCallsEnabled:(BOOL)suspend;
- (BOOL)areMemoryCacheDelegateCallsEnabled;
- (void)_setJavaScriptURLsAreAllowed:(BOOL)setJavaScriptURLsAreAllowed;
+ (NSCursor *)_pointingHandCursor;
- (BOOL)_postsAcceleratedCompositingNotifications;
- (void)_setPostsAcceleratedCompositingNotifications:(BOOL)flag;
- (BOOL)_isUsingAcceleratedCompositing;
- (BOOL)interactiveFormValidationEnabled;
- (void)setInteractiveFormValidationEnabled:(BOOL)enabled;
- (int)validationMessageTimerMagnification;
- (void)setValidationMessageTimerMagnification:(int)newValue;
- (BOOL)_isSoftwareRenderable;
- (void)_setIncludesFlattenedCompositingLayersWhenDrawingToBitmap:(BOOL)flag;
- (BOOL)_includesFlattenedCompositingLayersWhenDrawingToBitmap;
+ (BOOL)_isNodeHaltedPlugin:(DOMNode *)node;
+ (BOOL)_hasPluginForNodeBeenHalted:(DOMNode *)node;
+ (void)_restartHaltedPluginForNode:(DOMNode *)node;
- (NSPasteboard *)_insertionPasteboard;
+ (void)_addOriginAccessWhitelistEntryWithSourceOrigin:(NSString *)sourceOrigin destinationProtocol:(NSString *)destinationProtocol destinationHost:(NSString *)destinationHost allowDestinationSubdomains:(BOOL)allowDestinationSubdomains;
+ (void)_removeOriginAccessWhitelistEntryWithSourceOrigin:(NSString *)sourceOrigin destinationProtocol:(NSString *)destinationProtocol destinationHost:(NSString *)destinationHost allowDestinationSubdomains:(BOOL)allowDestinationSubdomains;
+ (void)_resetOriginAccessWhitelists;
+ (void)_addUserScriptToGroup:(NSString *)groupName world:(WebScriptWorld *)world source:(NSString *)source url:(NSURL *)url whitelist:(NSArray *)whitelist blacklist:(NSArray *)blacklist injectionTime:(WebUserScriptInjectionTime)injectionTime;
+ (void)_addUserStyleSheetToGroup:(NSString *)groupName world:(WebScriptWorld *)world source:(NSString *)source url:(NSURL *)url whitelist:(NSArray *)whitelist blacklist:(NSArray *)blacklist;
+ (void)_addUserScriptToGroup:(NSString *)groupName world:(WebScriptWorld *)world source:(NSString *)source url:(NSURL *)url whitelist:(NSArray *)whitelist blacklist:(NSArray *)blacklist injectionTime:(WebUserScriptInjectionTime)injectionTime injectedFrames:(WebUserContentInjectedFrames)injectedFrames;
+ (void)_addUserStyleSheetToGroup:(NSString *)groupName world:(WebScriptWorld *)world source:(NSString *)source url:(NSURL *)url whitelist:(NSArray *)whitelist blacklist:(NSArray *)blacklist injectedFrames:(WebUserContentInjectedFrames)injectedFrames;
+ (void)_removeUserScriptFromGroup:(NSString *)groupName world:(WebScriptWorld *)world url:(NSURL *)url;
+ (void)_removeUserStyleSheetFromGroup:(NSString *)groupName world:(WebScriptWorld *)world url:(NSURL *)url;
+ (void)_removeUserScriptsFromGroup:(NSString *)groupName world:(WebScriptWorld *)world;
+ (void)_removeUserStyleSheetsFromGroup:(NSString *)groupName world:(WebScriptWorld *)world;
+ (void)_removeAllUserContentFromGroup:(NSString *)groupName;
+ (void)_setLoadResourcesSerially:(BOOL)serialize;
- (BOOL)cssAnimationsSuspended;
- (void)setCSSAnimationsSuspended:(BOOL)suspended;
+ (void)_setDomainRelaxationForbidden:(BOOL)forbidden forURLScheme:(NSString *)scheme;
+ (void)_registerURLSchemeAsSecure:(NSString *)scheme;
- (void)_scaleWebView:(float)scale atOrigin:(NSPoint)origin;
- (float)_viewScaleFactor;
- (void)_setUseFixedLayout:(BOOL)fixed;
- (void)_setFixedLayoutSize:(NSSize)size;
- (BOOL)_useFixedLayout;
- (NSSize)_fixedLayoutSize;
- (WebNSUInteger)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag highlight:(BOOL)highlight limit:(WebNSUInteger)limit;
- (WebNSUInteger)countMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag highlight:(BOOL)highlight limit:(WebNSUInteger)limit markMatches:(BOOL)markMatches;
- (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag startInSelection:(BOOL)startInSelection;
+ (double)_defaultMinimumTimerInterval;
- (void)_setMinimumTimerInterval:(double)intervalInSeconds;
+ (BOOL)_HTTPPipeliningEnabled;
+ (void)_setHTTPPipeliningEnabled:(BOOL)enabled;
@end
@interface WebView (WebViewPrintingPrivate)
- (void)_adjustPrintingMarginsForHeaderAndFooter;
- (void)_drawHeaderAndFooter;
@end
@interface WebView (WebViewGrammarChecking)
- (BOOL)isGrammarCheckingEnabled;
- (void)setGrammarCheckingEnabled:(BOOL)flag;
- (void)toggleGrammarChecking:(id)sender;
@end
@interface WebView (WebViewTextChecking)
- (BOOL)isAutomaticQuoteSubstitutionEnabled;
- (BOOL)isAutomaticLinkDetectionEnabled;
- (BOOL)isAutomaticDashSubstitutionEnabled;
- (BOOL)isAutomaticTextReplacementEnabled;
- (BOOL)isAutomaticSpellingCorrectionEnabled;
#ifndef BUILDING_ON_LEOPARD
- (void)setAutomaticQuoteSubstitutionEnabled:(BOOL)flag;
- (void)toggleAutomaticQuoteSubstitution:(id)sender;
- (void)setAutomaticLinkDetectionEnabled:(BOOL)flag;
- (void)toggleAutomaticLinkDetection:(id)sender;
- (void)setAutomaticDashSubstitutionEnabled:(BOOL)flag;
- (void)toggleAutomaticDashSubstitution:(id)sender;
- (void)setAutomaticTextReplacementEnabled:(BOOL)flag;
- (void)toggleAutomaticTextReplacement:(id)sender;
- (void)setAutomaticSpellingCorrectionEnabled:(BOOL)flag;
- (void)toggleAutomaticSpellingCorrection:(id)sender;
#endif
#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
- (void)handleCorrectionPanelResult:(NSString*)result;
#endif
@end
@interface WebView (WebViewEditingInMail)
- (void)_insertNewlineInQuotedContent;
- (void)_replaceSelectionWithNode:(DOMNode *)node matchStyle:(BOOL)matchStyle;
- (BOOL)_selectionIsCaret;
- (BOOL)_selectionIsAll;
@end
@interface WebView (WebViewDeviceOrientation)
- (void)_setDeviceOrientationProvider:(id<WebDeviceOrientationProvider>)deviceOrientationProvider;
- (id<WebDeviceOrientationProvider>)_deviceOrientationProvider;
@end
@protocol WebGeolocationProvider <NSObject>
- (void)registerWebView:(WebView *)webView;
- (void)unregisterWebView:(WebView *)webView;
- (WebGeolocationPosition *)lastPosition;
@end
@interface WebView (WebViewGeolocation)
- (void)_setGeolocationProvider:(id<WebGeolocationProvider>)locationProvider;
- (id<WebGeolocationProvider>)_geolocationProvider;
- (void)_geolocationDidChangePosition:(WebGeolocationPosition *)position;
- (void)_geolocationDidFailWithError:(NSError *)error;
@end
@interface WebView (WebViewPrivateStyleInfo)
- (JSValueRef)_computedStyleIncludingVisitedInfo:(JSContextRef)context forElement:(JSValueRef)value;
@end
@interface WebView (WebViewPrivateNodesFromRect)
- (JSValueRef)_nodesFromRect:(JSContextRef)context forDocument:(JSValueRef)value x:(int)x y:(int)y top:(unsigned)top right:(unsigned)right bottom:(unsigned)bottom left:(unsigned)left ignoreClipping:(BOOL)ignoreClipping;
@end
@interface NSObject (WebFrameLoadDelegatePrivate)
- (void)webView:(WebView *)sender didFirstLayoutInFrame:(WebFrame *)frame;
- (void)webView:(WebView *)sender didFinishDocumentLoadForFrame:(WebFrame *)frame;
- (void)webView:(WebView *)sender didHandleOnloadEventsForFrame:(WebFrame *)frame;
- (void)webView:(WebView *)sender didFirstVisuallyNonEmptyLayoutInFrame:(WebFrame *)frame;
- (void)webView:(WebView *)webView didClearInspectorWindowObject:(WebScriptObject *)windowObject forFrame:(WebFrame *)frame;
@end
@interface NSObject (WebResourceLoadDelegatePrivate)
- (NSCachedURLResponse *)webView:(WebView *)sender resource:(id)identifier willCacheResponse:(NSCachedURLResponse *)response fromDataSource:(WebDataSource *)dataSource;
@end
#ifdef __cplusplus
extern "C" {
#endif
void WebInstallMemoryPressureHandler(void);
#ifdef __cplusplus
}
#endif
#undef WebNSInteger
#undef WebNSUInteger