objc2_media_accessibility/generated/
MAMusicHaptics.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5#[cfg(feature = "objc2")]
6use objc2::__framework_prelude::*;
7#[cfg(feature = "objc2-foundation")]
8use objc2_foundation::*;
9
10use crate::*;
11
12extern "C" {
13    /// [Apple's documentation](https://developer.apple.com/documentation/mediaaccessibility/mamusichapticsmanageractivestatusdidchangenotification?language=objc)
14    #[cfg(feature = "objc2-foundation")]
15    pub static MAMusicHapticsManagerActiveStatusDidChangeNotification: &'static NSNotificationName;
16}
17
18#[cfg(feature = "objc2")]
19extern_class!(
20    /// [Apple's documentation](https://developer.apple.com/documentation/mediaaccessibility/mamusichapticsmanager?language=objc)
21    #[unsafe(super(NSObject))]
22    #[derive(Debug, PartialEq, Eq, Hash)]
23    #[cfg(feature = "objc2")]
24    pub struct MAMusicHapticsManager;
25);
26
27#[cfg(feature = "objc2")]
28extern_conformance!(
29    unsafe impl NSObjectProtocol for MAMusicHapticsManager {}
30);
31
32#[cfg(feature = "objc2")]
33impl MAMusicHapticsManager {
34    extern_methods!(
35        #[unsafe(method(sharedManager))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn sharedManager() -> Retained<MAMusicHapticsManager>;
38
39        /// Whether the user setting to indicate Music Haptics are currently active.
40        ///
41        /// Returns: A boolean result.
42        #[unsafe(method(isActive))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn isActive(&self) -> bool;
45
46        #[cfg(all(feature = "block2", feature = "objc2-foundation"))]
47        /// In an asynchronous completion handler, returns whether a specific media track with the supplied
48        /// ISRC has an available haptic track.
49        ///
50        /// # Safety
51        ///
52        /// `completion_handler` block must be sendable.
53        #[unsafe(method(checkHapticTrackAvailabilityForMediaMatchingCode:completionHandler:))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn checkHapticTrackAvailabilityForMediaMatchingCode_completionHandler(
56            &self,
57            international_standard_recording_code: &NSString,
58            completion_handler: Option<&block2::DynBlock<dyn Fn(Bool)>>,
59        );
60
61        #[cfg(all(feature = "block2", feature = "objc2-foundation"))]
62        /// Determine the status of haptic playback for the now playing track asynchronously. This will only be delivered for the app that is the active Now Playing app.
63        #[unsafe(method(addStatusObserver:))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn addStatusObserver(
66            &self,
67            status_handler: &block2::DynBlock<dyn Fn(NonNull<NSString>, Bool)>,
68        ) -> Option<Retained<ProtocolObject<dyn NSCopying>>>;
69
70        #[cfg(feature = "objc2-foundation")]
71        /// # Safety
72        ///
73        /// `registration_token` should be of the correct type.
74        #[unsafe(method(removeStatusObserver:))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn removeStatusObserver(
77            &self,
78            registration_token: &ProtocolObject<dyn NSCopying>,
79        );
80
81        #[unsafe(method(init))]
82        #[unsafe(method_family = init)]
83        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
84
85        #[unsafe(method(new))]
86        #[unsafe(method_family = new)]
87        pub unsafe fn new() -> Retained<Self>;
88    );
89}