objc2-intents 0.3.2

Bindings to the Intents framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/intents/instartcallcallcapabilityunsupportedreason?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct INStartCallCallCapabilityUnsupportedReason(pub NSInteger);
impl INStartCallCallCapabilityUnsupportedReason {
    #[doc(alias = "INStartCallCallCapabilityUnsupportedReasonVideoCallUnsupported")]
    pub const VideoCallUnsupported: Self = Self(1);
    #[doc(alias = "INStartCallCallCapabilityUnsupportedReasonMicrophoneNotAccessible")]
    pub const MicrophoneNotAccessible: Self = Self(2);
    #[doc(alias = "INStartCallCallCapabilityUnsupportedReasonCameraNotAccessible")]
    pub const CameraNotAccessible: Self = Self(3);
}

unsafe impl Encode for INStartCallCallCapabilityUnsupportedReason {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for INStartCallCallCapabilityUnsupportedReason {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/intents/instartcallcallcapabilityresolutionresult?language=objc)
    #[unsafe(super(INCallCapabilityResolutionResult, INIntentResolutionResult, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(
        feature = "INCallCapabilityResolutionResult",
        feature = "INIntentResolutionResult"
    ))]
    pub struct INStartCallCallCapabilityResolutionResult;
);

#[cfg(all(
    feature = "INCallCapabilityResolutionResult",
    feature = "INIntentResolutionResult"
))]
extern_conformance!(
    unsafe impl NSObjectProtocol for INStartCallCallCapabilityResolutionResult {}
);

#[cfg(all(
    feature = "INCallCapabilityResolutionResult",
    feature = "INIntentResolutionResult"
))]
impl INStartCallCallCapabilityResolutionResult {
    extern_methods!(
        #[unsafe(method(unsupportedForReason:))]
        #[unsafe(method_family = none)]
        pub unsafe fn unsupportedForReason(
            reason: INStartCallCallCapabilityUnsupportedReason,
        ) -> Retained<Self>;

        #[unsafe(method(initWithCallCapabilityResolutionResult:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCallCapabilityResolutionResult(
            this: Allocated<Self>,
            call_capability_resolution_result: &INCallCapabilityResolutionResult,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `INCallCapabilityResolutionResult`.
#[cfg(all(
    feature = "INCallCapabilityResolutionResult",
    feature = "INIntentResolutionResult"
))]
impl INStartCallCallCapabilityResolutionResult {
    extern_methods!(
        #[cfg(feature = "INCallCapability")]
        #[unsafe(method(successWithResolvedCallCapability:))]
        #[unsafe(method_family = none)]
        pub unsafe fn successWithResolvedCallCapability(
            resolved_call_capability: INCallCapability,
        ) -> Retained<Self>;

        #[cfg(feature = "INCallCapability")]
        #[unsafe(method(confirmationRequiredWithCallCapabilityToConfirm:))]
        #[unsafe(method_family = none)]
        pub unsafe fn confirmationRequiredWithCallCapabilityToConfirm(
            call_capability_to_confirm: INCallCapability,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `INIntentResolutionResult`.
#[cfg(all(
    feature = "INCallCapabilityResolutionResult",
    feature = "INIntentResolutionResult"
))]
impl INStartCallCallCapabilityResolutionResult {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

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

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

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

/// Methods declared on superclass `NSObject`.
#[cfg(all(
    feature = "INCallCapabilityResolutionResult",
    feature = "INIntentResolutionResult"
))]
impl INStartCallCallCapabilityResolutionResult {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}