objc2_web_kit/generated/WKURLSchemeHandler.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_protocol!(
10 /// A class conforming to the WKURLSchemeHandler protocol provides methods for
11 /// loading resources with URL schemes that WebKit doesn't know how to handle itself.
12 ///
13 /// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/wkurlschemehandler?language=objc)
14 pub unsafe trait WKURLSchemeHandler: NSObjectProtocol + MainThreadOnly {
15 #[cfg(all(
16 feature = "WKURLSchemeTask",
17 feature = "WKWebView",
18 feature = "objc2-app-kit"
19 ))]
20 #[cfg(target_os = "macos")]
21 /// Notifies your app to start loading the data for a particular resource
22 /// represented by the URL scheme handler task.
23 ///
24 /// Parameter `webView`: The web view invoking the method.
25 ///
26 /// Parameter `urlSchemeTask`: The task that your app should start loading data for.
27 #[unsafe(method(webView:startURLSchemeTask:))]
28 #[unsafe(method_family = none)]
29 unsafe fn webView_startURLSchemeTask(
30 &self,
31 web_view: &WKWebView,
32 url_scheme_task: &ProtocolObject<dyn WKURLSchemeTask>,
33 );
34
35 #[cfg(all(
36 feature = "WKURLSchemeTask",
37 feature = "WKWebView",
38 feature = "objc2-app-kit"
39 ))]
40 #[cfg(target_os = "macos")]
41 /// Notifies your app to stop handling a URL scheme handler task.
42 ///
43 /// Parameter `webView`: The web view invoking the method.
44 ///
45 /// Parameter `urlSchemeTask`: The task that your app should stop handling.
46 ///
47 /// After your app is told to stop loading data for a URL scheme handler task
48 /// it must not perform any callbacks for that task.
49 /// An exception will be thrown if any callbacks are made on the URL scheme handler task
50 /// after your app has been told to stop loading for it.
51 #[unsafe(method(webView:stopURLSchemeTask:))]
52 #[unsafe(method_family = none)]
53 unsafe fn webView_stopURLSchemeTask(
54 &self,
55 web_view: &WKWebView,
56 url_scheme_task: &ProtocolObject<dyn WKURLSchemeTask>,
57 );
58 }
59);