objc2_web_kit/generated/
WKWebExtensionWindowConfiguration.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::*;
5#[cfg(feature = "objc2-core-foundation")]
6use objc2_core_foundation::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11extern_class!(
12    /// A ``WKWebExtensionWindowConfiguration`` object encapsulates configuration options for a window in an extension.
13    ///
14    /// This class holds various options that influence the behavior and initial state of a window.
15    /// The app retains the discretion to disregard any or all of these options, or even opt not to create a window.
16    ///
17    /// See also [Apple's documentation](https://developer.apple.com/documentation/webkit/wkwebextensionwindowconfiguration?language=objc)
18    #[unsafe(super(NSObject))]
19    #[thread_kind = MainThreadOnly]
20    #[derive(Debug, PartialEq, Eq, Hash)]
21    pub struct WKWebExtensionWindowConfiguration;
22);
23
24extern_conformance!(
25    unsafe impl NSObjectProtocol for WKWebExtensionWindowConfiguration {}
26);
27
28impl WKWebExtensionWindowConfiguration {
29    extern_methods!(
30        #[unsafe(method(new))]
31        #[unsafe(method_family = new)]
32        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
33
34        #[unsafe(method(init))]
35        #[unsafe(method_family = init)]
36        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
37
38        #[cfg(feature = "WKWebExtensionWindow")]
39        /// Indicates the window type for the window.
40        #[unsafe(method(windowType))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn windowType(&self) -> WKWebExtensionWindowType;
43
44        #[cfg(feature = "WKWebExtensionWindow")]
45        /// Indicates the window state for the window.
46        #[unsafe(method(windowState))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn windowState(&self) -> WKWebExtensionWindowState;
49
50        #[cfg(feature = "objc2-core-foundation")]
51        /// Indicates the frame where the window should be positioned on the main screen.
52        ///
53        /// This frame should override the app's default window position and size.
54        /// Individual components (e.g., `origin.x`, `size.width`) will be `NaN` if not specified.
55        #[unsafe(method(frame))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn frame(&self) -> CGRect;
58
59        /// Indicates the URLs that the window should initially load as tabs.
60        ///
61        /// If ``tabURLs`` and ``tabs`` are both empty, the app's default "start page" should appear in a tab.
62        ///
63        /// See also: tabs
64        #[unsafe(method(tabURLs))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn tabURLs(&self) -> Retained<NSArray<NSURL>>;
67
68        #[cfg(feature = "WKWebExtensionTab")]
69        /// Indicates the existing tabs that should be moved to the window.
70        ///
71        /// If ``tabs`` and ``tabURLs`` are both empty, the app's default "start page" should appear in a tab.
72        ///
73        /// See also: tabURLs
74        #[unsafe(method(tabs))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn tabs(&self) -> Retained<NSArray<ProtocolObject<dyn WKWebExtensionTab>>>;
77
78        /// Indicates whether the window should be focused.
79        #[unsafe(method(shouldBeFocused))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn shouldBeFocused(&self) -> bool;
82
83        /// Indicates whether the window should be private.
84        ///
85        /// Note: To ensure proper isolation between private and non-private data, web views associated with private data must use a
86        /// different ``WKUserContentController``. Likewise, to be identified as a private web view and to ensure that cookies and other
87        /// website data is not shared, private web views must be configured to use a non-persistent ``WKWebsiteDataStore``.
88        #[unsafe(method(shouldBePrivate))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn shouldBePrivate(&self) -> bool;
91    );
92}