📄 iwebuidelegate.idl
字号:
/* * Copyright (C) 2006, 2007, 2008 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. * * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 COMPUTER, INC. OR * 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. */#ifndef DO_NO_IMPORTSimport "oaidl.idl";import "ocidl.idl";import "IWebUndoTarget.idl";import "IWebURLRequest.idl";import "IWebFrame.idl";#endifinterface IWebFrame;interface IWebView;interface IWebURLRequest;interface IWebUndoTarget;/*! @enum WebMenuItemTag @discussion Each menu item in the default menu items array passed in contextMenuItemsForElement:defaultMenuItems: has its tag set to one of the WebMenuItemTags. When iterating through the default menu items array, use the tag to differentiate between them.*/typedef enum WebMenuItemTag { WebMenuItemTagOpenLinkInNewWindow=1, WebMenuItemTagDownloadLinkToDisk, WebMenuItemTagCopyLinkToClipboard, WebMenuItemTagOpenImageInNewWindow, WebMenuItemTagDownloadImageToDisk, WebMenuItemTagCopyImageToClipboard, WebMenuItemTagOpenFrameInNewWindow, WebMenuItemTagCopy, WebMenuItemTagGoBack, WebMenuItemTagGoForward, WebMenuItemTagStop, WebMenuItemTagReload, WebMenuItemTagCut, WebMenuItemTagPaste, WebMenuItemTagSpellingGuess, WebMenuItemTagNoGuessesFound, WebMenuItemTagIgnoreSpelling, WebMenuItemTagLearnSpelling, WebMenuItemTagOther, WebMenuItemTagSearchInSpotlight, WebMenuItemTagSearchWeb, WebMenuItemTagLookUpInDictionary, WebMenuItemTagOpenWithDefaultApplication, WebMenuItemPDFActualSize, WebMenuItemPDFZoomIn, WebMenuItemPDFZoomOut, WebMenuItemPDFAutoSize, WebMenuItemPDFSinglePage, WebMenuItemPDFFacingPages, WebMenuItemPDFContinuous, WebMenuItemPDFNextPage, WebMenuItemPDFPreviousPage, // FIXME: Review these names before release! WebMenuItemTagOpenLink = 2000, WebMenuItemTagIgnoreGrammar, WebtMenuItemTagSpellingMenu, WebMenuItemTagShowSpellingPanel, WebMenuItemTagCheckSpelling, WebMenuItemTagCheckSpellingWhileTyping, WebMenuItemTagCheckGrammarWithSpelling, WebMenuItemTagFontMenu, WebMenuItemTagShowFonts, WebMenuItemTagBold, WebMenuItemTagItalic, WebMenuItemTagUnderline, WebMenuItemTagOutline, WebMenuItemTagStyles, WebMenuItemTagShowColors, WebMenuItemTagSpeechMenu, WebMenuItemTagStartSpeaking, WebMenuItemTagStopSpeaking, WebMenuItemTagWritingDirectionMenu, WebMenuItemTagDefaultDirection, WebMenuItemTagLeftToRight, WebMenuItemTagRightToLeft, WebMenuItemTagPDFSinglePageScrolling, WebMenuItemTagPDFFacingPagesScrolling, WebMenuItemTagInspectElement, WebMenuItemBaseApplicationTag=10000} WebMenuItemTag;/*! @enum WebDragDestinationAction @abstract Actions that the destination of a drag can perform. @constant WebDragDestinationActionNone No action @constant WebDragDestinationActionDHTML Allows DHTML (such as JavaScript) to handle the drag @constant WebDragDestinationActionEdit Allows editable documents to be edited from the drag @constant WebDragDestinationActionLoad Allows a location change from the drag @constant WebDragDestinationActionAny Allows any of the above to occur*/typedef enum WebDragDestinationAction { WebDragDestinationActionNone = 0, WebDragDestinationActionDHTML = 1, WebDragDestinationActionEdit = 2, WebDragDestinationActionLoad = 4, WebDragDestinationActionAny = (unsigned long)-1} WebDragDestinationAction;/*! @enum WebDragSourceAction @abstract Actions that the source of a drag can perform. @constant WebDragSourceActionNone No action @constant WebDragSourceActionDHTML Allows DHTML (such as JavaScript) to start a drag @constant WebDragSourceActionImage Allows an image drag to occur @constant WebDragSourceActionLink Allows a link drag to occur @constant WebDragSourceActionSelection Allows a selection drag to occur @constant WebDragSourceActionAny Allows any of the above to occur*/typedef enum WebDragSourceAction { WebDragSourceActionNone = 0, WebDragSourceActionDHTML = 1, WebDragSourceActionImage = 2, WebDragSourceActionLink = 4, WebDragSourceActionSelection = 8, WebDragSourceActionAny = (unsigned long)-1} WebDragSourceAction;/*! @protocol WebOpenPanelResultListener @discussion This protocol is used to call back with the results of the file open panel requested by runOpenPanelForFileButtonWithResultListener: @protocol WebOpenPanelResultListener <NSObject>*/[ object, oleautomation, uuid(634198C7-9DFC-4aba-9E8C-90AEEA7A4144), pointer_default(unique)]interface IWebOpenPanelResultListener : IUnknown{ /*! @method chooseFilename: @abstract Call this method to return a filename from the file open panel. @param fileName - (void)chooseFilename:(NSString *)fileName; */ HRESULT chooseFilename([out, retval] BSTR* fileName); /*! @method cancel @abstract Call this method to indicate that the file open panel was cancelled. - (void)cancel; */ HRESULT cancel();}/*! @category WebUIDelegate @discussion A class that implements WebUIDelegate provides window-related methods that may be used by Javascript, plugins and other aspects of web pages. These methods are used to open new windows and control aspects of existing windows. @interface NSObject (WebUIDelegate)*/[ object, oleautomation, uuid(2452A889-A74A-4fbc-9617-326A0A953630), pointer_default(unique)]interface IWebUIDelegate : IUnknown{ /*! @method webView:createWebViewWithRequest: @abstract Create a new window and begin to load the specified request. @discussion The newly created window is hidden, and the window operations delegate on the new WebViews will get a webViewShow: call. @param sender The WebView sending the delegate method. @param request The request to load. @result The WebView for the new window. - (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request; */ HRESULT createWebViewWithRequest([in] IWebView* sender, [in] IWebURLRequest* request, [out, retval] IWebView** newWebView); /*! @method webViewShow: @param sender The WebView sending the delegate method. @abstract Show the window that contains the top level view of the WebView, ordering it frontmost. @discussion This will only be called just after createWindowWithRequest: is used to create a new window. - (void)webViewShow:(WebView *)sender; */ HRESULT webViewShow([in] IWebView* sender); /*! @method webViewClose: @abstract Close the current window. @param sender The WebView sending the delegate method. @discussion Clients showing multiple views in one window may choose to close only the one corresponding to this WebView. Other clients may choose to ignore this method entirely. - (void)webViewClose:(WebView *)sender; */ HRESULT webViewClose([in] IWebView* sender); /*! @method webViewFocus: @abstract Focus the current window (i.e. makeKeyAndOrderFront:). @param The WebView sending the delegate method. @discussion Clients showing multiple views in one window may want to also do something to focus the one corresponding to this WebView. - (void)webViewFocus:(WebView *)sender; */ HRESULT webViewFocus([in] IWebView* sender); /*! @method webViewUnfocus: @abstract Unfocus the current window. @param sender The WebView sending the delegate method. @discussion Clients showing multiple views in one window may want to also do something to unfocus the one corresponding to this WebView. - (void)webViewUnfocus:(WebView *)sender; */ HRESULT webViewUnfocus([in] IWebView* sender); /*! @method webViewFirstResponder: @abstract Get the first responder for this window. @param sender The WebView sending the delegate method. @discussion This method should return the focused control in the WebView's view, if any. If the view is out of the window hierarchy, this might return something than calling firstResponder on the real NSWindow would. It's OK to return either nil or the real first responder if some control not in the window has focus. - (NSResponder *)webViewFirstResponder:(WebView *)sender; */ HRESULT webViewFirstResponder([in] IWebView* sender, [out, retval] OLE_HANDLE* responderHWnd); /*! @method webView:makeFirstResponder: @abstract Set the first responder for this window. @param sender The WebView sending the delegate method. @param responder The responder to make first (will always be a view) @discussion responder will always be a view that is in the view subhierarchy of the top-level web view for this WebView. If the WebView's top level view is currently out of the view hierarchy, it may be desirable to save the first responder elsewhere, or possibly ignore this call.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -