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::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

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

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

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

impl TVTopShelfSectionedContent {
    extern_methods!(
        #[cfg(all(
            feature = "TVTopShelfItem",
            feature = "TVTopShelfItemCollection",
            feature = "TVTopShelfObject",
            feature = "TVTopShelfSectionedItem"
        ))]
        /// The content's sections.
        #[unsafe(method(sections))]
        #[unsafe(method_family = none)]
        pub unsafe fn sections(
            &self,
        ) -> Retained<NSArray<TVTopShelfItemCollection<TVTopShelfSectionedItem>>>;

        #[cfg(all(
            feature = "TVTopShelfItem",
            feature = "TVTopShelfItemCollection",
            feature = "TVTopShelfObject",
            feature = "TVTopShelfSectionedItem"
        ))]
        /// Create a content with the given sections.
        #[unsafe(method(initWithSections:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithSections(
            this: Allocated<Self>,
            sections: &NSArray<TVTopShelfItemCollection<TVTopShelfSectionedItem>>,
        ) -> Retained<Self>;

        #[cfg(all(feature = "TVTopShelfSectionedItem", feature = "objc2-core-foundation"))]
        /// Get image size for the given shape.
        #[unsafe(method(imageSizeForImageShape:))]
        #[unsafe(method_family = none)]
        pub unsafe fn imageSizeForImageShape(shape: TVTopShelfSectionedItemImageShape) -> CGSize;

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