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::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/intents/inplaymediaplaybackspeedunsupportedreason?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct INPlayMediaPlaybackSpeedUnsupportedReason(pub NSInteger);
impl INPlayMediaPlaybackSpeedUnsupportedReason {
    #[doc(alias = "INPlayMediaPlaybackSpeedUnsupportedReasonBelowMinimum")]
    pub const BelowMinimum: Self = Self(1);
    #[doc(alias = "INPlayMediaPlaybackSpeedUnsupportedReasonAboveMaximum")]
    pub const AboveMaximum: Self = Self(2);
}

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

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

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

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

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

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

/// Methods declared on superclass `INDoubleResolutionResult`.
#[cfg(all(
    feature = "INDoubleResolutionResult",
    feature = "INIntentResolutionResult"
))]
impl INPlayMediaPlaybackSpeedResolutionResult {
    extern_methods!(
        #[unsafe(method(successWithResolvedValue:))]
        #[unsafe(method_family = none)]
        pub unsafe fn successWithResolvedValue(resolved_value: c_double) -> Retained<Self>;

        #[unsafe(method(confirmationRequiredWithValueToConfirm:))]
        #[unsafe(method_family = none)]
        pub unsafe fn confirmationRequiredWithValueToConfirm(
            value_to_confirm: Option<&NSNumber>,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `INIntentResolutionResult`.
#[cfg(all(
    feature = "INDoubleResolutionResult",
    feature = "INIntentResolutionResult"
))]
impl INPlayMediaPlaybackSpeedResolutionResult {
    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 = "INDoubleResolutionResult",
    feature = "INIntentResolutionResult"
))]
impl INPlayMediaPlaybackSpeedResolutionResult {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}