objc2_web_kit/generated/
WKFrameInfo.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    /// A WKFrameInfo object contains information about a frame on a webpage.
11    ///
12    /// An instance of this class is a transient, data-only object;
13    /// it does not uniquely identify a frame across multiple delegate method
14    /// calls.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/wkframeinfo?language=objc)
17    #[unsafe(super(NSObject))]
18    #[thread_kind = MainThreadOnly]
19    #[derive(Debug, PartialEq, Eq, Hash)]
20    pub struct WKFrameInfo;
21);
22
23unsafe impl NSCopying for WKFrameInfo {}
24
25unsafe impl CopyingHelper for WKFrameInfo {
26    type Result = Self;
27}
28
29unsafe impl NSObjectProtocol for WKFrameInfo {}
30
31impl WKFrameInfo {
32    extern_methods!(
33        /// A Boolean value indicating whether the frame is the main frame
34        /// or a subframe.
35        #[unsafe(method(isMainFrame))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn isMainFrame(&self) -> bool;
38
39        /// The frame's current request.
40        #[unsafe(method(request))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn request(&self) -> Retained<NSURLRequest>;
43
44        #[cfg(feature = "WKSecurityOrigin")]
45        /// The frame's current security origin.
46        #[unsafe(method(securityOrigin))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn securityOrigin(&self) -> Retained<WKSecurityOrigin>;
49
50        #[cfg(all(feature = "WKWebView", feature = "objc2-app-kit"))]
51        #[cfg(target_os = "macos")]
52        /// The web view of the webpage that contains this frame.
53        #[unsafe(method(webView))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn webView(&self) -> Option<Retained<WKWebView>>;
56    );
57}
58
59/// Methods declared on superclass `NSObject`.
60impl WKFrameInfo {
61    extern_methods!(
62        #[unsafe(method(init))]
63        #[unsafe(method_family = init)]
64        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
65
66        #[unsafe(method(new))]
67        #[unsafe(method_family = new)]
68        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
69    );
70}