objc2-av-kit 0.3.2

Bindings to the AVKit 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_class!(
    /// Class used to define a user selectable playback speed in a playback UI.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/avkit/avplaybackspeed?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AVPlaybackSpeed;
);

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

impl AVPlaybackSpeed {
    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>;

        /// A list of playback speeds to be used by default across the system.
        #[unsafe(method(systemDefaultSpeeds))]
        #[unsafe(method_family = none)]
        pub unsafe fn systemDefaultSpeeds() -> Retained<NSArray<AVPlaybackSpeed>>;

        /// Parameter `rate`: The rate to be used when this playback speed is selected.
        ///
        /// Parameter `localizedName`: A localized name to be displayed representing this playback speed in a UI.
        ///
        /// Initializes an AVPlaybackSpeed.
        #[unsafe(method(initWithRate:localizedName:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithRate_localizedName(
            this: Allocated<Self>,
            rate: c_float,
            localized_name: &NSString,
        ) -> Retained<Self>;

        /// The rate associated with this object. When this playback speed is selected this rate will be set in response to the play button being pressed.
        #[unsafe(method(rate))]
        #[unsafe(method_family = none)]
        pub unsafe fn rate(&self) -> c_float;

        /// A localized name for this playback speed.
        ///
        /// This name will be used to represent this playback speed in playback UIs where more space is available.
        #[unsafe(method(localizedName))]
        #[unsafe(method_family = none)]
        pub unsafe fn localizedName(&self) -> Retained<NSString>;

        /// A localized name for this playback speed used when space is limited.
        ///
        /// This name will be used to represent this playback speed in playback UIs where limited space is available.
        #[unsafe(method(localizedNumericName))]
        #[unsafe(method_family = none)]
        pub unsafe fn localizedNumericName(&self) -> Retained<NSString>;
    );
}