objc2_screen_time/generated/
STScreenTimeConfiguration.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
7use crate::*;
8
9extern_class!(
10    /// The configuration for this device.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/screentime/stscreentimeconfiguration?language=objc)
13    #[unsafe(super(NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct STScreenTimeConfiguration;
16);
17
18extern_conformance!(
19    unsafe impl NSObjectProtocol for STScreenTimeConfiguration {}
20);
21
22impl STScreenTimeConfiguration {
23    extern_methods!(
24        /// A Boolean that indicates whether the device is currently enforcing child
25        /// restrictions.
26        #[unsafe(method(enforcesChildRestrictions))]
27        #[unsafe(method_family = none)]
28        pub unsafe fn enforcesChildRestrictions(&self) -> bool;
29
30        #[unsafe(method(init))]
31        #[unsafe(method_family = init)]
32        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
33
34        #[unsafe(method(new))]
35        #[unsafe(method_family = new)]
36        pub unsafe fn new() -> Retained<Self>;
37    );
38}
39
40extern_class!(
41    /// The object you use to observe changes to the current configuration.
42    ///
43    /// Use this class to start and stop observing the current configuration. For
44    /// example, you can opt to disable private browsing in your web browser’s view
45    /// controller when ``STScreenTimeConfiguration/enforcesChildRestrictions`` is
46    /// `true`.
47    ///
48    /// See also [Apple's documentation](https://developer.apple.com/documentation/screentime/stscreentimeconfigurationobserver?language=objc)
49    #[unsafe(super(NSObject))]
50    #[derive(Debug, PartialEq, Eq, Hash)]
51    pub struct STScreenTimeConfigurationObserver;
52);
53
54extern_conformance!(
55    unsafe impl NSObjectProtocol for STScreenTimeConfigurationObserver {}
56);
57
58impl STScreenTimeConfigurationObserver {
59    extern_methods!(
60        /// Starts observing changes to the current configuration.
61        #[unsafe(method(startObserving))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn startObserving(&self);
64
65        /// Stops observing changes to the current configuration.
66        #[unsafe(method(stopObserving))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn stopObserving(&self);
69
70        /// The configuration being observed.
71        #[unsafe(method(configuration))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn configuration(&self) -> Option<Retained<STScreenTimeConfiguration>>;
74
75        #[unsafe(method(init))]
76        #[unsafe(method_family = init)]
77        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
78
79        #[unsafe(method(new))]
80        #[unsafe(method_family = new)]
81        pub unsafe fn new() -> Retained<Self>;
82    );
83}