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