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
19extern_conformance!(
20    unsafe impl NSObjectProtocol for WKNavigationResponse {}
21);
22
23impl WKNavigationResponse {
24    extern_methods!(
25        /// A Boolean value indicating whether the frame being navigated is the main frame.
26        #[unsafe(method(isForMainFrame))]
27        #[unsafe(method_family = none)]
28        pub unsafe fn isForMainFrame(&self) -> bool;
29
30        /// The frame's response.
31        #[unsafe(method(response))]
32        #[unsafe(method_family = none)]
33        pub unsafe fn response(&self) -> Retained<NSURLResponse>;
34
35        /// A Boolean value indicating whether WebKit can display the response's MIME type natively.
36        ///
37        /// Allowing a navigation response with a MIME type that can't be shown will cause the navigation to fail.
38        #[unsafe(method(canShowMIMEType))]
39        #[unsafe(method_family = none)]
40        pub unsafe fn canShowMIMEType(&self) -> bool;
41    );
42}
43
44/// Methods declared on superclass `NSObject`.
45impl WKNavigationResponse {
46    extern_methods!(
47        #[unsafe(method(init))]
48        #[unsafe(method_family = init)]
49        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
50
51        #[unsafe(method(new))]
52        #[unsafe(method_family = new)]
53        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
54    );
55}