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

/// [Apple's documentation](https://developer.apple.com/documentation/tvservices/tvtopshelfcontentstyle?language=objc)
// NS_ENUM
#[deprecated = "TVTopShelfProvider has been replaced by TVTopShelfContent"]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct TVTopShelfContentStyle(pub NSInteger);
impl TVTopShelfContentStyle {
    #[doc(alias = "TVTopShelfContentStyleInset")]
    #[deprecated = "TVTopShelfProvider has been replaced by TVTopShelfContent"]
    pub const Inset: Self = Self(1);
    #[doc(alias = "TVTopShelfContentStyleSectioned")]
    #[deprecated = "TVTopShelfProvider has been replaced by TVTopShelfContent"]
    pub const Sectioned: Self = Self(2);
}

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

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

extern_protocol!(
    /// A protocol implemented by applications to provided items for
    /// display in the main menu's top shelf of an Apple TV.
    ///
    /// This is a protocol which can be adopted by an app's TV Services
    /// extension, on the principal class of the extension.
    /// Apps which want to provide dynamic content to the top shelf,
    /// rather than have the system use the static image submitted with
    /// the application, implement a TV Services extension and adopt
    /// this protocol. The various supported user interface styles
    /// for the display of the content items are given by the
    /// TVTopShelfContentStyle enumeration.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/tvservices/tvtopshelfprovider?language=objc)
    #[deprecated = "TVTopShelfProvider has been replaced by TVTopShelfContentProvider"]
    pub unsafe trait TVTopShelfProvider {
        #[deprecated = "TVTopShelfProvider has been replaced by TVTopShelfContentProvider"]
        #[unsafe(method(topShelfStyle))]
        #[unsafe(method_family = none)]
        unsafe fn topShelfStyle(&self) -> TVTopShelfContentStyle;

        #[cfg(feature = "TVContentItem")]
        #[deprecated = "TVTopShelfProvider has been replaced by TVTopShelfContentProvider"]
        #[unsafe(method(topShelfItems))]
        #[unsafe(method_family = none)]
        unsafe fn topShelfItems(&self) -> Retained<NSArray<TVContentItem>>;
    }
);

extern "C" {
    /// The name of a notification the extension or containing app can
    /// post to tell observers within the process, and the system, that
    /// the Top Shelf data has changed.
    ///
    /// Post the notification to the process-local NSNotificationCenter
    /// ([NSNotificationCenter defaultCenter]). The system doesn't care about
    /// the object or userInfo of the notification. The system will refetch
    /// the data from the extension, at some point in the future (not
    /// necessarily right away).
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/tvservices/tvtopshelfitemsdidchangenotification?language=objc)
    #[deprecated = "TVTopShelfItemsDidChangeNotification has been replaced by [TVTopShelfContentProvider topShelfContentDidChange]"]
    pub static TVTopShelfItemsDidChangeNotification: &'static NSString;
}

extern "C-unwind" {
    /// Returns the ideal size of an image, the size which doesn't require
    /// scaling, for the given user interface style and image shape, in the
    /// current running version of the OS.
    ///
    /// For shapes not supported in the given style, returns CGSizeZero.
    #[cfg(all(feature = "TVContentItem", feature = "objc2-core-foundation"))]
    #[deprecated = "TVTopShelfImageSizeForShape has been replaced by [TVTopShelfSectionedContent imageSizeForImageShape:] and [TVTopShelfInsetContent imageSize]"]
    pub fn TVTopShelfImageSizeForShape(
        shape: TVContentItemImageShape,
        style: TVTopShelfContentStyle,
    ) -> CGSize;
}