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

extern_class!(
    /// Represents unique identifiers for TVContentItems.
    ///
    /// A content identifier is represented by a string, with an optional
    /// hierarchical structure of other content identifiers. A content identifier
    /// should be unique to a particular Content Item, across ALL past, current,
    /// and future content items. A content identifier should be durable: it
    /// should be able to be saved by itself, and an item should be able to be
    /// identified by it, unambiguously, in the future (though the user may not
    /// have access to that item). The uniqueness of a content identifier comes
    /// from the uniqueness of its two parts: its identifier string and its
    /// container (another content identifier). The identifier property of
    /// content identifiers need not be univerally unique across all the app's
    /// content identifiers, if items have container properties which are
    /// themselves unique. However, developers should then be careful to not
    /// be confused by equal identifier strings in content identifiers with
    /// different container hierarchies.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/tvservices/tvcontentidentifier?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated = "TVContentIdentifier has been replaced by TVTopShelfContentProvider"]
    pub struct TVContentIdentifier;
);

extern_conformance!(
    unsafe impl NSCoding for TVContentIdentifier {}
);

extern_conformance!(
    unsafe impl NSCopying for TVContentIdentifier {}
);

unsafe impl CopyingHelper for TVContentIdentifier {
    type Result = Self;
}

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

extern_conformance!(
    unsafe impl NSSecureCoding for TVContentIdentifier {}
);

impl TVContentIdentifier {
    extern_methods!(
        /// The string contents of this identifier.
        ///
        /// Any internal format or structure within the string is up to the application.
        #[deprecated = "TVContentIdentifier has been replaced by TVTopShelfContentProvider"]
        #[unsafe(method(identifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn identifier(&self) -> Retained<NSString>;

        /// Optional content identifier for the next level up in the logical structure
        /// which this content identifier is identifying a part of.
        ///
        /// Typically this would be the content identifier for the next larger grouping
        /// that the content, identified by this content identifier, is part of. For
        /// example, a podcast episode could be part of a larger podcast season, which
        /// would be part of the entire podcast series; all three of those layers –
        /// episodes, seasons, and the series – would need their own unique identifiers.
        #[deprecated = "TVContentIdentifier has been replaced by TVTopShelfContentProvider"]
        #[unsafe(method(container))]
        #[unsafe(method_family = none)]
        pub unsafe fn container(&self) -> Option<Retained<TVContentIdentifier>>;

        #[deprecated = "TVContentIdentifier has been replaced by TVTopShelfContentProvider"]
        #[unsafe(method(initWithIdentifier:container:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithIdentifier_container(
            this: Allocated<Self>,
            identifier: &NSString,
            container: Option<&TVContentIdentifier>,
        ) -> Retained<Self>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[deprecated = "TVContentIdentifier has been replaced by TVTopShelfContentProvider"]
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;

        #[deprecated = "TVContentIdentifier has been replaced by TVTopShelfContentProvider"]
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Option<Retained<Self>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl TVContentIdentifier {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}