📄 webviewprivate.h
字号:
/* * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */#import <WebKit/WebView.h>#import <WebKit/WebFramePrivate.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 WebInspector;@class WebPreferences;@class WebTextIterator;@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;// pending public WebElementDictionary keysextern NSString *WebElementTitleKey; // NSString of the title of the element (used by Safari)extern NSString *WebElementSpellingToolTipKey; // NSString of a tooltip representing misspelling or bad grammar (used internally)extern NSString *WebElementIsContentEditableKey; // NSNumber indicating whether the inner non-shared node is content editable (used internally)// other WebElementDictionary keysextern NSString *WebElementLinkIsLiveKey; // NSNumber of BOOL indictating whether the link is live or not#if ENABLE_DASHBOARD_SUPPORTtypedef enum { WebDashboardBehaviorAlwaysSendMouseEventsToAllWindows, WebDashboardBehaviorAlwaysSendActiveNullEventsToPlugIns, WebDashboardBehaviorAlwaysAcceptsFirstMouse, WebDashboardBehaviorAllowWheelScrolling, WebDashboardBehaviorUseBackwardCompatibilityMode} WebDashboardBehavior;#endif@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;/*!@method searchFor:direction:caseSensitive:wrap:startInSelection: @abstract Searches a document view for a string and highlights the string if it is found. Starts the search from the current selection. Will search across all frames. @param string The string to search for. @param forward YES to search forward, NO to seach backwards. @param caseFlag YES to for case-sensitive search, NO for case-insensitive search. @param wrapFlag YES to wrap around, NO to avoid wrapping. @param startInSelection YES to begin search in the selected text (useful for incremental searching), NO to begin search after the selected text. @result YES if found, NO if not found. */- (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag startInSelection:(BOOL)startInSelection;- (void)setMainFrameDocumentReady:(BOOL)mainFrameDocumentReady;- (void)setTabKeyCyclesThroughElements:(BOOL)cyclesElements;- (BOOL)tabKeyCyclesThroughElements;- (void)scrollDOMRangeToVisible:(DOMRange *)range;// setHoverFeedbackSuspended: can be called by clients that want to temporarily prevent the webView// from displaying feedback about mouse position. Each WebDocumentView class that displays feedback// about mouse position should honor this setting.- (void)setHoverFeedbackSuspended:(BOOL)newValue;- (BOOL)isHoverFeedbackSuspended;/*!@method setScriptDebugDelegate:@abstract Set the WebView's WebScriptDebugDelegate delegate.@param delegate The WebScriptDebugDelegate to set as the delegate.*/ - (void)setScriptDebugDelegate:(id)delegate;/*!@method scriptDebugDelegate@abstract Return the WebView's WebScriptDebugDelegate.@result The WebView's WebScriptDebugDelegate.*/ - (id)scriptDebugDelegate;- (BOOL)shouldClose;/*! @method aeDescByEvaluatingJavaScriptFromString: @param script The text of the JavaScript. @result The result of the script, converted to an NSAppleEventDescriptor, or nil for failure.*/- (NSAppleEventDescriptor *)aeDescByEvaluatingJavaScriptFromString:(NSString *)script;// Support for displaying multiple text matches.// These methods might end up moving into a protocol, so different document types can specify// whether or not they implement the protocol. For now we'll just deal with HTML.// These methods are still in flux; don't rely on them yet.- (BOOL)canMarkAllTextMatches;- (WebNSUInteger)markAllMatchesForText:(NSString *)string caseSensitive:(BOOL)caseFlag highlight:(BOOL)highlight limit:(WebNSUInteger)limit;- (void)unmarkAllTextMatches;- (NSArray *)rectsForTextMatches;// Support for disabling registration with the undo manager. This is equivalent to the methods with the same names on NSTextView.- (BOOL)allowsUndo;- (void)setAllowsUndo:(BOOL)flag;/*! @method setPageSizeMultiplier: @abstract Change the zoom factor of the page in views managed by this webView. @param multiplier A fractional percentage value, 1.0 is 100%.*/ - (void)setPageSizeMultiplier:(float)multiplier;/*! @method pageSizeMultiplier @result The page size multipler.*/ - (float)pageSizeMultiplier;// Commands for doing page zoom. Will end up in WebView (WebIBActions) <NSUserInterfaceValidations>- (BOOL)canZoomPageIn;- (IBAction)zoomPageIn:(id)sender;- (BOOL)canZoomPageOut;- (IBAction)zoomPageOut:(id)sender;- (BOOL)canResetPageZoom;- (IBAction)resetPageZoom:(id)sender;// Sets a master volume control for all media elements in the WebView. Valid values are 0..1.- (void)setMediaVolume:(float)volume;- (float)mediaVolume;@end@interface WebView (WebPrivate)- (WebInspector *)inspector;/*! @method setBackgroundColor: @param backgroundColor Color to use as the default background. @abstract Sets what color the receiver draws under transparent page background colors and images. This color is also used when no page is loaded. A color with alpha should only be used when the receiver is in a non-opaque window, since the color is drawn using NSCompositeCopy.*/- (void)setBackgroundColor:(NSColor *)backgroundColor;/*! @method backgroundColor @result Returns the background color drawn under transparent page background colors and images. This color is also used when no page is loaded. A color with alpha should only be used when the receiver is in a non-opaque window, since the color is drawn using NSCompositeCopy.*/- (NSColor *)backgroundColor;/*!Could be worth adding to the API. @method loadItemsFromOtherView: @abstract Loads the view with the contents of the other view, including its backforward list. @param otherView The WebView from which to copy contents. */- (void)_loadBackForwardListFromOtherView:(WebView *)otherView;+ (NSArray *)_supportedFileExtensions;/*! @method canShowFile: @abstract Checks if the WebKit can show the content of the file at the specified path. @param path The path of the file to check @result YES if the WebKit can show the content of the file at the specified path.*/+ (BOOL)canShowFile:(NSString *)path;/*! @method suggestedFileExtensionForMIMEType: @param MIMEType The MIME type to check. @result The extension based on the MIME type*/+ (NSString *)suggestedFileExtensionForMIMEType: (NSString *)MIMEType;+ (NSString *)_standardUserAgentWithApplicationName:(NSString *)applicationName;// May well become public- (void)_setFormDelegate:(id<WebFormDelegate>)delegate;- (id<WebFormDelegate>)_formDelegate;- (BOOL)_isClosed;// _close is now replaced by public method -close. It remains here only for backward compatibility
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -