objc2-cinematic 0.3.2

Bindings to the Cinematic framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-media")]
use objc2_core_media::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// Represents a decision to focus on a specific detectionID or detectionGroupID; optionally strong.
    ///
    /// A strong decision keeps focus for as long as possible.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/cinematic/cndecision?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CNDecision;
);

unsafe impl Send for CNDecision {}

unsafe impl Sync for CNDecision {}

extern_conformance!(
    unsafe impl NSCopying for CNDecision {}
);

unsafe impl CopyingHelper for CNDecision {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for CNDecision {}
);

impl CNDecision {
    extern_methods!(
        #[cfg(all(feature = "CNDetection", feature = "objc2-core-media"))]
        /// Make a decision to focus on the detection with the given detectionID.
        /// A strong decision keeps focus for as long as possible.
        #[unsafe(method(initWithTime:detectionID:strong:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithTime_detectionID_strong(
            this: Allocated<Self>,
            time: CMTime,
            detection_id: CNDetectionID,
            is_strong: bool,
        ) -> Retained<Self>;

        #[cfg(all(feature = "CNDetection", feature = "objc2-core-media"))]
        /// Make a decision to focus on the best among those detections with the same detectionGroupID.
        /// A strong decision keeps focus for as long as possible.
        #[unsafe(method(initWithTime:detectionGroupID:strong:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithTime_detectionGroupID_strong(
            this: Allocated<Self>,
            time: CMTime,
            detection_group_id: CNDetectionGroupID,
            is_strong: bool,
        ) -> Retained<Self>;

        #[cfg(feature = "objc2-core-media")]
        /// The first presentation time at which the subject should be in focus.
        /// The rack focus transition to the subject occurs prior to this time.
        #[unsafe(method(time))]
        #[unsafe(method_family = none)]
        pub unsafe fn time(&self) -> CMTime;

        #[cfg(feature = "CNDetection")]
        /// The detectionID of the detection to focus on if this is not a group decision.
        #[unsafe(method(detectionID))]
        #[unsafe(method_family = none)]
        pub unsafe fn detectionID(&self) -> CNDetectionID;

        #[cfg(feature = "CNDetection")]
        /// The detectionGroupID of the detection to focus on if this is a group decision.
        #[unsafe(method(detectionGroupID))]
        #[unsafe(method_family = none)]
        pub unsafe fn detectionGroupID(&self) -> CNDetectionGroupID;

        /// Whether this is a user-created decision, or a base decision.
        #[unsafe(method(isUserDecision))]
        #[unsafe(method_family = none)]
        pub unsafe fn isUserDecision(&self) -> bool;

        /// Whether this is a group decision or not.
        #[unsafe(method(isGroupDecision))]
        #[unsafe(method_family = none)]
        pub unsafe fn isGroupDecision(&self) -> bool;

        /// Whether this is a strong decision or not.
        /// A strong decision keeps focus for as long as possible.
        #[unsafe(method(isStrongDecision))]
        #[unsafe(method_family = none)]
        pub unsafe fn isStrongDecision(&self) -> bool;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}