objc2_cinematic/generated/
CNDecision.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-media")]
6use objc2_core_media::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11extern_class!(
12    /// Represents a decision to focus on a specific detectionID or detectionGroupID; optionally strong.
13    ///
14    /// A strong decision keeps focus for as long as possible.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/cinematic/cndecision?language=objc)
17    #[unsafe(super(NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    pub struct CNDecision;
20);
21
22unsafe impl Send for CNDecision {}
23
24unsafe impl Sync for CNDecision {}
25
26extern_conformance!(
27    unsafe impl NSCopying for CNDecision {}
28);
29
30unsafe impl CopyingHelper for CNDecision {
31    type Result = Self;
32}
33
34extern_conformance!(
35    unsafe impl NSObjectProtocol for CNDecision {}
36);
37
38impl CNDecision {
39    extern_methods!(
40        #[cfg(all(feature = "CNDetection", feature = "objc2-core-media"))]
41        /// Make a decision to focus on the detection with the given detectionID.
42        /// A strong decision keeps focus for as long as possible.
43        #[unsafe(method(initWithTime:detectionID:strong:))]
44        #[unsafe(method_family = init)]
45        pub unsafe fn initWithTime_detectionID_strong(
46            this: Allocated<Self>,
47            time: CMTime,
48            detection_id: CNDetectionID,
49            is_strong: bool,
50        ) -> Retained<Self>;
51
52        #[cfg(all(feature = "CNDetection", feature = "objc2-core-media"))]
53        /// Make a decision to focus on the best among those detections with the same detectionGroupID.
54        /// A strong decision keeps focus for as long as possible.
55        #[unsafe(method(initWithTime:detectionGroupID:strong:))]
56        #[unsafe(method_family = init)]
57        pub unsafe fn initWithTime_detectionGroupID_strong(
58            this: Allocated<Self>,
59            time: CMTime,
60            detection_group_id: CNDetectionGroupID,
61            is_strong: bool,
62        ) -> Retained<Self>;
63
64        #[cfg(feature = "objc2-core-media")]
65        /// The first presentation time at which the subject should be in focus.
66        /// The rack focus transition to the subject occurs prior to this time.
67        #[unsafe(method(time))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn time(&self) -> CMTime;
70
71        #[cfg(feature = "CNDetection")]
72        /// The detectionID of the detection to focus on if this is not a group decision.
73        #[unsafe(method(detectionID))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn detectionID(&self) -> CNDetectionID;
76
77        #[cfg(feature = "CNDetection")]
78        /// The detectionGroupID of the detection to focus on if this is a group decision.
79        #[unsafe(method(detectionGroupID))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn detectionGroupID(&self) -> CNDetectionGroupID;
82
83        /// Whether this is a user-created decision, or a base decision.
84        #[unsafe(method(isUserDecision))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn isUserDecision(&self) -> bool;
87
88        /// Whether this is a group decision or not.
89        #[unsafe(method(isGroupDecision))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn isGroupDecision(&self) -> bool;
92
93        /// Whether this is a strong decision or not.
94        /// A strong decision keeps focus for as long as possible.
95        #[unsafe(method(isStrongDecision))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn isStrongDecision(&self) -> bool;
98
99        #[unsafe(method(init))]
100        #[unsafe(method_family = init)]
101        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
102
103        #[unsafe(method(new))]
104        #[unsafe(method_family = new)]
105        pub unsafe fn new() -> Retained<Self>;
106    );
107}