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;
5#[cfg(feature = "dispatch2")]
6use dispatch2::*;
7use objc2::__framework_prelude::*;
8
9use crate::*;
10
11extern_class!(
12    /// The configuration for this device.
13    ///
14    /// See also [Apple's documentation](https://developer.apple.com/documentation/screentime/stscreentimeconfiguration?language=objc)
15    #[unsafe(super(NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    pub struct STScreenTimeConfiguration;
18);
19
20extern_conformance!(
21    unsafe impl NSObjectProtocol for STScreenTimeConfiguration {}
22);
23
24impl STScreenTimeConfiguration {
25    extern_methods!(
26        /// A Boolean that indicates whether the device is currently enforcing child
27        /// restrictions.
28        #[unsafe(method(enforcesChildRestrictions))]
29        #[unsafe(method_family = none)]
30        pub unsafe fn enforcesChildRestrictions(&self) -> bool;
31
32        #[unsafe(method(init))]
33        #[unsafe(method_family = init)]
34        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
35
36        #[unsafe(method(new))]
37        #[unsafe(method_family = new)]
38        pub unsafe fn new() -> Retained<Self>;
39    );
40}
41
42extern_class!(
43    /// The object you use to observe changes to the current configuration.
44    ///
45    /// Use this class to start and stop observing the current configuration. For
46    /// example, you can opt to disable private browsing in your web browser’s view
47    /// controller when ``STScreenTimeConfiguration/enforcesChildRestrictions`` is
48    /// `true`.
49    ///
50    /// See also [Apple's documentation](https://developer.apple.com/documentation/screentime/stscreentimeconfigurationobserver?language=objc)
51    #[unsafe(super(NSObject))]
52    #[derive(Debug, PartialEq, Eq, Hash)]
53    pub struct STScreenTimeConfigurationObserver;
54);
55
56extern_conformance!(
57    unsafe impl NSObjectProtocol for STScreenTimeConfigurationObserver {}
58);
59
60impl STScreenTimeConfigurationObserver {
61    extern_methods!(
62        #[cfg(feature = "dispatch2")]
63        /// Creates a configuration observer that reports updates on the queue you
64        /// specify.
65        ///
66        /// - Parameters:
67        /// - updateQueue: The queue on which to report updates.
68        ///
69        /// # Safety
70        ///
71        /// `update_queue` possibly has additional threading requirements.
72        #[unsafe(method(initWithUpdateQueue:))]
73        #[unsafe(method_family = init)]
74        pub unsafe fn initWithUpdateQueue(
75            this: Allocated<Self>,
76            update_queue: &DispatchQueue,
77        ) -> Retained<Self>;
78
79        /// Starts observing changes to the current configuration.
80        #[unsafe(method(startObserving))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn startObserving(&self);
83
84        /// Stops observing changes to the current configuration.
85        #[unsafe(method(stopObserving))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn stopObserving(&self);
88
89        /// The configuration being observed.
90        #[unsafe(method(configuration))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn configuration(&self) -> Option<Retained<STScreenTimeConfiguration>>;
93
94        #[unsafe(method(init))]
95        #[unsafe(method_family = init)]
96        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
97
98        #[unsafe(method(new))]
99        #[unsafe(method_family = new)]
100        pub unsafe fn new() -> Retained<Self>;
101    );
102}