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::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;

use crate::*;

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

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

impl TVTopShelfContentProvider {
    extern_methods!(
        #[cfg(all(feature = "TVTopShelfContent", feature = "block2"))]
        /// Load Top Shelf content.
        ///
        /// If the completion handler is not called in a timely manner or is called with empty content the system will display the static image instead.
        ///
        /// - parameter completionHandler: You must call this handler and should do so as soon as possible. The handler can be called on any queue.
        #[unsafe(method(loadTopShelfContentWithCompletionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn loadTopShelfContentWithCompletionHandler(
            &self,
            completion_handler: &block2::DynBlock<
                dyn Fn(*mut ProtocolObject<dyn TVTopShelfContent>),
            >,
        );

        /// Can be called from an application or extension to tell the system that your Top Shelf content has changed.
        #[unsafe(method(topShelfContentDidChange))]
        #[unsafe(method_family = none)]
        pub unsafe fn topShelfContentDidChange();
    );
}

/// Methods declared on superclass `NSObject`.
impl TVTopShelfContentProvider {
    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>;
    );
}