📄 iwebview.idl
字号:
- (void)setCustomUserAgent:(NSString *)userAgentString; */ HRESULT setCustomUserAgent([in] BSTR userAgentString); /*! @method customUserAgent @result The custom user-agent string or nil if no custom user-agent string has been set. - (NSString *)customUserAgent; */ HRESULT customUserAgent([out, retval] BSTR* userAgentString); /*! @method userAgentForURL: @abstract Get the appropriate user-agent string for a particular URL. @param URL The URL. @result The user-agent string for the supplied URL. - (NSString *)userAgentForURL:(NSURL *)URL; */ HRESULT userAgentForURL([in] BSTR url, [out, retval] BSTR* userAgent); /*! @method supportsTextEncoding @abstract Find out if the current web page supports text encodings. @result YES if the document view of the current web page can support different text encodings. - (BOOL)supportsTextEncoding; */ HRESULT supportsTextEncoding([out, retval] BOOL* supports); /*! @method setCustomTextEncodingName: @discussion Make the page display with a different text encoding; stops any load in progress. The text encoding passed in overrides the normal text encoding smarts including what's specified in a web page's header or HTTP response. The text encoding automatically goes back to the default when the top level frame changes to a new location. Setting the text encoding name to nil makes the webView use default encoding rules. @param encoding The text encoding name to use to display a page or nil. - (void)setCustomTextEncodingName:(NSString *)encodingName; */ HRESULT setCustomTextEncodingName([in] BSTR encodingName); /*! @method customTextEncodingName @result The custom text encoding name or nil if no custom text encoding name has been set. - (NSString *)customTextEncodingName; */ HRESULT customTextEncodingName([out, retval] BSTR* encodingName); /*! @method setMediaStyle: @discussion Set the media style for the WebView. The mediaStyle will override the normal value of the CSS media property. Setting the value to nil will restore the normal value. @param mediaStyle The value to use for the CSS media property. - (void)setMediaStyle:(NSString *)mediaStyle; */ HRESULT setMediaStyle([in] BSTR media); /*! @method mediaStyle @result mediaStyle The value to use for the CSS media property, as set by setMediaStyle:. It will be nil unless set by that method. - (NSString *)mediaStyle; */ HRESULT mediaStyle([out, retval] BSTR* media); /*! @method stringByEvaluatingJavaScriptFromString: @param script The text of the JavaScript. @result The result of the script, converted to a string, or nil for failure. - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script; */ HRESULT stringByEvaluatingJavaScriptFromString([in] BSTR script, [out, retval] BSTR* result); /*! @method windowScriptObject @discussion windowScriptObject return a WebScriptObject that represents the window object from the script environment. @result Returns the window object from the script environment. - (WebScriptObject *)windowScriptObject; */ HRESULT windowScriptObject([out, retval] IWebScriptObject** webScriptObject); /*! @method setPreferences: @param preferences The preferences to use for the webView. @abstract Override the standard setting for the webView. - (void)setPreferences: (WebPreferences *)prefs; */ HRESULT setPreferences([in] IWebPreferences* prefs); /*! @method preferences @result Returns the preferences used by this webView. @discussion This method will return [WebPreferences standardPreferences] if no other instance of WebPreferences has been set. - (WebPreferences *)preferences; */ HRESULT preferences([out, retval] IWebPreferences** prefs); /*! @method setPreferencesIdentifier: @param anIdentifier The string to use a prefix for storing values for this WebView in the user defaults database. @discussion If the WebPreferences for this WebView are stored in the user defaults database, the string set in this method will be used a key prefix. - (void)setPreferencesIdentifier:(NSString *)anIdentifier; */ HRESULT setPreferencesIdentifier([in] BSTR anIdentifier); /*! @method preferencesIdentifier @result Returns the WebPreferences key prefix. - (NSString *)preferencesIdentifier; */ HRESULT preferencesIdentifier([out, retval] BSTR* anIdentifier); /*! @method setHostWindow: @param hostWindow The host window for the web view. @discussion Parts of WebKit (such as plug-ins and JavaScript) depend on a window to function properly. Set a host window so these parts continue to function even when the web view is not in an actual window. - (void)setHostWindow:(NSWindow *)hostWindow; */ HRESULT setHostWindow([in] OLE_HANDLE window); /*! @method hostWindow @result The host window for the web view. - (NSWindow *)hostWindow; */ HRESULT hostWindow([out, retval] OLE_HANDLE* window); /*! @method searchFor:direction:caseSensitive: @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. @result YES if found, NO if not found. - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag; */ HRESULT searchFor([in] BSTR str, [in] BOOL forward, [in] BOOL caseFlag, [in] BOOL wrapFlag, [out, retval] BOOL* found); /*! @method registerViewClass:representationClass:forMIMEType: @discussion Register classes that implement WebDocumentView and WebDocumentRepresentation respectively. A document class may register for a primary MIME type by excluding a subtype, i.e. "video/" will match the document class with all video types. More specific matching takes precedence over general matching. @param viewClass The WebDocumentView class to use to render data for a given MIME type. @param representationClass The WebDocumentRepresentation class to use to represent data of the given MIME type. @param MIMEType The MIME type to represent with an object of the given class. + (void)registerViewClass:(Class)viewClass representationClass:(Class)representationClass forMIMEType:(NSString *)MIMEType; */ HRESULT registerViewClass([in] IWebDocumentView* view, [in] IWebDocumentRepresentation* representation, [in] BSTR forMIMEType); /*! @method setGroupName: @param groupName The name of the group for this WebView. @discussion JavaScript may access named frames within the same group. - (void)setGroupName:(NSString *)groupName; */ HRESULT setGroupName([in] BSTR groupName); /*! @method groupName @discussion The group name for this WebView. - (NSString *)groupName; */ HRESULT groupName([out, retval] BSTR* groupName); /*! @method estimatedProgress @discussion An estimate of the percent complete for a document load. This value will range from 0 to 1.0 and, once a load completes, will remain at 1.0 until a new load starts, at which point it will be reset to 0. The value is an estimate based on the total number of bytes expected to be received for a document, including all it's possible subresources. For more accurate progress indication it is recommended that you implement a WebFrameLoadDelegate and a WebResourceLoadDelegate. - (double)estimatedProgress; */ HRESULT estimatedProgress([out, retval] double* estimatedProgress); /*! @method isLoading @discussion Returns YES if there are any pending loads. - (BOOL)isLoading; */ HRESULT isLoading([out, retval] BOOL* isLoading); /*! @method elementAtPoint: @param point A point in the coordinates of the WebView @result An element dictionary describing the point - (NSDictionary *)elementAtPoint:(NSPoint)point; */ HRESULT elementAtPoint([in] LPPOINT point, [out, retval] IPropertyBag** elementDictionary); /*! @method pasteboardTypesForSelection @abstract Returns the pasteboard types that WebView can use for the current selection - (NSArray *)pasteboardTypesForSelection; */ HRESULT pasteboardTypesForSelection([out, retval] IEnumVARIANT** enumVariant); /*! @method writeSelectionWithPasteboardTypes:toPasteboard: @abstract Writes the current selection to the pasteboard @param types The types that WebView will write to the pasteboard @param pasteboard The pasteboard to write to - (void)writeSelectionWithPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard; */ HRESULT writeSelectionWithPasteboardTypes([in, size_is(cTypes)] BSTR* types, [in] int cTypes, [in] IDataObject* pasteboard); /*! @method pasteboardTypesForElement: @abstract Returns the pasteboard types that WebView can use for an element @param element The element - (NSArray *)pasteboardTypesForElement:(NSDictionary *)element; */ HRESULT pasteboardTypesForElement([in] IPropertyBag* elementDictionary, [out, retval] IEnumVARIANT** enumVariant); /*! @method writeElement:withPasteboardTypes:toPasteboard: @abstract Writes an element to the pasteboard @param element The element to write to the pasteboard @param types The types that WebView will write to the pasteboard @param pasteboard The pasteboard to write to - (void)writeElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard; */ HRESULT writeElement([in] IPropertyBag* elementDictionary, [in, size_is(cWithPasteboardTypes)] BSTR* withPasteboardTypes, [in] int cWithPasteboardTypes, [in] IDataObject* pasteboard); /*! @method selectedText @abstract Returns the selection as a string */ HRESULT selectedText([out, retval] BSTR* text); /*! @method centerSelectionInVisibleArea @abstract Centers the selected text in the WebView - (void)centerSelectionInVisibleArea:(id)sender; */ HRESULT centerSelectionInVisibleArea([in] IUnknown* sender); /*! @method moveDragCaretToPoint: @param point A point in the coordinates of the WebView @discussion This method moves the caret that shows where something being dragged will be dropped. It may cause the WebView to scroll to make the new position of the drag caret visible. - (void)moveDragCaretToPoint:(NSPoint)point; */ HRESULT moveDragCaretToPoint([in] LPPOINT point); /*! @method removeDragCaret @abstract Removes the drag caret from the WebView - (void)removeDragCaret; */ HRESULT removeDragCaret(); /*! @method setDrawsBackground: @param drawsBackround YES to cause the receiver to draw a default white background, NO otherwise. @abstract Sets whether the receiver draws a default white background when the loaded page has no background specified. - (void)setDrawsBackground:(BOOL)drawsBackround; */ HRESULT setDrawsBackground([in] BOOL drawsBackground); /*! @method drawsBackground @result Returns YES if the receiver draws a default white background, NO otherwise. - (BOOL)drawsBackground; */ HRESULT drawsBackground([out, retval] BOOL* drawsBackground); /*! @method setMainFrameURL: @param URLString The URL to load in the mainFrame. - (void)setMainFrameURL:(NSString *)URLString; */ HRESULT setMainFrameURL([in] BSTR urlString); /*! @method mainFrameURL @result Returns the main frame's current URL. - (NSString *)mainFrameURL; */ HRESULT mainFrameURL([out, retval] BSTR* urlString); /*! @method mainFrameDocument @result Returns the main frame's DOMDocument. - (DOMDocument *)mainFrameDocument; */ HRESULT mainFrameDocument([out, retval] IDOMDocument** document); /*! @method mainFrameTitle @result Returns the main frame's title if any, otherwise an empty string. - (NSString *)mainFrameTitle; */ HRESULT mainFrameTitle([out, retval] BSTR* title); /*! @method mainFrameIcon @discussion The methods returns the site icon for the current page loaded in the mainFrame. @result Returns the main frame's icon if any, otherwise nil. - (NSImage *)mainFrameIcon; */ HRESULT mainFrameIcon([out, retval] OLE_HANDLE* hBitmap); /*! @method registerURLSchemeAsLocal @discussion Adds the scheme to the list of schemes to be treated as local. @param scheme The scheme to register. + (void)registerURLSchemeAsLocal:(NSString *)scheme; */ HRESULT registerURLSchemeAsLocal([in] BSTR scheme);}/* @interface WebView (WebIBActions) <NSUserInterfaceValidations>*/[ object, oleautomation, uuid(8F0E3A30-B924-44f8-990A-1AE61ED6C632), pointer_default(unique)]interface IWebIBActions : IUnknown{ /* - (IBAction)takeStringURLFrom:(id)sender; */ HRESULT takeStringURLFrom([in] IUnknown* sender); /* - (IBAction)stopLoading:(id)sender; */ HRESULT stopLoading([in] IUnknown* sender); /* - (IBAction)reload:(id)sender; */ HRESULT reload([in] IUnknown* sender); /* - (BOOL)canGoBack; */ HRESULT canGoBack([in] IUnknown* sender, [out, retval] BOOL* result); /* - (IBAction)goBack:(id)sender; */ HRESULT goBack([in] IUnknown* sender); /* - (BOOL)canGoForward; */ HRESULT canGoForward([in] IUnknown* sender, [out, retval] BOOL* result); /* - (IBAction)goForward:(id)sender; */ HRESULT goForward([in] IUnknown* sender); /* - (BOOL)canMakeTextLarger; */ HRESULT canMakeTextLarger([in] IUnknown* sender, [out, retval] BOOL* result); /* - (IBAction)makeTextLarger:(id)sender; */ HRESULT makeTextLarger([in] IUnknown* sender); /* - (BOOL)canMakeTextSmaller; */ HRESULT canMakeTextSmaller([in] IUnknown* sender, [out, retval] BOOL* result); /* - (IBAction)makeTextSmaller:(id)sender; */ HRESULT makeTextSmaller([in] IUnknown* sender); /* - (BOOL)canMakeTextStandardSize; */ HRESULT canMakeTextStandardSize([in] IUnknown* sender, [out, retval] BOOL* result); /* - (IBAction)makeTextStandardSize:(id)sender; */ HRESULT makeTextStandardSize([in] IUnknown* sender);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -