objc2-watch-kit 0.3.2

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

use crate::*;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkaudiofileplayeritemtimejumpednotification?language=objc)
    #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
    pub static WKAudioFilePlayerItemTimeJumpedNotification: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkaudiofileplayeritemdidplaytoendtimenotification?language=objc)
    #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
    pub static WKAudioFilePlayerItemDidPlayToEndTimeNotification: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkaudiofileplayeritemfailedtoplaytoendtimenotification?language=objc)
    #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
    pub static WKAudioFilePlayerItemFailedToPlayToEndTimeNotification: &'static NSString;
}

/// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkaudiofileplayeritemstatus?language=objc)
// NS_ENUM
#[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct WKAudioFilePlayerItemStatus(pub NSInteger);
impl WKAudioFilePlayerItemStatus {
    #[doc(alias = "WKAudioFilePlayerItemStatusUnknown")]
    #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
    pub const Unknown: Self = Self(0);
    #[doc(alias = "WKAudioFilePlayerItemStatusReadyToPlay")]
    #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
    pub const ReadyToPlay: Self = Self(1);
    #[doc(alias = "WKAudioFilePlayerItemStatusFailed")]
    #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
    pub const Failed: Self = Self(2);
}

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

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

extern_class!(
    /// WatchKit corollary to AVFoundation AVPlayer class
    ///
    ///
    /// This class provides the functionality of AVPlayer for Watch OS apps. Only file-based assets are allowed.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkaudiofileplayeritem?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
    pub struct WKAudioFilePlayerItem;
);

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

impl WKAudioFilePlayerItem {
    extern_methods!(
        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "WKAudioFileAsset")]
        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
        #[unsafe(method(playerItemWithAsset:))]
        #[unsafe(method_family = none)]
        pub unsafe fn playerItemWithAsset(
            asset: &WKAudioFileAsset,
        ) -> Retained<WKAudioFilePlayerItem>;

        #[cfg(feature = "WKAudioFileAsset")]
        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
        #[unsafe(method(asset))]
        #[unsafe(method_family = none)]
        pub unsafe fn asset(&self) -> Retained<WKAudioFileAsset>;

        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
        #[unsafe(method(status))]
        #[unsafe(method_family = none)]
        pub unsafe fn status(&self) -> WKAudioFilePlayerItemStatus;

        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
        #[unsafe(method(error))]
        #[unsafe(method_family = none)]
        pub unsafe fn error(&self) -> Option<Retained<NSError>>;

        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
        #[unsafe(method(currentTime))]
        #[unsafe(method_family = none)]
        pub unsafe fn currentTime(&self) -> NSTimeInterval;

        #[deprecated = "Use AVFoundation's AVPlayer and AVQueuePlayer instead"]
        #[unsafe(method(setCurrentTime:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCurrentTime(&self, current_time: NSTimeInterval);
    );
}

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