1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-javascript-core")]
use objc2_javascript_core::*;
use crate::*;
extern_class!(
/// Every web page is represented by at least one WebFrame. A WebFrame
/// has a WebFrameView and a WebDataSource.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/webframe?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated]
pub struct WebFrame;
);
extern_conformance!(
unsafe impl NSObjectProtocol for WebFrame {}
);
impl WebFrame {
extern_methods!(
#[cfg(all(
feature = "WebFrameView",
feature = "WebView",
feature = "objc2-app-kit"
))]
#[cfg(target_os = "macos")]
/// The designated initializer of WebFrame.
///
/// WebFrames are normally created for you by the WebView. You should
/// not need to invoke this method directly.
///
/// Parameter `name`: The name of the frame.
///
/// Parameter `view`: The WebFrameView for the frame.
///
/// Parameter `webView`: The WebView that manages the frame.
///
/// Returns: Returns an initialized WebFrame.
///
/// # Safety
///
/// - `name` might not allow `None`.
/// - `view` might not allow `None`.
/// - `web_view` might not allow `None`.
#[deprecated]
#[unsafe(method(initWithName:webFrameView:webView:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithName_webFrameView_webView(
this: Allocated<Self>,
name: Option<&NSString>,
view: Option<&WebFrameView>,
web_view: Option<&WebView>,
) -> Option<Retained<Self>>;
/// The frame name.
#[deprecated]
#[unsafe(method(name))]
#[unsafe(method_family = none)]
pub unsafe fn name(&self) -> Retained<NSString>;
#[cfg(all(feature = "WebView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// The WebView for the document that includes this frame.
#[deprecated]
#[unsafe(method(webView))]
#[unsafe(method_family = none)]
pub unsafe fn webView(&self, mtm: MainThreadMarker) -> Option<Retained<WebView>>;
#[cfg(all(feature = "WebFrameView", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
/// The WebFrameView for this frame.
#[deprecated]
#[unsafe(method(frameView))]
#[unsafe(method_family = none)]
pub unsafe fn frameView(&self, mtm: MainThreadMarker) -> Option<Retained<WebFrameView>>;
#[cfg(all(
feature = "DOMDocument",
feature = "DOMNode",
feature = "DOMObject",
feature = "WebScriptObject"
))]
/// The DOM document of the frame.
/// Returns nil if the frame does not contain a DOM document such as a standalone image.
#[deprecated]
#[unsafe(method(DOMDocument))]
#[unsafe(method_family = none)]
pub unsafe fn DOMDocument(&self) -> Option<Retained<DOMDocument>>;
#[cfg(all(
feature = "DOMElement",
feature = "DOMHTMLElement",
feature = "DOMNode",
feature = "DOMObject",
feature = "WebScriptObject"
))]
/// The frame element of the frame.
/// The class of the result is either DOMHTMLFrameElement, DOMHTMLIFrameElement or DOMHTMLObjectElement.
/// Returns nil if the frame is the main frame since there is no frame element for the frame in this case.
#[deprecated]
#[unsafe(method(frameElement))]
#[unsafe(method_family = none)]
pub unsafe fn frameElement(&self) -> Option<Retained<DOMHTMLElement>>;
/// Parameter `request`: The web request to load.
///
/// # Safety
///
/// `request` might not allow `None`.
#[deprecated]
#[unsafe(method(loadRequest:))]
#[unsafe(method_family = none)]
pub unsafe fn loadRequest(&self, request: Option<&NSURLRequest>);
/// Parameter `data`: The data to use for the main page of the document.
///
/// Parameter `MIMEType`: The MIME type of the data.
///
/// Parameter `encodingName`: The encoding of the data.
///
/// Parameter `URL`: The base URL to apply to relative URLs within the document.
///
/// # Safety
///
/// - `data` might not allow `None`.
/// - `mime_type` might not allow `None`.
/// - `encoding_name` might not allow `None`.
/// - `url` might not allow `None`.
#[deprecated]
#[unsafe(method(loadData:MIMEType:textEncodingName:baseURL:))]
#[unsafe(method_family = none)]
pub unsafe fn loadData_MIMEType_textEncodingName_baseURL(
&self,
data: Option<&NSData>,
mime_type: Option<&NSString>,
encoding_name: Option<&NSString>,
url: Option<&NSURL>,
);
/// Parameter `string`: The string to use for the main page of the document.
///
/// Parameter `URL`: The base URL to apply to relative URLs within the document.
///
/// # Safety
///
/// - `string` might not allow `None`.
/// - `url` might not allow `None`.
#[deprecated]
#[unsafe(method(loadHTMLString:baseURL:))]
#[unsafe(method_family = none)]
pub unsafe fn loadHTMLString_baseURL(&self, string: Option<&NSString>, url: Option<&NSURL>);
/// Loads a page to display as a substitute for a URL that could not be reached.
///
/// This allows clients to display page-loading errors in the webview itself.
/// This is typically called while processing the WebFrameLoadDelegate method
/// -webView:didFailProvisionalLoadWithError:forFrame: or one of the WebPolicyDelegate methods
/// -webView:decidePolicyForMIMEType:request:frame:decisionListener: or
/// -webView:unableToImplementPolicyWithError:frame:. If it is called from within one of those
/// three delegate methods then the back/forward list will be maintained appropriately.
///
/// Parameter `string`: The string to use for the main page of the document.
///
/// Parameter `baseURL`: The baseURL to apply to relative URLs within the document.
///
/// Parameter `unreachableURL`: The URL for which this page will serve as alternate content.
///
/// # Safety
///
/// - `string` might not allow `None`.
/// - `base_url` might not allow `None`.
/// - `unreachable_url` might not allow `None`.
#[deprecated]
#[unsafe(method(loadAlternateHTMLString:baseURL:forUnreachableURL:))]
#[unsafe(method_family = none)]
pub unsafe fn loadAlternateHTMLString_baseURL_forUnreachableURL(
&self,
string: Option<&NSString>,
base_url: Option<&NSURL>,
unreachable_url: Option<&NSURL>,
);
#[cfg(feature = "WebArchive")]
/// Causes WebFrame to load a WebArchive.
///
/// Parameter `archive`: The archive to be loaded.
///
/// # Safety
///
/// `archive` might not allow `None`.
#[deprecated]
#[unsafe(method(loadArchive:))]
#[unsafe(method_family = none)]
pub unsafe fn loadArchive(&self, archive: Option<&WebArchive>);
#[cfg(feature = "WebDataSource")]
/// The datasource for this frame.
///
/// Returns the committed data source. Will return nil if the
/// provisional data source hasn't yet been loaded.
#[deprecated]
#[unsafe(method(dataSource))]
#[unsafe(method_family = none)]
pub unsafe fn dataSource(&self) -> Option<Retained<WebDataSource>>;
#[cfg(feature = "WebDataSource")]
/// The provisional datasource of this frame.
///
/// Will return the provisional data source. The provisional data source will
/// be nil if no data source has been set on the frame, or the data source
/// has successfully transitioned to the committed data source.
#[deprecated]
#[unsafe(method(provisionalDataSource))]
#[unsafe(method_family = none)]
pub unsafe fn provisionalDataSource(&self) -> Option<Retained<WebDataSource>>;
/// Stop any pending loads on the frame's data source,
/// and its children.
#[deprecated]
#[unsafe(method(stopLoading))]
#[unsafe(method_family = none)]
pub unsafe fn stopLoading(&self);
/// Performs HTTP/1.1 end-to-end revalidation using cache-validating conditionals if possible.
#[deprecated]
#[unsafe(method(reload))]
#[unsafe(method_family = none)]
pub unsafe fn reload(&self);
/// Performs HTTP/1.1 end-to-end reload.
#[deprecated]
#[unsafe(method(reloadFromOrigin))]
#[unsafe(method_family = none)]
pub unsafe fn reloadFromOrigin(&self);
/// This method returns a frame with the given name. findFrameNamed returns self
/// for _self and _current, the parent frame for _parent and the main frame for _top.
/// findFrameNamed returns self for _parent and _top if the receiver is the mainFrame.
/// findFrameNamed first searches from the current frame to all descending frames then the
/// rest of the frames in the WebView. If still not found, findFrameNamed searches the
/// frames of the other WebViews.
///
/// Parameter `name`: The name of the frame to find.
///
/// Returns: The frame matching the provided name. nil if the frame is not found.
///
/// # Safety
///
/// `name` might not allow `None`.
#[deprecated]
#[unsafe(method(findFrameNamed:))]
#[unsafe(method_family = none)]
pub unsafe fn findFrameNamed(&self, name: Option<&NSString>) -> Option<Retained<WebFrame>>;
/// The frame containing this frame, or nil if this is a top level frame.
#[deprecated]
#[unsafe(method(parentFrame))]
#[unsafe(method_family = none)]
pub unsafe fn parentFrame(&self) -> Option<Retained<WebFrame>>;
/// An array of WebFrame.
///
/// The frames in the array are associated with a frame set or iframe.
#[deprecated]
#[unsafe(method(childFrames))]
#[unsafe(method_family = none)]
pub unsafe fn childFrames(&self) -> Retained<NSArray>;
#[cfg(feature = "WebScriptObject")]
/// The WebScriptObject representing the frame's JavaScript window object.
#[deprecated]
#[unsafe(method(windowObject))]
#[unsafe(method_family = none)]
pub unsafe fn windowObject(&self) -> Option<Retained<WebScriptObject>>;
#[cfg(feature = "objc2-javascript-core")]
/// The frame's global JavaScript execution context.
///
/// Use this method to bridge between the WebKit and JavaScriptCore APIs.
#[deprecated]
#[unsafe(method(globalContext))]
#[unsafe(method_family = none)]
pub unsafe fn globalContext(&self) -> JSGlobalContextRef;
#[cfg(feature = "objc2-javascript-core")]
/// The frame's global JavaScript execution context.
///
/// Use this method to bridge between the WebKit and Objective-C JavaScriptCore API.
#[deprecated]
#[unsafe(method(javaScriptContext))]
#[unsafe(method_family = none)]
pub unsafe fn javaScriptContext(&self) -> Option<Retained<JSContext>>;
);
}
/// Methods declared on superclass `NSObject`.
impl WebFrame {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}