objc2_web_kit/generated/
WKNavigationResponse.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// Contains information about a navigation response, used for making policy decisions.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/wknavigationresponse?language=objc)
13    #[unsafe(super(NSObject))]
14    #[thread_kind = MainThreadOnly]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct WKNavigationResponse;
17);
18
19unsafe impl NSObjectProtocol for WKNavigationResponse {}
20
21impl WKNavigationResponse {
22    extern_methods!(
23        /// A Boolean value indicating whether the frame being navigated is the main frame.
24        #[unsafe(method(isForMainFrame))]
25        #[unsafe(method_family = none)]
26        pub unsafe fn isForMainFrame(&self) -> bool;
27
28        /// The frame's response.
29        #[unsafe(method(response))]
30        #[unsafe(method_family = none)]
31        pub unsafe fn response(&self) -> Retained<NSURLResponse>;
32
33        /// A Boolean value indicating whether WebKit can display the response's MIME type natively.
34        ///
35        /// Allowing a navigation response with a MIME type that can't be shown will cause the navigation to fail.
36        #[unsafe(method(canShowMIMEType))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn canShowMIMEType(&self) -> bool;
39    );
40}
41
42/// Methods declared on superclass `NSObject`.
43impl WKNavigationResponse {
44    extern_methods!(
45        #[unsafe(method(init))]
46        #[unsafe(method_family = init)]
47        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
48
49        #[unsafe(method(new))]
50        #[unsafe(method_family = new)]
51        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
52    );
53}