2
* Copyright (C) 2006, 2007 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.
27
cpp_quote(" * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.")
29
cpp_quote(" * Redistribution and use in source and binary forms, with or without")
30
cpp_quote(" * modification, are permitted provided that the following conditions")
31
cpp_quote(" * are met:")
32
cpp_quote(" * 1. Redistributions of source code must retain the above copyright")
33
cpp_quote(" * notice, this list of conditions and the following disclaimer.")
34
cpp_quote(" * 2. Redistributions in binary form must reproduce the above copyright")
35
cpp_quote(" * notice, this list of conditions and the following disclaimer in the")
36
cpp_quote(" * documentation and/or other materials provided with the distribution.")
38
cpp_quote(" * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY")
39
cpp_quote(" * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE")
40
cpp_quote(" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR")
41
cpp_quote(" * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR")
42
cpp_quote(" * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,")
43
cpp_quote(" * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,")
44
cpp_quote(" * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR")
45
cpp_quote(" * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY")
46
cpp_quote(" * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT")
47
cpp_quote(" * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE")
48
cpp_quote(" * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ")
54
import "IWebArchive.idl";
55
import "IWebFrameView.idl";
56
import "IWebView.idl";
57
import "IWebURLRequest.idl";
60
interface IDOMDocument;
61
interface IDOMHTMLElement;
62
interface IWebURLRequest;
63
interface IWebArchive;
64
interface IWebDataSource;
65
interface IWebFramePrivate;
66
interface IWebFrameView;
71
@discussion Every web page is represented by at least one WebFrame. A WebFrame
72
has a WebFrameView and a WebDataSource.
73
@interface WebFrame : NSObject
78
uuid(B4B22EF7-DD43-4d01-A992-99C4A8B1F845),
79
pointer_default(unique)
81
interface IWebFrame : IUnknown
85
@result The frame name.
88
HRESULT name([out, retval] BSTR* frameName);
92
@result Returns the WebView for the document that includes this frame.
95
HRESULT webView([out, retval] IWebView** view);
99
@result The WebFrameView for this frame.
100
- (WebFrameView *)frameView;
102
HRESULT frameView([out, retval] IWebFrameView** view);
106
@abstract Returns the DOM document of the frame.
107
@description Returns nil if the frame does not contain a DOM document such as a standalone image.
108
- (DOMDocument *)DOMDocument;
110
HRESULT DOMDocument([out, retval] IDOMDocument** document);
114
@abstract Returns the frame element of the frame.
115
@description The class of the result is either DOMHTMLFrameElement, DOMHTMLIFrameElement or DOMHTMLObjectElement.
116
Returns nil if the frame is the main frame since there is no frame element for the frame in this case.
117
- (DOMHTMLElement *)frameElement;
119
HRESULT frameElement([out, retval] IDOMHTMLElement** frameElement);
123
@param request The web request to load.
124
- (void)loadRequest:(NSURLRequest *)request;
126
HRESULT loadRequest([in] IWebURLRequest* request);
129
@method loadData:MIMEType:textEncodingName:baseURL:
130
@param data The data to use for the main page of the document.
131
@param MIMEType The MIME type of the data.
132
@param encodingName The encoding of the data.
133
@param URL The base URL to apply to relative URLs within the document.
134
- (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)URL;
136
HRESULT loadData([in] IStream* data, [in] BSTR mimeType, [in] BSTR textEncodingName, [in] BSTR url);
139
@method loadHTMLString:baseURL:
140
@param string The string to use for the main page of the document.
141
@param URL The base URL to apply to relative URLs within the document.
142
- (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)URL;
144
HRESULT loadHTMLString([in] BSTR string, [in] BSTR baseURL);
147
@method loadAlternateHTMLString:baseURL:forUnreachableURL:
148
@abstract Loads a page to display as a substitute for a URL that could not be reached.
149
@discussion This allows clients to display page-loading errors in the webview itself.
150
This is typically called while processing the WebFrameLoadDelegate method
151
-webView:didFailProvisionalLoadWithError:forFrame: or one of the the WebPolicyDelegate methods
152
-webView:decidePolicyForMIMEType:request:frame:decisionListener: or
153
-webView:unableToImplementPolicyWithError:frame:. If it is called from within one of those
154
three delegate methods then the back/forward list will be maintained appropriately.
155
@param string The string to use for the main page of the document.
156
@param baseURL The baseURL to apply to relative URLs within the document.
157
@param unreachableURL The URL for which this page will serve as alternate content.
158
- (void)loadAlternateHTMLString:(NSString *)string baseURL:(NSURL *)baseURL forUnreachableURL:(NSURL *)unreachableURL;
160
HRESULT loadAlternateHTMLString([in] BSTR str, [in] BSTR baseURL, [in] BSTR unreachableURL);
164
@abstract Causes WebFrame to load a WebArchive.
165
@param archive The archive to be loaded.
166
- (void)loadArchive:(WebArchive *)archive;
168
HRESULT loadArchive([in] IWebArchive* archive);
172
@discussion Returns the committed data source. Will return nil if the
173
provisional data source hasn't yet been loaded.
174
@result The datasource for this frame.
175
- (WebDataSource *)dataSource;
177
HRESULT dataSource([out, retval] IWebDataSource** source);
180
@method provisionalDataSource
181
@discussion Will return the provisional data source. The provisional data source will
182
be nil if no data source has been set on the frame, or the data source
183
has successfully transitioned to the committed data source.
184
@result The provisional datasource of this frame.
185
- (WebDataSource *)provisionalDataSource;
187
HRESULT provisionalDataSource([out, retval] IWebDataSource** source);
191
@discussion Stop any pending loads on the frame's data source,
195
HRESULT stopLoading();
204
@method findFrameNamed:
205
@discussion This method returns a frame with the given name. findFrameNamed returns self
206
for _self and _current, the parent frame for _parent and the main frame for _top.
207
findFrameNamed returns self for _parent and _top if the receiver is the mainFrame.
208
findFrameNamed first searches from the current frame to all descending frames then the
209
rest of the frames in the WebView. If still not found, findFrameNamed searches the
210
frames of the other WebViews.
211
@param name The name of the frame to find.
212
@result The frame matching the provided name. nil if the frame is not found.
213
- (WebFrame *)findFrameNamed:(NSString *)name;
215
HRESULT findFrameNamed([in] BSTR name, [out, retval] IWebFrame** frame);
219
@result The frame containing this frame, or nil if this is a top level frame.
220
- (WebFrame *)parentFrame;
222
HRESULT parentFrame([out, retval] IWebFrame** frame);
226
@discussion The frames in the array are associated with a frame set or iframe.
227
@result Returns an array of WebFrame.
228
- (NSArray *)childFrames;
230
HRESULT childFrames([out, retval] IEnumVARIANT** enumFrames);
233
/* This is a DOMElement on mac, but maybe should be a DOMHTMLFrameElement? */
234
HRESULT currentForm([out, retval] IDOMElement** frameElement);