2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 cpp_quote("/* identifiers for commands that can be called by the webview's frame */")
27 cpp_quote("enum WebViewCmd { Cut = 100, Copy, Paste, ForwardDelete, SelectAll, Undo, Redo };")
29 cpp_quote("#define WebViewProgressStartedNotification TEXT(\"WebProgressStartedNotification\")")
30 cpp_quote("#define WebViewProgressEstimateChangedNotification TEXT(\"WebProgressEstimateChangedNotification\")")
31 cpp_quote("#define WebViewProgressFinishedNotification TEXT(\"WebProgressFinishedNotification\")")
32 cpp_quote("#define WebViewDidChangeSelectionNotification TEXT(\"WebViewDidChangeSelectionNotification\")")
37 import "IWebUIDelegate.idl";
38 import "IWebURLResponse.idl";
39 import "IWebResourceLoadDelegate.idl";
40 import "IWebDownload.idl";
41 import "IWebFrameLoadDelegate.idl";
42 import "IWebPolicyDelegate.idl";
43 import "IWebBackForwardList.idl";
44 import "IWebHistoryItem.idl";
45 import "IWebPreferences.idl";
47 import "IWebUndoManager.idl";
48 import "IWebEditingDelegate.idl";
49 import "DOMRange.idl";
52 interface IDOMCSSStyleDeclaration;
53 interface IDOMDocument;
54 interface IDOMElement;
58 interface IWebArchive;
59 interface IWebBackForwardList;
60 interface IWebDataSource;
62 interface IWebFrameView;
63 interface IWebHistoryItem;
64 interface IWebPreferences;
65 interface IWebScriptObject;
67 interface IWebUIDelegate;
68 interface IWebResourceLoadDelegate;
69 interface IWebDownloadDelegate;
70 interface IWebEditingDelegate;
71 interface IWebFrameLoadDelegate;
72 interface IWebPolicyDelegate;
73 interface IWebDocumentView;
74 interface IWebDocumentRepresentation;
75 interface IWebUndoManager;
77 /* These are the keys for the WebElementPropertyBag */
78 const LPCOLESTR WebElementDOMNodeKey = L"WebElementDOMNodeKey";
79 const LPCOLESTR WebElementFrameKey = L"WebElementFrameKey";
80 const LPCOLESTR WebElementImageAltStringKey = L"WebElementImageAltStringKey";
81 const LPCOLESTR WebElementImageKey = L"WebElementImageKey";
82 const LPCOLESTR WebElementImageRectKey = L"WebElementImageRectKey";
83 const LPCOLESTR WebElementImageURLKey = L"WebElementImageURLKey";
84 const LPCOLESTR WebElementIsSelectedKey = L"WebElementIsSelectedKey";
85 const LPCOLESTR WebElementMediaURLKey = L"WebElementMediaURLKey";
86 const LPCOLESTR WebElementSpellingToolTipKey = L"WebElementSpellingToolTipKey";
87 const LPCOLESTR WebElementTitleKey = L"WebElementTitleKey";
88 const LPCOLESTR WebElementLinkURLKey = L"WebElementLinkURLKey";
89 const LPCOLESTR WebElementLinkTargetFrameKey = L"WebElementLinkTargetFrameKey";
90 const LPCOLESTR WebElementLinkTitleKey = L"WebElementLinkTitleKey";
91 const LPCOLESTR WebElementLinkLabelKey = L"WebElementLinkLabelKey";
92 const LPCOLESTR WebElementIsContentEditableKey = L"WebElementIsContentEditableKey";
95 @class IEnumTextMatches
100 uuid(C0CDE63A-5ED1-453f-B937-93B1A61AD3B3),
101 pointer_default(unique)
103 interface IEnumTextMatches : IUnknown
105 HRESULT Next(ULONG celt, RECT* rect, ULONG* pceltFetched);
106 HRESULT Skip(ULONG celt);
108 HRESULT Clone(IEnumTextMatches** ppenum);
113 WebView manages the interaction between WebFrameViews and WebDataSources. Modification
114 of the policies and behavior of the WebKit is largely managed by WebViews and their
124 webView = [[WebView alloc] initWithFrame: NSMakeRect (0,0,640,480)];
125 mainFrame = [webView mainFrame];
126 [mainFrame loadRequest:request];
129 WebViews have the following delegates: WebUIDelegate, WebResourceLoadDelegate,
130 WebFrameLoadDelegate, and WebPolicyDelegate.
132 WebKit depends on the WebView's WebUIDelegate for all window
133 related management, including opening new windows and controlling the user interface
134 elements in those windows.
136 WebResourceLoadDelegate is used to monitor the progress of resources as they are
137 loaded. This delegate may be used to present users with a progress monitor.
139 The WebFrameLoadDelegate receives messages when the URL in a WebFrame is
142 WebView's WebPolicyDelegate can make determinations about how
143 content should be handled, based on the resource's URL and MIME type.
145 @interface WebView : NSView
151 uuid(174BBEFD-058E-49c7-91DF-6F110AA4AC28),
152 pointer_default(unique)
154 interface IWebView : IUnknown
157 @method canShowMIMEType:
158 @abstract Checks if the WebKit can show content of a certain MIME type.
159 @param MIMEType The MIME type to check.
160 @result YES if the WebKit can show content with MIMEtype.
161 + (BOOL)canShowMIMEType:(NSString *)MIMEType;
163 HRESULT canShowMIMEType([in] BSTR mimeType, [out, retval] BOOL* canShow);
166 @method canShowMIMETypeAsHTML:
167 @abstract Checks if the the MIME type is a type that the WebKit will interpret as HTML.
168 @param MIMEType The MIME type to check.
169 @result YES if the MIMEtype in an HTML type.
170 + (BOOL)canShowMIMETypeAsHTML:(NSString *)MIMEType;
172 HRESULT canShowMIMETypeAsHTML([in] BSTR mimeType, [out, retval] BOOL* canShow);
175 @method MIMETypesShownAsHTML
176 @result Returns an array of NSStrings that describe the MIME types
177 WebKit will attempt to render as HTML.
178 + (NSArray *)MIMETypesShownAsHTML;
180 HRESULT MIMETypesShownAsHTML([out, retval] IEnumVARIANT** enumVariant);
183 @method setMIMETypesShownAsHTML:
184 @discussion Sets the array of NSString MIME types that WebKit will
185 attempt to render as HTML. Typically you will retrieve the built-in
186 array using MIMETypesShownAsHTML and add additional MIME types to that
188 + (void)setMIMETypesShownAsHTML:(NSArray *)MIMETypes;
190 HRESULT setMIMETypesShownAsHTML([in, size_is(cMimeTypes)] BSTR* mimeTypes, [in] int cMimeTypes);
193 @method URLFromPasteboard:
194 @abstract Returns a URL from a pasteboard
195 @param pasteboard The pasteboard with a URL
196 @result A URL if the pasteboard has one. Nil if it does not.
197 @discussion This method differs than NSURL's URLFromPasteboard method in that it tries multiple pasteboard types
198 including NSURLPboardType to find a URL on the pasteboard.
199 + (NSURL *)URLFromPasteboard:(NSPasteboard *)pasteboard;
201 HRESULT URLFromPasteboard([in] IDataObject* pasteboard, [out, retval] BSTR* url);
204 @method URLTitleFromPasteboard:
205 @abstract Returns a URL title from a pasteboard
206 @param pasteboard The pasteboard with a URL title
207 @result A URL title if the pasteboard has one. Nil if it does not.
208 @discussion This method returns a title that refers a URL on the pasteboard. An example of this is the link label
209 which is the text inside the anchor tag.
210 + (NSString *)URLTitleFromPasteboard:(NSPasteboard *)pasteboard;
212 HRESULT URLTitleFromPasteboard([in] IDataObject* pasteboard, [out, retval] BSTR* urlTitle);
215 @method initWithFrame:frameName:groupName:
216 @abstract The designated initializer for WebView.
217 @discussion Initialize a WebView with the supplied parameters. This method will
218 create a main WebFrame with the view. Passing a top level frame name is useful if you
219 handle a targetted frame navigation that would normally open a window in some other
220 way that still ends up creating a new WebView.
221 @param frame The frame used to create the view.
222 @param frameName The name to use for the top level frame. May be nil.
223 @param groupName The name of the webView set to which this webView will be added. May be nil.
224 @result Returns an initialized WebView.
225 - (id)initWithFrame:(NSRect)frame frameName:(NSString *)frameName groupName:(NSString *)groupName;
227 HRESULT initWithFrame([in] RECT frame, [in] BSTR frameName, [in] BSTR groupName);
230 @method setUIDelegate:
231 @abstract Set the WebView's WebUIDelegate.
232 @param delegate The WebUIDelegate to set as the delegate.
233 - (void)setUIDelegate:(id)delegate;
235 HRESULT setUIDelegate([in] IWebUIDelegate* d);
239 @abstract Return the WebView's WebUIDelegate.
240 @result The WebView's WebUIDelegate.
243 HRESULT uiDelegate([retval, out] IWebUIDelegate** d);
246 @method setResourceLoadDelegate:
247 @abstract Set the WebView's WebResourceLoadDelegate load delegate.
248 @param delegate The WebResourceLoadDelegate to set as the load delegate.
249 - (void)setResourceLoadDelegate:(id)delegate;
251 HRESULT setResourceLoadDelegate([in] IWebResourceLoadDelegate* d);
254 @method resourceLoadDelegate
255 @result Return the WebView's WebResourceLoadDelegate.
256 - (id)resourceLoadDelegate;
258 HRESULT resourceLoadDelegate([retval, out] IWebResourceLoadDelegate** d);
261 @method setDownloadDelegate:
262 @abstract Set the WebView's WebDownloadDelegate.
263 @discussion The download delegate is retained by WebDownload when any downloads are in progress.
264 @param delegate The WebDownloadDelegate to set as the download delegate.
265 - (void)setDownloadDelegate:(id)delegate;
267 HRESULT setDownloadDelegate([in] IWebDownloadDelegate* d);
270 @method downloadDelegate
271 @abstract Return the WebView's WebDownloadDelegate.
272 @result The WebView's WebDownloadDelegate.
273 - (id)downloadDelegate;
275 HRESULT downloadDelegate([retval, out] IWebDownloadDelegate** d);
278 @method setFrameLoadDelegate:
279 @abstract Set the WebView's WebFrameLoadDelegate delegate.
280 @param delegate The WebFrameLoadDelegate to set as the delegate.
281 - (void)setFrameLoadDelegate:(id)delegate;
283 HRESULT setFrameLoadDelegate([in] IWebFrameLoadDelegate* d);
286 @method frameLoadDelegate
287 @abstract Return the WebView's WebFrameLoadDelegate delegate.
288 @result The WebView's WebFrameLoadDelegate delegate.
289 - (id)frameLoadDelegate;
291 HRESULT frameLoadDelegate([retval, out] IWebFrameLoadDelegate** d);
294 @method setPolicyDelegate:
295 @abstract Set the WebView's WebPolicyDelegate delegate.
296 @param delegate The WebPolicyDelegate to set as the delegate.
297 - (void)setPolicyDelegate:(id)delegate;
299 HRESULT setPolicyDelegate([in] IWebPolicyDelegate* d);
302 @method policyDelegate
303 @abstract Return the WebView's WebPolicyDelegate.
304 @result The WebView's WebPolicyDelegate.
305 - (id)policyDelegate;
307 HRESULT policyDelegate([retval, out] IWebPolicyDelegate** d);
311 @abstract Return the top level frame.
312 @discussion Note that even document that are not framesets will have a
314 @result The main frame.
315 - (WebFrame *)mainFrame;
317 HRESULT mainFrame([retval, out] IWebFrame** frame);
321 @abstract Return the frame that has the current focus.
323 HRESULT focusedFrame([retval, out] IWebFrame** frame);
326 @method backForwardList
327 @result The backforward list for this webView.
328 - (WebBackForwardList *)backForwardList;
330 HRESULT backForwardList([retval, out] IWebBackForwardList** list);
333 @method setMaintainsBackForwardList:
334 @abstract Enable or disable the use of a backforward list for this webView.
335 @param flag Turns use of the back forward list on or off
336 - (void)setMaintainsBackForwardList:(BOOL)flag;
338 HRESULT setMaintainsBackForwardList([in] BOOL flag);
342 @abstract Go back to the previous URL in the backforward list.
343 @result YES if able to go back in the backforward list, NO otherwise.
346 HRESULT goBack([out, retval] BOOL* succeeded);
350 @abstract Go forward to the next URL in the backforward list.
351 @result YES if able to go forward in the backforward list, NO otherwise.
354 HRESULT goForward([out, retval] BOOL* succeeded);
357 @method goToBackForwardItem:
358 @abstract Go back or forward to an item in the backforward list.
359 @result YES if able to go to the item, NO otherwise.
360 - (BOOL)goToBackForwardItem:(WebHistoryItem *)item;
362 HRESULT goToBackForwardItem([in] IWebHistoryItem* item, [out, retval] BOOL* succeeded);
365 @method setTextSizeMultiplier:
366 @abstract Change the size of the text rendering in views managed by this webView.
367 @param multiplier A fractional percentage value, 1.0 is 100%.
368 - (void)setTextSizeMultiplier:(float)multiplier;
370 HRESULT setTextSizeMultiplier([in] float multiplier);
373 @method textSizeMultiplier
374 @result The text size multipler.
375 - (float)textSizeMultiplier;
377 HRESULT textSizeMultiplier([out, retval] float* multiplier);
380 @method setApplicationNameForUserAgent:
381 @abstract Set the application name.
382 @discussion This name will be used in user-agent strings
383 that are chosen for best results in rendering web pages.
384 @param applicationName The application name
385 - (void)setApplicationNameForUserAgent:(NSString *)applicationName;
387 HRESULT setApplicationNameForUserAgent([in] BSTR applicationName);
390 @method applicationNameForUserAgent
391 @result The name of the application as used in the user-agent string.
392 - (NSString *)applicationNameForUserAgent;
394 HRESULT applicationNameForUserAgent([out, retval] BSTR* applicationName);
397 @method setCustomUserAgent:
398 @abstract Set the user agent.
399 @discussion Setting this means that the webView should use this user-agent string
400 instead of constructing a user-agent string for each URL. Setting it to nil
401 causes the webView to construct the user-agent string for each URL
402 for best results rendering web pages.
403 @param userAgentString The user agent description
404 - (void)setCustomUserAgent:(NSString *)userAgentString;
406 HRESULT setCustomUserAgent([in] BSTR userAgentString);
409 @method customUserAgent
410 @result The custom user-agent string or nil if no custom user-agent string has been set.
411 - (NSString *)customUserAgent;
413 HRESULT customUserAgent([out, retval] BSTR* userAgentString);
416 @method userAgentForURL:
417 @abstract Get the appropriate user-agent string for a particular URL.
419 @result The user-agent string for the supplied URL.
420 - (NSString *)userAgentForURL:(NSURL *)URL;
422 HRESULT userAgentForURL([in] BSTR url, [out, retval] BSTR* userAgent);
425 @method supportsTextEncoding
426 @abstract Find out if the current web page supports text encodings.
427 @result YES if the document view of the current web page can
428 support different text encodings.
429 - (BOOL)supportsTextEncoding;
431 HRESULT supportsTextEncoding([out, retval] BOOL* supports);
434 @method setCustomTextEncodingName:
435 @discussion Make the page display with a different text encoding; stops any load in progress.
436 The text encoding passed in overrides the normal text encoding smarts including
437 what's specified in a web page's header or HTTP response.
438 The text encoding automatically goes back to the default when the top level frame
439 changes to a new location.
440 Setting the text encoding name to nil makes the webView use default encoding rules.
441 @param encoding The text encoding name to use to display a page or nil.
442 - (void)setCustomTextEncodingName:(NSString *)encodingName;
444 HRESULT setCustomTextEncodingName([in] BSTR encodingName);
447 @method customTextEncodingName
448 @result The custom text encoding name or nil if no custom text encoding name has been set.
449 - (NSString *)customTextEncodingName;
451 HRESULT customTextEncodingName([out, retval] BSTR* encodingName);
454 @method setMediaStyle:
455 @discussion Set the media style for the WebView. The mediaStyle will override the normal value
456 of the CSS media property. Setting the value to nil will restore the normal value.
457 @param mediaStyle The value to use for the CSS media property.
458 - (void)setMediaStyle:(NSString *)mediaStyle;
460 HRESULT setMediaStyle([in] BSTR media);
464 @result mediaStyle The value to use for the CSS media property, as set by setMediaStyle:. It
465 will be nil unless set by that method.
466 - (NSString *)mediaStyle;
468 HRESULT mediaStyle([out, retval] BSTR* media);
471 @method stringByEvaluatingJavaScriptFromString:
472 @param script The text of the JavaScript.
473 @result The result of the script, converted to a string, or nil for failure.
474 - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script;
476 HRESULT stringByEvaluatingJavaScriptFromString([in] BSTR script, [out, retval] BSTR* result);
479 @method windowScriptObject
480 @discussion windowScriptObject return a WebScriptObject that represents the
481 window object from the script environment.
482 @result Returns the window object from the script environment.
483 - (WebScriptObject *)windowScriptObject;
485 HRESULT windowScriptObject([out, retval] IWebScriptObject** webScriptObject);
488 @method setPreferences:
489 @param preferences The preferences to use for the webView.
490 @abstract Override the standard setting for the webView.
491 - (void)setPreferences: (WebPreferences *)prefs;
493 HRESULT setPreferences([in] IWebPreferences* prefs);
497 @result Returns the preferences used by this webView.
498 @discussion This method will return [WebPreferences standardPreferences] if no
499 other instance of WebPreferences has been set.
500 - (WebPreferences *)preferences;
502 HRESULT preferences([out, retval] IWebPreferences** prefs);
505 @method setPreferencesIdentifier:
506 @param anIdentifier The string to use a prefix for storing values for this WebView in the user
508 @discussion If the WebPreferences for this WebView are stored in the user defaults database, the
509 string set in this method will be used a key prefix.
510 - (void)setPreferencesIdentifier:(NSString *)anIdentifier;
512 HRESULT setPreferencesIdentifier([in] BSTR anIdentifier);
515 @method preferencesIdentifier
516 @result Returns the WebPreferences key prefix.
517 - (NSString *)preferencesIdentifier;
519 HRESULT preferencesIdentifier([out, retval] BSTR* anIdentifier);
522 @method setHostWindow:
523 @param hostWindow The host window for the web view.
524 @discussion Parts of WebKit (such as plug-ins and JavaScript) depend on a window to function
525 properly. Set a host window so these parts continue to function even when the web view is
526 not in an actual window.
527 - (void)setHostWindow:(NSWindow *)hostWindow;
529 HRESULT setHostWindow([in] OLE_HANDLE window);
533 @result The host window for the web view.
534 - (NSWindow *)hostWindow;
536 HRESULT hostWindow([out, retval] OLE_HANDLE* window);
539 @method searchFor:direction:caseSensitive:
540 @abstract Searches a document view for a string and highlights the string if it is found.
541 Starts the search from the current selection. Will search across all frames.
542 @param string The string to search for.
543 @param forward YES to search forward, NO to seach backwards.
544 @param caseFlag YES to for case-sensitive search, NO for case-insensitive search.
545 @result YES if found, NO if not found.
546 - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag;
548 HRESULT searchFor([in] BSTR str, [in] BOOL forward, [in] BOOL caseFlag, [in] BOOL wrapFlag, [out, retval] BOOL* found);
551 @method registerViewClass:representationClass:forMIMEType:
552 @discussion Register classes that implement WebDocumentView and WebDocumentRepresentation respectively.
553 A document class may register for a primary MIME type by excluding
554 a subtype, i.e. "video/" will match the document class with
555 all video types. More specific matching takes precedence
556 over general matching.
557 @param viewClass The WebDocumentView class to use to render data for a given MIME type.
558 @param representationClass The WebDocumentRepresentation class to use to represent data of the given MIME type.
559 @param MIMEType The MIME type to represent with an object of the given class.
560 + (void)registerViewClass:(Class)viewClass representationClass:(Class)representationClass forMIMEType:(NSString *)MIMEType;
562 HRESULT registerViewClass([in] IWebDocumentView* view, [in] IWebDocumentRepresentation* representation, [in] BSTR forMIMEType);
565 @method setGroupName:
566 @param groupName The name of the group for this WebView.
567 @discussion JavaScript may access named frames within the same group.
568 - (void)setGroupName:(NSString *)groupName;
570 HRESULT setGroupName([in] BSTR groupName);
574 @discussion The group name for this WebView.
575 - (NSString *)groupName;
577 HRESULT groupName([out, retval] BSTR* groupName);
580 @method estimatedProgress
581 @discussion An estimate of the percent complete for a document load. This
582 value will range from 0 to 1.0 and, once a load completes, will remain at 1.0
583 until a new load starts, at which point it will be reset to 0. The value is an
584 estimate based on the total number of bytes expected to be received
585 for a document, including all it's possible subresources. For more accurate progress
586 indication it is recommended that you implement a WebFrameLoadDelegate and a
587 WebResourceLoadDelegate.
588 - (double)estimatedProgress;
590 HRESULT estimatedProgress([out, retval] double* estimatedProgress);
594 @discussion Returns YES if there are any pending loads.
597 HRESULT isLoading([out, retval] BOOL* isLoading);
600 @method elementAtPoint:
601 @param point A point in the coordinates of the WebView
602 @result An element dictionary describing the point
603 - (NSDictionary *)elementAtPoint:(NSPoint)point;
605 HRESULT elementAtPoint([in] LPPOINT point, [out, retval] IPropertyBag** elementDictionary);
608 @method pasteboardTypesForSelection
609 @abstract Returns the pasteboard types that WebView can use for the current selection
610 - (NSArray *)pasteboardTypesForSelection;
612 HRESULT pasteboardTypesForSelection([out, retval] IEnumVARIANT** enumVariant);
615 @method writeSelectionWithPasteboardTypes:toPasteboard:
616 @abstract Writes the current selection to the pasteboard
617 @param types The types that WebView will write to the pasteboard
618 @param pasteboard The pasteboard to write to
619 - (void)writeSelectionWithPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard;
621 HRESULT writeSelectionWithPasteboardTypes([in, size_is(cTypes)] BSTR* types, [in] int cTypes, [in] IDataObject* pasteboard);
624 @method pasteboardTypesForElement:
625 @abstract Returns the pasteboard types that WebView can use for an element
626 @param element The element
627 - (NSArray *)pasteboardTypesForElement:(NSDictionary *)element;
629 HRESULT pasteboardTypesForElement([in] IPropertyBag* elementDictionary, [out, retval] IEnumVARIANT** enumVariant);
632 @method writeElement:withPasteboardTypes:toPasteboard:
633 @abstract Writes an element to the pasteboard
634 @param element The element to write to the pasteboard
635 @param types The types that WebView will write to the pasteboard
636 @param pasteboard The pasteboard to write to
637 - (void)writeElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard;
639 HRESULT writeElement([in] IPropertyBag* elementDictionary, [in, size_is(cWithPasteboardTypes)] BSTR* withPasteboardTypes, [in] int cWithPasteboardTypes, [in] IDataObject* pasteboard);
643 @abstract Returns the selection as a string
645 HRESULT selectedText([out, retval] BSTR* text);
648 @method centerSelectionInVisibleArea
649 @abstract Centers the selected text in the WebView
650 - (void)centerSelectionInVisibleArea:(id)sender;
652 HRESULT centerSelectionInVisibleArea([in] IUnknown* sender);
655 @method moveDragCaretToPoint:
656 @param point A point in the coordinates of the WebView
657 @discussion This method moves the caret that shows where something being dragged will be dropped. It may cause the WebView to scroll
658 to make the new position of the drag caret visible.
659 - (void)moveDragCaretToPoint:(NSPoint)point;
661 HRESULT moveDragCaretToPoint([in] LPPOINT point);
664 @method removeDragCaret
665 @abstract Removes the drag caret from the WebView
666 - (void)removeDragCaret;
668 HRESULT removeDragCaret();
671 @method setDrawsBackground:
672 @param drawsBackround YES to cause the receiver to draw a default white background, NO otherwise.
673 @abstract Sets whether the receiver draws a default white background when the loaded page has no background specified.
674 - (void)setDrawsBackground:(BOOL)drawsBackround;
676 HRESULT setDrawsBackground([in] BOOL drawsBackground);
679 @method drawsBackground
680 @result Returns YES if the receiver draws a default white background, NO otherwise.
681 - (BOOL)drawsBackground;
683 HRESULT drawsBackground([out, retval] BOOL* drawsBackground);
686 @method setMainFrameURL:
687 @param URLString The URL to load in the mainFrame.
688 - (void)setMainFrameURL:(NSString *)URLString;
690 HRESULT setMainFrameURL([in] BSTR urlString);
694 @result Returns the main frame's current URL.
695 - (NSString *)mainFrameURL;
697 HRESULT mainFrameURL([out, retval] BSTR* urlString);
700 @method mainFrameDocument
701 @result Returns the main frame's DOMDocument.
702 - (DOMDocument *)mainFrameDocument;
704 HRESULT mainFrameDocument([out, retval] IDOMDocument** document);
707 @method mainFrameTitle
708 @result Returns the main frame's title if any, otherwise an empty string.
709 - (NSString *)mainFrameTitle;
711 HRESULT mainFrameTitle([out, retval] BSTR* title);
714 @method mainFrameIcon
715 @discussion The methods returns the site icon for the current page loaded in the mainFrame.
716 @result Returns the main frame's icon if any, otherwise nil.
717 - (NSImage *)mainFrameIcon;
719 HRESULT mainFrameIcon([out, retval] OLE_HANDLE* hBitmap);
722 @method registerURLSchemeAsLocal
723 @discussion Adds the scheme to the list of schemes to be treated as local.
724 @param scheme The scheme to register.
725 + (void)registerURLSchemeAsLocal:(NSString *)scheme;
727 HRESULT registerURLSchemeAsLocal([in] BSTR scheme);
731 @abstract Closes the receiver, unloading its web page and canceling any pending loads.
732 Once the receiver has closed, it will no longer respond to requests or fire delegate methods.
733 (However, the -close method itself may fire delegate methods.)
734 @discussion A garbage collected application is required to call close when the receiver is no longer needed.
735 The close method will be called automatically when the window or hostWindow closes and shouldCloseWithWindow returns YES.
736 A non-garbage collected application can still call close, providing a convenient way to prevent receiver
737 from doing any more loading and firing any future delegate methods.
743 @interface WebView (WebIBActions) <NSUserInterfaceValidations>
748 uuid(8F0E3A30-B924-44f8-990A-1AE61ED6C632),
749 pointer_default(unique)
751 interface IWebIBActions : IUnknown
754 - (IBAction)takeStringURLFrom:(id)sender;
756 HRESULT takeStringURLFrom([in] IUnknown* sender);
759 - (IBAction)stopLoading:(id)sender;
761 HRESULT stopLoading([in] IUnknown* sender);
764 - (IBAction)reload:(id)sender;
766 HRESULT reload([in] IUnknown* sender);
771 HRESULT canGoBack([in] IUnknown* sender, [out, retval] BOOL* result);
774 - (IBAction)goBack:(id)sender;
776 HRESULT goBack([in] IUnknown* sender);
779 - (BOOL)canGoForward;
781 HRESULT canGoForward([in] IUnknown* sender, [out, retval] BOOL* result);
784 - (IBAction)goForward:(id)sender;
786 HRESULT goForward([in] IUnknown* sender);
789 - (BOOL)canMakeTextLarger;
791 HRESULT canMakeTextLarger([in] IUnknown* sender, [out, retval] BOOL* result);
794 - (IBAction)makeTextLarger:(id)sender;
796 HRESULT makeTextLarger([in] IUnknown* sender);
799 - (BOOL)canMakeTextSmaller;
801 HRESULT canMakeTextSmaller([in] IUnknown* sender, [out, retval] BOOL* result);
804 - (IBAction)makeTextSmaller:(id)sender;
806 HRESULT makeTextSmaller([in] IUnknown* sender);
809 - (BOOL)canMakeTextStandardSize;
811 HRESULT canMakeTextStandardSize([in] IUnknown* sender, [out, retval] BOOL* result);
814 - (IBAction)makeTextStandardSize:(id)sender;
816 HRESULT makeTextStandardSize([in] IUnknown* sender);
819 - (IBAction)toggleContinuousSpellChecking:(id)sender;
821 HRESULT toggleContinuousSpellChecking([in] IUnknown* sender);
824 - (IBAction)toggleSmartInsertDelete:(id)sender;
826 HRESULT toggleSmartInsertDelete([in] IUnknown* sender);
829 - (void)toggleGrammarChecking:(id)sender
831 HRESULT toggleGrammarChecking([in] IUnknown* sender);
834 @method setPageSizeMultiplier:
835 @abstract Set a zoom factor for all views managed by this webView.
836 @param multiplier A fractional percentage value, 1.0 is 100%.
837 - (void)setPageSizeMultiplier:(float)multiplier;
839 HRESULT setPageSizeMultiplier([in] float multiplier);
842 @method pageSizeMultiplier
843 @result The page size multipler.
844 - (float)pageSizeMultiplier;
846 HRESULT pageSizeMultiplier([out, retval] float* multiplier);
849 - (BOOL)canZoomPageIn;
851 HRESULT canZoomPageIn([in] IUnknown* sender, [out, retval] BOOL* result);
854 - (IBAction)zoomPageIn:(id)sender;
856 HRESULT zoomPageIn([in] IUnknown* sender);
859 - (BOOL)canZoomPageOut;
861 HRESULT canZoomPageOut([in] IUnknown* sender, [out, retval] BOOL* result);
864 - (IBAction)zoomPageOut:(id)sender;
866 HRESULT zoomPageOut([in] IUnknown* sender);
869 - (BOOL)canResetPageZoom;
871 HRESULT canResetPageZoom([in] IUnknown* sender, [out, retval] BOOL* result);
874 - (IBAction)resetPageZoom:(id)sender;
876 HRESULT resetPageZoom([in] IUnknown* sender);
879 - (IBAction)reloadFromOrigin:(id)sender;
881 HRESULT reloadFromOrigin([in] IUnknown* sender);
885 @interface WebView (WebViewCSS)
890 uuid(ADF68A8C-336F-405c-A053-3D11A9D5B092),
891 pointer_default(unique)
893 interface IWebViewCSS : IUnknown
896 - (DOMCSSStyleDeclaration *)computedStyleForElement:(DOMElement *)element pseudoElement:(NSString *)pseudoElement;
898 HRESULT computedStyleForElement([in] IDOMElement* element, [in] BSTR pseudoElement, [out, retval] IDOMCSSStyleDeclaration** style);
902 @interface WebView (WebViewEditing)
907 uuid(07BDAC9A-19A1-4086-864D-BAD9E0F00D5C),
908 pointer_default(unique)
910 interface IWebViewEditing : IUnknown
913 - (DOMRange *)editableDOMRangeForPoint:(NSPoint)point;
915 HRESULT editableDOMRangeForPoint([in] LPPOINT point, [out, retval] IDOMRange** range);
918 - (void)setSelectedDOMRange:(DOMRange *)range affinity:(NSSelectionAffinity)selectionAffinity;
920 HRESULT setSelectedDOMRange([in] IDOMRange* range, [in] WebSelectionAffinity affinity);
923 - (DOMRange *)selectedDOMRange;
925 HRESULT selectedDOMRange([out, retval] IDOMRange** range);
928 - (NSSelectionAffinity)selectionAffinity;
930 HRESULT selectionAffinity([out, retval] [out, retval] WebSelectionAffinity* affinity);
933 - (void)setEditable:(BOOL)flag;
935 HRESULT setEditable([in] BOOL flag);
940 HRESULT isEditable([out, retval] BOOL* isEditable);
943 - (void)setTypingStyle:(DOMCSSStyleDeclaration *)style;
945 HRESULT setTypingStyle([in] IDOMCSSStyleDeclaration* style);
948 - (DOMCSSStyleDeclaration *)typingStyle;
950 HRESULT typingStyle([out, retval] IDOMCSSStyleDeclaration** style);
953 - (void)setSmartInsertDeleteEnabled:(BOOL)flag;
955 HRESULT setSmartInsertDeleteEnabled([in] BOOL flag);
958 - (BOOL)smartInsertDeleteEnabled;
960 HRESULT smartInsertDeleteEnabled([out, retval] BOOL* enabled);
963 - (void)setContinuousSpellCheckingEnabled:(BOOL)flag;
965 HRESULT setContinuousSpellCheckingEnabled([in] BOOL flag);
968 - (BOOL)isContinuousSpellCheckingEnabled;
970 HRESULT isContinuousSpellCheckingEnabled([out, retval] BOOL* enabled);
973 - (WebNSInt)spellCheckerDocumentTag;
975 HRESULT spellCheckerDocumentTag([out, retval] int* tag);
978 - (NSUndoManager *)undoManager;
980 HRESULT undoManager([out, retval] IWebUndoManager** manager);
983 - (void)setEditingDelegate:(id)delegate;
985 HRESULT setEditingDelegate([in] IWebEditingDelegate* d);
988 - (id)editingDelegate;
990 HRESULT editingDelegate([out, retval] IWebEditingDelegate** d);
993 - (DOMCSSStyleDeclaration *)styleDeclarationWithText:(NSString *)text;
995 HRESULT styleDeclarationWithText([in] BSTR text, [out, retval] IDOMCSSStyleDeclaration** style);
998 - (BOOL)hasSelectedRange;
1000 HRESULT hasSelectedRange([out, retval] BOOL* hasSelectedRange);
1005 HRESULT cutEnabled([out, retval] BOOL* enabled);
1008 - (BOOL)copyEnabled;
1010 HRESULT copyEnabled([out, retval] BOOL* enabled);
1013 - (BOOL)pasteEnabled;
1015 HRESULT pasteEnabled([out, retval] BOOL* enabled);
1018 - (BOOL)deleteEnabled;
1020 HRESULT deleteEnabled([out, retval] BOOL* enabled);
1023 - (BOOL)editingEnabled;
1025 HRESULT editingEnabled([out, retval] BOOL* enabled);
1028 - (BOOL)isGrammarCheckingEnabled
1030 HRESULT isGrammarCheckingEnabled([out, retval] BOOL* enabled);
1033 - (void)setGrammarCheckingEnabled:(BOOL)flag
1035 HRESULT setGrammarCheckingEnabled(BOOL enabled);
1038 - (void)setSelectTrailingWhitespaceEnabled:(BOOL)flag;
1040 HRESULT setSelectTrailingWhitespaceEnabled([in] BOOL flag);
1043 - (BOOL)selectTrailingWhitespaceEnabled;
1045 HRESULT isSelectTrailingWhitespaceEnabled([out, retval] BOOL* enabled);
1049 @interface WebView (WebViewUndoableEditing)
1054 uuid(639E7121-13C8-4a12-BC18-6E1F3D68F3C3),
1055 pointer_default(unique)
1057 interface IWebViewUndoableEditing : IUnknown
1060 - (void)replaceSelectionWithNode:(DOMNode *)node;
1062 HRESULT replaceSelectionWithNode([in] IDOMNode* node);
1065 - (void)replaceSelectionWithText:(NSString *)text;
1067 HRESULT replaceSelectionWithText([in] BSTR text);
1070 - (void)replaceSelectionWithMarkupString:(NSString *)markupString;
1072 HRESULT replaceSelectionWithMarkupString([in] BSTR markupString);
1075 - (void)replaceSelectionWithArchive:(WebArchive *)archive;
1077 HRESULT replaceSelectionWithArchive([in] IWebArchive* archive);
1080 - (void)deleteSelection;
1082 HRESULT deleteSelection();
1085 - (void)clearSelection;
1087 HRESULT clearSelection();
1090 - (void)applyStyle:(DOMCSSStyleDeclaration *)style;
1092 HRESULT applyStyle([in] IDOMCSSStyleDeclaration* style);
1096 @interface WebView (WebViewEditingActions)
1101 uuid(7E066C42-8E81-4778-888D-D6CC93E27D4C),
1102 pointer_default(unique)
1104 interface IWebViewEditingActions : IUnknown
1107 - (void)copy:(id)sender;
1109 HRESULT copy([in] IUnknown* sender);
1112 - (void)cut:(id)sender;
1114 HRESULT cut([in] IUnknown* sender);
1117 - (void)paste:(id)sender;
1119 HRESULT paste([in] IUnknown* sender);
1122 - (void)copyURL:(id)sender;
1124 HRESULT copyURL([in] BSTR url);
1127 - (void)copyFont:(id)sender;
1129 HRESULT copyFont([in] IUnknown* sender);
1132 - (void)pasteFont:(id)sender;
1134 HRESULT pasteFont([in] IUnknown* sender);
1137 - (void)delete:(id)sender;
1139 HRESULT delete_([in] IUnknown* sender);
1142 - (void)pasteAsPlainText:(id)sender;
1144 HRESULT pasteAsPlainText([in] IUnknown* sender);
1147 - (void)pasteAsRichText:(id)sender;
1149 HRESULT pasteAsRichText([in] IUnknown* sender);
1153 - (void)changeFont:(id)sender;
1155 HRESULT changeFont([in] IUnknown* sender);
1158 - (void)changeAttributes:(id)sender;
1160 HRESULT changeAttributes([in] IUnknown* sender);
1163 - (void)changeDocumentBackgroundColor:(id)sender;
1165 HRESULT changeDocumentBackgroundColor([in] IUnknown* sender);
1168 - (void)changeColor:(id)sender;
1170 HRESULT changeColor([in] IUnknown* sender);
1174 - (void)alignCenter:(id)sender;
1176 HRESULT alignCenter([in] IUnknown* sender);
1179 - (void)alignJustified:(id)sender;
1181 HRESULT alignJustified([in] IUnknown* sender);
1184 - (void)alignLeft:(id)sender;
1186 HRESULT alignLeft([in] IUnknown* sender);
1189 - (void)alignRight:(id)sender;
1191 HRESULT alignRight([in] IUnknown* sender);
1195 - (void)checkSpelling:(id)sender;
1197 HRESULT checkSpelling([in] IUnknown* sender);
1200 - (void)showGuessPanel:(id)sender;
1202 HRESULT showGuessPanel([in] IUnknown* sender);
1205 - (void)performFindPanelAction:(id)sender;
1207 HRESULT performFindPanelAction([in] IUnknown* sender);
1211 - (void)startSpeaking:(id)sender;
1213 HRESULT startSpeaking([in] IUnknown* sender);
1216 - (void)stopSpeaking:(id)sender;
1218 HRESULT stopSpeaking([in] IUnknown* sender);