objc2_web_kit/generated/
WebFrameLoadDelegate.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-app-kit")]
6#[cfg(target_os = "macos")]
7use objc2_app_kit::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_protocol!(
13    /// A WebView's WebFrameLoadDelegate tracks the loading progress of its frames.
14    /// When a data source of a frame starts to load, the data source is considered "provisional".
15    /// Once at least one byte is received, the data source is considered "committed". This is done
16    /// so the contents of the frame will not be lost if the new data source fails to successfully load.
17    ///
18    /// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/webframeloaddelegate?language=objc)
19    #[deprecated]
20    pub unsafe trait WebFrameLoadDelegate: NSObjectProtocol {
21        #[cfg(all(feature = "WebFrame", feature = "WebView", feature = "objc2-app-kit"))]
22        #[cfg(target_os = "macos")]
23        /// Notifies the delegate that the provisional load of a frame has started
24        ///
25        /// Parameter `sender`: The WebView sending the message
26        ///
27        /// Parameter `frame`: The frame for which the provisional load has started
28        ///
29        /// This method is called after the provisional data source of a frame
30        /// has started to load.
31        #[deprecated]
32        #[optional]
33        #[unsafe(method(webView:didStartProvisionalLoadForFrame:))]
34        #[unsafe(method_family = none)]
35        unsafe fn webView_didStartProvisionalLoadForFrame(
36            &self,
37            sender: Option<&WebView>,
38            frame: Option<&WebFrame>,
39        );
40
41        #[cfg(all(feature = "WebFrame", feature = "WebView", feature = "objc2-app-kit"))]
42        #[cfg(target_os = "macos")]
43        /// Notifies the delegate that a server redirect occurred during the provisional load
44        ///
45        /// Parameter `sender`: The WebView sending the message
46        ///
47        /// Parameter `frame`: The frame for which the redirect occurred
48        #[deprecated]
49        #[optional]
50        #[unsafe(method(webView:didReceiveServerRedirectForProvisionalLoadForFrame:))]
51        #[unsafe(method_family = none)]
52        unsafe fn webView_didReceiveServerRedirectForProvisionalLoadForFrame(
53            &self,
54            sender: Option<&WebView>,
55            frame: Option<&WebFrame>,
56        );
57
58        #[cfg(all(feature = "WebFrame", feature = "WebView", feature = "objc2-app-kit"))]
59        #[cfg(target_os = "macos")]
60        /// Notifies the delegate that the provisional load has failed
61        ///
62        /// Parameter `sender`: The WebView sending the message
63        ///
64        /// Parameter `error`: The error that occurred
65        ///
66        /// Parameter `frame`: The frame for which the error occurred
67        ///
68        /// This method is called after the provisional data source has failed to load.
69        /// The frame will continue to display the contents of the committed data source if there is one.
70        #[deprecated]
71        #[optional]
72        #[unsafe(method(webView:didFailProvisionalLoadWithError:forFrame:))]
73        #[unsafe(method_family = none)]
74        unsafe fn webView_didFailProvisionalLoadWithError_forFrame(
75            &self,
76            sender: Option<&WebView>,
77            error: Option<&NSError>,
78            frame: Option<&WebFrame>,
79        );
80
81        #[cfg(all(feature = "WebFrame", feature = "WebView", feature = "objc2-app-kit"))]
82        #[cfg(target_os = "macos")]
83        /// Notifies the delegate that the load has changed from provisional to committed
84        ///
85        /// Parameter `sender`: The WebView sending the message
86        ///
87        /// Parameter `frame`: The frame for which the load has committed
88        ///
89        /// This method is called after the provisional data source has become the
90        /// committed data source.
91        ///
92        /// In some cases, a single load may be committed more than once. This happens
93        /// in the case of multipart/x-mixed-replace, also known as "server push". In this case,
94        /// a single location change leads to multiple documents that are loaded in sequence. When
95        /// this happens, a new commit will be sent for each document.
96        #[deprecated]
97        #[optional]
98        #[unsafe(method(webView:didCommitLoadForFrame:))]
99        #[unsafe(method_family = none)]
100        unsafe fn webView_didCommitLoadForFrame(
101            &self,
102            sender: Option<&WebView>,
103            frame: Option<&WebFrame>,
104        );
105
106        #[cfg(all(feature = "WebFrame", feature = "WebView", feature = "objc2-app-kit"))]
107        #[cfg(target_os = "macos")]
108        /// Notifies the delegate that the page title for a frame has been received
109        ///
110        /// Parameter `sender`: The WebView sending the message
111        ///
112        /// Parameter `title`: The new page title
113        ///
114        /// Parameter `frame`: The frame for which the title has been received
115        ///
116        /// The title may update during loading; clients should be prepared for this.
117        #[deprecated]
118        #[optional]
119        #[unsafe(method(webView:didReceiveTitle:forFrame:))]
120        #[unsafe(method_family = none)]
121        unsafe fn webView_didReceiveTitle_forFrame(
122            &self,
123            sender: Option<&WebView>,
124            title: Option<&NSString>,
125            frame: Option<&WebFrame>,
126        );
127
128        #[cfg(all(feature = "WebFrame", feature = "WebView", feature = "objc2-app-kit"))]
129        #[cfg(target_os = "macos")]
130        /// Notifies the delegate that a page icon image for a frame has been received
131        ///
132        /// Parameter `webView`: The WebView sending the message
133        ///
134        /// Parameter `image`: The icon image. Also known as a "favicon".
135        ///
136        /// Parameter `frame`: The frame for which a page icon has been received
137        #[deprecated]
138        #[optional]
139        #[unsafe(method(webView:didReceiveIcon:forFrame:))]
140        #[unsafe(method_family = none)]
141        unsafe fn webView_didReceiveIcon_forFrame(
142            &self,
143            sender: Option<&WebView>,
144            image: Option<&NSImage>,
145            frame: Option<&WebFrame>,
146        );
147
148        #[cfg(all(feature = "WebFrame", feature = "WebView", feature = "objc2-app-kit"))]
149        #[cfg(target_os = "macos")]
150        /// Notifies the delegate that the committed load of a frame has completed
151        ///
152        /// Parameter `sender`: The WebView sending the message
153        ///
154        /// Parameter `frame`: The frame that finished loading
155        ///
156        /// This method is called after the committed data source of a frame has successfully loaded
157        /// and will only be called when all subresources such as images and stylesheets are done loading.
158        /// Plug-In content and JavaScript-requested loads may occur after this method is called.
159        #[deprecated]
160        #[optional]
161        #[unsafe(method(webView:didFinishLoadForFrame:))]
162        #[unsafe(method_family = none)]
163        unsafe fn webView_didFinishLoadForFrame(
164            &self,
165            sender: Option<&WebView>,
166            frame: Option<&WebFrame>,
167        );
168
169        #[cfg(all(feature = "WebFrame", feature = "WebView", feature = "objc2-app-kit"))]
170        #[cfg(target_os = "macos")]
171        /// Notifies the delegate that the committed load of a frame has failed
172        ///
173        /// Parameter `sender`: The WebView sending the message
174        ///
175        /// Parameter `error`: The error that occurred
176        ///
177        /// Parameter `frame`: The frame that failed to load
178        ///
179        /// This method is called after a data source has committed but failed to completely load.
180        #[deprecated]
181        #[optional]
182        #[unsafe(method(webView:didFailLoadWithError:forFrame:))]
183        #[unsafe(method_family = none)]
184        unsafe fn webView_didFailLoadWithError_forFrame(
185            &self,
186            sender: Option<&WebView>,
187            error: Option<&NSError>,
188            frame: Option<&WebFrame>,
189        );
190
191        #[cfg(all(feature = "WebFrame", feature = "WebView", feature = "objc2-app-kit"))]
192        #[cfg(target_os = "macos")]
193        /// Notifies the delegate that the scroll position in a frame has changed
194        ///
195        /// Parameter `sender`: The WebView sending the message
196        ///
197        /// Parameter `frame`: The frame that scrolled
198        ///
199        /// This method is called when anchors within a page have been clicked.
200        #[deprecated]
201        #[optional]
202        #[unsafe(method(webView:didChangeLocationWithinPageForFrame:))]
203        #[unsafe(method_family = none)]
204        unsafe fn webView_didChangeLocationWithinPageForFrame(
205            &self,
206            sender: Option<&WebView>,
207            frame: Option<&WebFrame>,
208        );
209
210        #[cfg(all(feature = "WebFrame", feature = "WebView", feature = "objc2-app-kit"))]
211        #[cfg(target_os = "macos")]
212        /// Notifies the delegate that a frame will perform a client-side redirect
213        ///
214        /// Parameter `sender`: The WebView sending the message
215        ///
216        /// Parameter `URL`: The URL to be redirected to
217        ///
218        /// Parameter `seconds`: Seconds in which the redirect will happen
219        ///
220        /// Parameter `date`: The fire date
221        ///
222        /// Parameter `frame`: The frame on which the redirect will occur
223        ///
224        /// This method can be used to continue progress feedback while a client-side
225        /// redirect is pending.
226        #[deprecated]
227        #[optional]
228        #[unsafe(method(webView:willPerformClientRedirectToURL:delay:fireDate:forFrame:))]
229        #[unsafe(method_family = none)]
230        unsafe fn webView_willPerformClientRedirectToURL_delay_fireDate_forFrame(
231            &self,
232            sender: Option<&WebView>,
233            url: Option<&NSURL>,
234            seconds: NSTimeInterval,
235            date: Option<&NSDate>,
236            frame: Option<&WebFrame>,
237        );
238
239        #[cfg(all(feature = "WebFrame", feature = "WebView", feature = "objc2-app-kit"))]
240        #[cfg(target_os = "macos")]
241        /// Notifies the delegate that a pending client-side redirect has been cancelled
242        ///
243        /// Parameter `sender`: The WebView sending the message
244        ///
245        /// Parameter `frame`: The frame for which the pending redirect was cancelled
246        ///
247        /// A client-side redirect can be cancelled if a frame changes location before the timeout.
248        #[deprecated]
249        #[optional]
250        #[unsafe(method(webView:didCancelClientRedirectForFrame:))]
251        #[unsafe(method_family = none)]
252        unsafe fn webView_didCancelClientRedirectForFrame(
253            &self,
254            sender: Option<&WebView>,
255            frame: Option<&WebFrame>,
256        );
257
258        #[cfg(all(feature = "WebFrame", feature = "WebView", feature = "objc2-app-kit"))]
259        #[cfg(target_os = "macos")]
260        /// Notifies the delegate that a frame will be closed
261        ///
262        /// Parameter `sender`: The WebView sending the message
263        ///
264        /// Parameter `frame`: The frame that will be closed
265        ///
266        /// This method is called right before WebKit is done with the frame
267        /// and the objects that it contains.
268        #[deprecated]
269        #[optional]
270        #[unsafe(method(webView:willCloseFrame:))]
271        #[unsafe(method_family = none)]
272        unsafe fn webView_willCloseFrame(&self, sender: Option<&WebView>, frame: Option<&WebFrame>);
273
274        #[cfg(all(
275            feature = "WebFrame",
276            feature = "WebScriptObject",
277            feature = "WebView",
278            feature = "objc2-app-kit"
279        ))]
280        #[cfg(target_os = "macos")]
281        /// Notifies the delegate that the JavaScript window object in a frame has
282        /// been cleared in preparation for a new load. This is the preferred place to set custom
283        /// properties on the window object using the WebScriptObject and JavaScriptCore APIs.
284        ///
285        /// Parameter `webView`: The webView sending the message.
286        ///
287        /// Parameter `windowObject`: The WebScriptObject representing the frame's JavaScript window object.
288        ///
289        /// Parameter `frame`: The WebFrame to which windowObject belongs.
290        ///
291        /// If a delegate implements both webView:didClearWindowObject:forFrame:
292        /// and webView:windowScriptObjectAvailable:, only webView:didClearWindowObject:forFrame:
293        /// will be invoked. This enables a delegate to implement both methods for backwards
294        /// compatibility with older versions of WebKit.
295        #[deprecated]
296        #[optional]
297        #[unsafe(method(webView:didClearWindowObject:forFrame:))]
298        #[unsafe(method_family = none)]
299        unsafe fn webView_didClearWindowObject_forFrame(
300            &self,
301            web_view: Option<&WebView>,
302            window_object: Option<&WebScriptObject>,
303            frame: Option<&WebFrame>,
304        );
305
306        #[cfg(all(
307            feature = "WebScriptObject",
308            feature = "WebView",
309            feature = "objc2-app-kit"
310        ))]
311        #[cfg(target_os = "macos")]
312        /// Notifies the delegate that the scripting object for a page is available.  This is called
313        /// before the page is loaded.  It may be useful to allow delegates to bind native objects to the window.
314        ///
315        /// Parameter `webView`: The webView sending the message.
316        ///
317        /// Parameter `windowScriptObject`: The WebScriptObject for the window in the scripting environment.
318        ///
319        /// This method is deprecated. Consider using webView:didClearWindowObject:forFrame:
320        /// instead.
321        #[deprecated]
322        #[optional]
323        #[unsafe(method(webView:windowScriptObjectAvailable:))]
324        #[unsafe(method_family = none)]
325        unsafe fn webView_windowScriptObjectAvailable(
326            &self,
327            web_view: Option<&WebView>,
328            window_script_object: Option<&WebScriptObject>,
329        );
330    }
331);