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
23extern_conformance!(
24    unsafe impl NSCopying for WKFrameInfo {}
25);
26
27unsafe impl CopyingHelper for WKFrameInfo {
28    type Result = Self;
29}
30
31extern_conformance!(
32    unsafe impl NSObjectProtocol for WKFrameInfo {}
33);
34
35impl WKFrameInfo {
36    extern_methods!(
37        /// A Boolean value indicating whether the frame is the main frame
38        /// or a subframe.
39        #[unsafe(method(isMainFrame))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn isMainFrame(&self) -> bool;
42
43        /// The frame's current request.
44        #[unsafe(method(request))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn request(&self) -> Retained<NSURLRequest>;
47
48        #[cfg(feature = "WKSecurityOrigin")]
49        /// The frame's current security origin.
50        #[unsafe(method(securityOrigin))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn securityOrigin(&self) -> Retained<WKSecurityOrigin>;
53
54        #[cfg(all(feature = "WKWebView", feature = "objc2-app-kit"))]
55        #[cfg(target_os = "macos")]
56        /// The web view of the webpage that contains this frame.
57        #[unsafe(method(webView))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn webView(&self) -> Option<Retained<WKWebView>>;
60    );
61}
62
63/// Methods declared on superclass `NSObject`.
64impl WKFrameInfo {
65    extern_methods!(
66        #[unsafe(method(init))]
67        #[unsafe(method_family = init)]
68        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
69
70        #[unsafe(method(new))]
71        #[unsafe(method_family = new)]
72        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
73    );
74}