objc2_web_kit/generated/
WKDownload.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/wkdownload?language=objc)
12    #[unsafe(super(NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct WKDownload;
16);
17
18extern_conformance!(
19    unsafe impl NSObjectProtocol for WKDownload {}
20);
21
22extern_conformance!(
23    unsafe impl NSProgressReporting for WKDownload {}
24);
25
26impl WKDownload {
27    extern_methods!(
28        #[unsafe(method(originalRequest))]
29        #[unsafe(method_family = none)]
30        pub unsafe fn originalRequest(&self) -> Option<Retained<NSURLRequest>>;
31
32        #[cfg(all(feature = "WKWebView", feature = "objc2-app-kit"))]
33        #[cfg(target_os = "macos")]
34        #[unsafe(method(webView))]
35        #[unsafe(method_family = none)]
36        pub unsafe fn webView(&self) -> Option<Retained<WKWebView>>;
37
38        #[cfg(feature = "WKDownloadDelegate")]
39        #[unsafe(method(delegate))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn WKDownloadDelegate>>>;
42
43        #[cfg(feature = "WKDownloadDelegate")]
44        /// This is a [weak property][objc2::topics::weak_property].
45        /// Setter for [`delegate`][Self::delegate].
46        #[unsafe(method(setDelegate:))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn WKDownloadDelegate>>);
49
50        #[unsafe(method(isUserInitiated))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn isUserInitiated(&self) -> bool;
53
54        #[cfg(feature = "WKFrameInfo")]
55        #[unsafe(method(originatingFrame))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn originatingFrame(&self) -> Retained<WKFrameInfo>;
58
59        #[cfg(feature = "block2")]
60        #[unsafe(method(cancel:))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn cancel(
63            &self,
64            completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSData)>>,
65        );
66    );
67}
68
69/// Methods declared on superclass `NSObject`.
70impl WKDownload {
71    extern_methods!(
72        #[unsafe(method(init))]
73        #[unsafe(method_family = init)]
74        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
75
76        #[unsafe(method(new))]
77        #[unsafe(method_family = new)]
78        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
79    );
80}