objc2_screen_time/generated/
STWebpageController.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9use objc2_foundation::*;
10
11use crate::*;
12
13extern_class!(
14    /// [Apple's documentation](https://developer.apple.com/documentation/screentime/stwebpagecontroller?language=objc)
15    #[unsafe(super(NSViewController, NSResponder, NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[cfg(feature = "objc2-app-kit")]
18    #[cfg(target_os = "macos")]
19    pub struct STWebpageController;
20);
21
22#[cfg(feature = "objc2-app-kit")]
23#[cfg(target_os = "macos")]
24extern_conformance!(
25    unsafe impl NSCoding for STWebpageController {}
26);
27
28#[cfg(feature = "objc2-app-kit")]
29#[cfg(target_os = "macos")]
30extern_conformance!(
31    unsafe impl NSEditor for STWebpageController {}
32);
33
34#[cfg(feature = "objc2-app-kit")]
35#[cfg(target_os = "macos")]
36extern_conformance!(
37    unsafe impl NSObjectProtocol for STWebpageController {}
38);
39
40#[cfg(feature = "objc2-app-kit")]
41#[cfg(target_os = "macos")]
42extern_conformance!(
43    unsafe impl NSSeguePerforming for STWebpageController {}
44);
45
46#[cfg(feature = "objc2-app-kit")]
47#[cfg(target_os = "macos")]
48extern_conformance!(
49    unsafe impl NSUserInterfaceItemIdentification for STWebpageController {}
50);
51
52#[cfg(feature = "objc2-app-kit")]
53#[cfg(target_os = "macos")]
54impl STWebpageController {
55    extern_methods!(
56        /// A Boolean that indicates whether the webpage controller is not recording web
57        /// usage.
58        ///
59        /// Set to
60        /// <doc
61        /// ://com.apple.documentation/documentation/objectivec/yes> to stop recording and reporting web-usage data.
62        #[unsafe(method(suppressUsageRecording))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn suppressUsageRecording(&self) -> bool;
65
66        /// Setter for [`suppressUsageRecording`][Self::suppressUsageRecording].
67        #[unsafe(method(setSuppressUsageRecording:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn setSuppressUsageRecording(&self, suppress_usage_recording: bool);
70
71        /// The URL for the webpage.
72        ///
73        /// Set this value to the webpage’s URL when the user navigates to a new URL.
74        #[unsafe(method(URL))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn URL(&self) -> Option<Retained<NSURL>>;
77
78        /// Setter for [`URL`][Self::URL].
79        ///
80        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
81        #[unsafe(method(setURL:))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn setURL(&self, url: Option<&NSURL>);
84
85        /// A Boolean that indicates whether there are one or more videos currently
86        /// playing in the webpage.
87        ///
88        /// The default value is
89        /// <doc
90        /// ://com.apple.documentation/documentation/objectivec/no>. Set this value when the webpage starts or
91        /// stops playing video.
92        ///
93        /// - Important: Set this value to
94        /// <doc
95        /// ://com.apple.documentation/documentation/objectivec/no> prior to changing
96        /// ``ScreenTime/STWebpageController/URL`` if the new webpage at that URL stops currently
97        /// playing media and won’t immediately start playing new media.
98        #[unsafe(method(URLIsPlayingVideo))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn URLIsPlayingVideo(&self) -> bool;
101
102        /// Setter for [`URLIsPlayingVideo`][Self::URLIsPlayingVideo].
103        #[unsafe(method(setURLIsPlayingVideo:))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn setURLIsPlayingVideo(&self, url_is_playing_video: bool);
106
107        /// A Boolean that indicates whether the webpage is currently displaying a
108        /// floating picture in picture window.
109        ///
110        /// The default value is
111        /// <doc
112        /// ://com.apple.documentation/documentation/objectivec/no>. Set this value when the webpage starts or
113        /// stops displaying a Picture in Picture window.
114        ///
115        /// - Important: Set this value to
116        /// <doc
117        /// ://com.apple.documentation/documentation/objectivec/no> prior to changing
118        /// ``ScreenTime/STWebpageController/URL`` if the new webpage at that URL ends all
119        /// currently displayed Picture in Picture windows, and won’t immediately
120        /// display a new one.
121        #[unsafe(method(URLIsPictureInPicture))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn URLIsPictureInPicture(&self) -> bool;
124
125        /// Setter for [`URLIsPictureInPicture`][Self::URLIsPictureInPicture].
126        #[unsafe(method(setURLIsPictureInPicture:))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn setURLIsPictureInPicture(&self, url_is_picture_in_picture: bool);
129
130        /// A Boolean that indicates whether a parent or guardian has blocked the URL.
131        ///
132        /// When a parent or guardian blocks the webpage’s URL, the webpage controller
133        /// displays a blocking UI and then sets this property to
134        /// <doc
135        /// ://com.apple.documentation/documentation/objectivec/yes>.
136        #[unsafe(method(URLIsBlocked))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn URLIsBlocked(&self) -> bool;
139
140        #[cfg(feature = "STWebHistory")]
141        /// An optional identifier for the current browsing profile.
142        ///
143        /// The default value is `nil`. This identifier represents a profile and allows you to keep your browsing separate
144        /// for topics like work, personal, or school. Using `nil` will report web history without a profile identifier.
145        /// Web browsers with a "default" profile may want to use `nil` in order to match any web history reported prior
146        /// to this API.
147        #[unsafe(method(profileIdentifier))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn profileIdentifier(&self) -> Option<Retained<STWebHistoryProfileIdentifier>>;
150
151        #[cfg(feature = "STWebHistory")]
152        /// Setter for [`profileIdentifier`][Self::profileIdentifier].
153        ///
154        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
155        #[unsafe(method(setProfileIdentifier:))]
156        #[unsafe(method_family = none)]
157        pub unsafe fn setProfileIdentifier(
158            &self,
159            profile_identifier: Option<&STWebHistoryProfileIdentifier>,
160        );
161
162        /// Changes the bundle identifier used to report web usage.
163        ///
164        /// This is only supported for web browsers that have been properly registered with Screen Time.
165        ///
166        /// - Parameters:
167        /// - bundleIdentifier: The bundle identifier that can be changed to facilitate web usage
168        /// reporting for a parent web browser from one of its helper processes or extensions.
169        /// - error: Any error that occurred while changing the bundle identifier.
170        #[unsafe(method(setBundleIdentifier:error:_))]
171        #[unsafe(method_family = none)]
172        pub unsafe fn setBundleIdentifier_error(
173            &self,
174            bundle_identifier: &NSString,
175        ) -> Result<(), Retained<NSError>>;
176
177        #[unsafe(method(initWithNibName:bundle:))]
178        #[unsafe(method_family = init)]
179        pub unsafe fn initWithNibName_bundle(
180            this: Allocated<Self>,
181            nib_name_or_nil: Option<&NSString>,
182            nib_bundle_or_nil: Option<&NSBundle>,
183        ) -> Retained<Self>;
184
185        /// # Safety
186        ///
187        /// `a_decoder` possibly has further requirements.
188        #[unsafe(method(initWithCoder:))]
189        #[unsafe(method_family = init)]
190        pub unsafe fn initWithCoder(
191            this: Allocated<Self>,
192            a_decoder: &NSCoder,
193        ) -> Option<Retained<Self>>;
194    );
195}
196
197/// Methods declared on superclass `NSResponder`.
198#[cfg(feature = "objc2-app-kit")]
199#[cfg(target_os = "macos")]
200impl STWebpageController {
201    extern_methods!(
202        #[unsafe(method(init))]
203        #[unsafe(method_family = init)]
204        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
205    );
206}
207
208/// Methods declared on superclass `NSObject`.
209#[cfg(feature = "objc2-app-kit")]
210#[cfg(target_os = "macos")]
211impl STWebpageController {
212    extern_methods!(
213        #[unsafe(method(new))]
214        #[unsafe(method_family = new)]
215        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
216    );
217}