objc2-tv-services 0.3.2

Bindings to the TVServices 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::*;

/// The style of the carousel content.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/tvservices/tvtopshelfcarouselcontentstyle?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct TVTopShelfCarouselContentStyle(pub NSInteger);
impl TVTopShelfCarouselContentStyle {
    /// Carousel content that shows action buttons.
    #[doc(alias = "TVTopShelfCarouselContentStyleActions")]
    pub const Actions: Self = Self(0);
    /// Carousel content that shows action buttons and details about the item.
    #[doc(alias = "TVTopShelfCarouselContentStyleDetails")]
    pub const Details: Self = Self(1);
}

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

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

extern_class!(
    /// An object that represents carousel content.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/tvservices/tvtopshelfcarouselcontent?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct TVTopShelfCarouselContent;
);

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

#[cfg(feature = "TVTopShelfContent")]
extern_conformance!(
    unsafe impl TVTopShelfContent for TVTopShelfCarouselContent {}
);

impl TVTopShelfCarouselContent {
    extern_methods!(
        /// The content's style.
        #[unsafe(method(style))]
        #[unsafe(method_family = none)]
        pub unsafe fn style(&self) -> TVTopShelfCarouselContentStyle;

        #[cfg(all(
            feature = "TVTopShelfCarouselItem",
            feature = "TVTopShelfItem",
            feature = "TVTopShelfObject"
        ))]
        /// The content's items.
        #[unsafe(method(items))]
        #[unsafe(method_family = none)]
        pub unsafe fn items(&self) -> Retained<NSArray<TVTopShelfCarouselItem>>;

        #[cfg(all(
            feature = "TVTopShelfCarouselItem",
            feature = "TVTopShelfItem",
            feature = "TVTopShelfObject"
        ))]
        /// Create a content with the given style and items.
        #[unsafe(method(initWithStyle:items:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithStyle_items(
            this: Allocated<Self>,
            style: TVTopShelfCarouselContentStyle,
            items: &NSArray<TVTopShelfCarouselItem>,
        ) -> Retained<Self>;

        #[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>;
    );
}