use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MPRemoteCommandHandlerStatus(pub NSInteger);
impl MPRemoteCommandHandlerStatus {
#[doc(alias = "MPRemoteCommandHandlerStatusSuccess")]
pub const Success: Self = Self(0);
#[doc(alias = "MPRemoteCommandHandlerStatusNoSuchContent")]
pub const NoSuchContent: Self = Self(100);
#[doc(alias = "MPRemoteCommandHandlerStatusNoActionableNowPlayingItem")]
pub const NoActionableNowPlayingItem: Self = Self(110);
#[doc(alias = "MPRemoteCommandHandlerStatusDeviceNotFound")]
pub const DeviceNotFound: Self = Self(120);
#[doc(alias = "MPRemoteCommandHandlerStatusCommandFailed")]
pub const CommandFailed: Self = Self(200);
}
unsafe impl Encode for MPRemoteCommandHandlerStatus {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for MPRemoteCommandHandlerStatus {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MPRemoteCommand;
);
extern_conformance!(
unsafe impl NSObjectProtocol for MPRemoteCommand {}
);
impl MPRemoteCommand {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(isEnabled))]
#[unsafe(method_family = none)]
pub unsafe fn isEnabled(&self) -> bool;
#[unsafe(method(setEnabled:))]
#[unsafe(method_family = none)]
pub unsafe fn setEnabled(&self, enabled: bool);
#[unsafe(method(addTarget:action:))]
#[unsafe(method_family = none)]
pub unsafe fn addTarget_action(&self, target: &AnyObject, action: Sel);
#[unsafe(method(removeTarget:action:))]
#[unsafe(method_family = none)]
pub unsafe fn removeTarget_action(&self, target: &AnyObject, action: Option<Sel>);
#[unsafe(method(removeTarget:))]
#[unsafe(method_family = none)]
pub unsafe fn removeTarget(&self, target: Option<&AnyObject>);
#[cfg(all(feature = "MPRemoteCommandEvent", feature = "block2"))]
#[unsafe(method(addTargetWithHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn addTargetWithHandler(
&self,
handler: &block2::DynBlock<
dyn Fn(NonNull<MPRemoteCommandEvent>) -> MPRemoteCommandHandlerStatus,
>,
) -> Retained<AnyObject>;
);
}
extern_class!(
#[unsafe(super(MPRemoteCommand, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MPSkipIntervalCommand;
);
extern_conformance!(
unsafe impl NSObjectProtocol for MPSkipIntervalCommand {}
);
impl MPSkipIntervalCommand {
extern_methods!(
#[unsafe(method(preferredIntervals))]
#[unsafe(method_family = none)]
pub unsafe fn preferredIntervals(&self) -> Retained<NSArray<NSNumber>>;
#[unsafe(method(setPreferredIntervals:))]
#[unsafe(method_family = none)]
pub unsafe fn setPreferredIntervals(&self, preferred_intervals: &NSArray<NSNumber>);
);
}
impl MPSkipIntervalCommand {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(MPRemoteCommand, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MPFeedbackCommand;
);
extern_conformance!(
unsafe impl NSObjectProtocol for MPFeedbackCommand {}
);
impl MPFeedbackCommand {
extern_methods!(
#[unsafe(method(isActive))]
#[unsafe(method_family = none)]
pub unsafe fn isActive(&self) -> bool;
#[unsafe(method(setActive:))]
#[unsafe(method_family = none)]
pub unsafe fn setActive(&self, active: bool);
#[unsafe(method(localizedTitle))]
#[unsafe(method_family = none)]
pub unsafe fn localizedTitle(&self) -> Retained<NSString>;
#[unsafe(method(setLocalizedTitle:))]
#[unsafe(method_family = none)]
pub unsafe fn setLocalizedTitle(&self, localized_title: &NSString);
#[unsafe(method(localizedShortTitle))]
#[unsafe(method_family = none)]
pub unsafe fn localizedShortTitle(&self) -> Retained<NSString>;
#[unsafe(method(setLocalizedShortTitle:))]
#[unsafe(method_family = none)]
pub unsafe fn setLocalizedShortTitle(&self, localized_short_title: &NSString);
);
}
impl MPFeedbackCommand {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(MPRemoteCommand, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MPRatingCommand;
);
extern_conformance!(
unsafe impl NSObjectProtocol for MPRatingCommand {}
);
impl MPRatingCommand {
extern_methods!(
#[unsafe(method(minimumRating))]
#[unsafe(method_family = none)]
pub unsafe fn minimumRating(&self) -> c_float;
#[unsafe(method(setMinimumRating:))]
#[unsafe(method_family = none)]
pub unsafe fn setMinimumRating(&self, minimum_rating: c_float);
#[unsafe(method(maximumRating))]
#[unsafe(method_family = none)]
pub unsafe fn maximumRating(&self) -> c_float;
#[unsafe(method(setMaximumRating:))]
#[unsafe(method_family = none)]
pub unsafe fn setMaximumRating(&self, maximum_rating: c_float);
);
}
impl MPRatingCommand {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(MPRemoteCommand, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MPChangePlaybackRateCommand;
);
extern_conformance!(
unsafe impl NSObjectProtocol for MPChangePlaybackRateCommand {}
);
impl MPChangePlaybackRateCommand {
extern_methods!(
#[unsafe(method(supportedPlaybackRates))]
#[unsafe(method_family = none)]
pub unsafe fn supportedPlaybackRates(&self) -> Retained<NSArray<NSNumber>>;
#[unsafe(method(setSupportedPlaybackRates:))]
#[unsafe(method_family = none)]
pub unsafe fn setSupportedPlaybackRates(
&self,
supported_playback_rates: &NSArray<NSNumber>,
);
);
}
impl MPChangePlaybackRateCommand {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(MPRemoteCommand, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MPChangePlaybackPositionCommand;
);
extern_conformance!(
unsafe impl NSObjectProtocol for MPChangePlaybackPositionCommand {}
);
impl MPChangePlaybackPositionCommand {
extern_methods!();
}
impl MPChangePlaybackPositionCommand {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(MPRemoteCommand, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MPChangeShuffleModeCommand;
);
extern_conformance!(
unsafe impl NSObjectProtocol for MPChangeShuffleModeCommand {}
);
impl MPChangeShuffleModeCommand {
extern_methods!(
#[cfg(feature = "MPRemoteControlTypes")]
#[unsafe(method(currentShuffleType))]
#[unsafe(method_family = none)]
pub unsafe fn currentShuffleType(&self) -> MPShuffleType;
#[cfg(feature = "MPRemoteControlTypes")]
#[unsafe(method(setCurrentShuffleType:))]
#[unsafe(method_family = none)]
pub unsafe fn setCurrentShuffleType(&self, current_shuffle_type: MPShuffleType);
);
}
impl MPChangeShuffleModeCommand {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(MPRemoteCommand, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MPChangeRepeatModeCommand;
);
extern_conformance!(
unsafe impl NSObjectProtocol for MPChangeRepeatModeCommand {}
);
impl MPChangeRepeatModeCommand {
extern_methods!(
#[cfg(feature = "MPRemoteControlTypes")]
#[unsafe(method(currentRepeatType))]
#[unsafe(method_family = none)]
pub unsafe fn currentRepeatType(&self) -> MPRepeatType;
#[cfg(feature = "MPRemoteControlTypes")]
#[unsafe(method(setCurrentRepeatType:))]
#[unsafe(method_family = none)]
pub unsafe fn setCurrentRepeatType(&self, current_repeat_type: MPRepeatType);
);
}
impl MPChangeRepeatModeCommand {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}