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 objc2_foundation::*;

use crate::*;

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

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

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

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

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

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

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

/// Methods declared on superclass `INMediaDestinationResolutionResult`.
#[cfg(all(
    feature = "INIntentResolutionResult",
    feature = "INMediaDestinationResolutionResult"
))]
impl INAddMediaMediaDestinationResolutionResult {
    extern_methods!(
        #[cfg(feature = "INMediaDestination")]
        #[unsafe(method(successWithResolvedMediaDestination:))]
        #[unsafe(method_family = none)]
        pub unsafe fn successWithResolvedMediaDestination(
            resolved_media_destination: &INMediaDestination,
        ) -> Retained<Self>;

        #[cfg(feature = "INMediaDestination")]
        #[unsafe(method(disambiguationWithMediaDestinationsToDisambiguate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn disambiguationWithMediaDestinationsToDisambiguate(
            media_destinations_to_disambiguate: &NSArray<INMediaDestination>,
        ) -> Retained<Self>;

        #[cfg(feature = "INMediaDestination")]
        #[unsafe(method(confirmationRequiredWithMediaDestinationToConfirm:))]
        #[unsafe(method_family = none)]
        pub unsafe fn confirmationRequiredWithMediaDestinationToConfirm(
            media_destination_to_confirm: Option<&INMediaDestination>,
        ) -> Retained<Self>;
    );
}

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