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/inupcomingmediapredictionmode?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct INUpcomingMediaPredictionMode(pub NSInteger);
impl INUpcomingMediaPredictionMode {
    #[doc(alias = "INUpcomingMediaPredictionModeDefault")]
    pub const Default: Self = Self(0);
    #[doc(alias = "INUpcomingMediaPredictionModeOnlyPredictSuggestedIntents")]
    pub const OnlyPredictSuggestedIntents: Self = Self(1);
}

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

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

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/intents/inupcomingmediamanager?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct INUpcomingMediaManager;
);

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

impl INUpcomingMediaManager {
    extern_methods!(
        #[unsafe(method(sharedManager))]
        #[unsafe(method_family = none)]
        pub unsafe fn sharedManager() -> Retained<INUpcomingMediaManager>;

        #[cfg(all(feature = "INIntent", feature = "INPlayMediaIntent"))]
        #[unsafe(method(setSuggestedMediaIntents:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSuggestedMediaIntents(&self, intents: &NSOrderedSet<INPlayMediaIntent>);

        #[cfg(feature = "INMediaItemType")]
        #[unsafe(method(setPredictionMode:forType:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPredictionMode_forType(
            &self,
            mode: INUpcomingMediaPredictionMode,
            r#type: INMediaItemType,
        );
    );
}

/// Methods declared on superclass `NSObject`.
impl INUpcomingMediaManager {
    extern_methods!(
        #[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>;
    );
}