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 HKStateOfMindValenceClassification(pub NSInteger);
impl HKStateOfMindValenceClassification {
#[doc(alias = "HKStateOfMindValenceClassificationVeryUnpleasant")]
pub const VeryUnpleasant: Self = Self(1);
#[doc(alias = "HKStateOfMindValenceClassificationUnpleasant")]
pub const Unpleasant: Self = Self(2);
#[doc(alias = "HKStateOfMindValenceClassificationSlightlyUnpleasant")]
pub const SlightlyUnpleasant: Self = Self(3);
#[doc(alias = "HKStateOfMindValenceClassificationNeutral")]
pub const Neutral: Self = Self(4);
#[doc(alias = "HKStateOfMindValenceClassificationSlightlyPleasant")]
pub const SlightlyPleasant: Self = Self(5);
#[doc(alias = "HKStateOfMindValenceClassificationPleasant")]
pub const Pleasant: Self = Self(6);
#[doc(alias = "HKStateOfMindValenceClassificationVeryPleasant")]
pub const VeryPleasant: Self = Self(7);
}
unsafe impl Encode for HKStateOfMindValenceClassification {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for HKStateOfMindValenceClassification {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
impl HKStateOfMindValenceClassification {
#[doc(alias = "HKStateOfMindValenceClassificationForValence")]
#[inline]
pub unsafe fn for_valence(valence: c_double) -> Option<Retained<NSNumber>> {
extern "C-unwind" {
fn HKStateOfMindValenceClassificationForValence(valence: c_double) -> *mut NSNumber;
}
let ret = unsafe { HKStateOfMindValenceClassificationForValence(valence) };
unsafe { Retained::retain_autoreleased(ret) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct HKStateOfMindLabel(pub NSInteger);
impl HKStateOfMindLabel {
#[doc(alias = "HKStateOfMindLabelAmazed")]
pub const Amazed: Self = Self(1);
#[doc(alias = "HKStateOfMindLabelAmused")]
pub const Amused: Self = Self(2);
#[doc(alias = "HKStateOfMindLabelAngry")]
pub const Angry: Self = Self(3);
#[doc(alias = "HKStateOfMindLabelAnxious")]
pub const Anxious: Self = Self(4);
#[doc(alias = "HKStateOfMindLabelAshamed")]
pub const Ashamed: Self = Self(5);
#[doc(alias = "HKStateOfMindLabelBrave")]
pub const Brave: Self = Self(6);
#[doc(alias = "HKStateOfMindLabelCalm")]
pub const Calm: Self = Self(7);
#[doc(alias = "HKStateOfMindLabelContent")]
pub const Content: Self = Self(8);
#[doc(alias = "HKStateOfMindLabelDisappointed")]
pub const Disappointed: Self = Self(9);
#[doc(alias = "HKStateOfMindLabelDiscouraged")]
pub const Discouraged: Self = Self(10);
#[doc(alias = "HKStateOfMindLabelDisgusted")]
pub const Disgusted: Self = Self(11);
#[doc(alias = "HKStateOfMindLabelEmbarrassed")]
pub const Embarrassed: Self = Self(12);
#[doc(alias = "HKStateOfMindLabelExcited")]
pub const Excited: Self = Self(13);
#[doc(alias = "HKStateOfMindLabelFrustrated")]
pub const Frustrated: Self = Self(14);
#[doc(alias = "HKStateOfMindLabelGrateful")]
pub const Grateful: Self = Self(15);
#[doc(alias = "HKStateOfMindLabelGuilty")]
pub const Guilty: Self = Self(16);
#[doc(alias = "HKStateOfMindLabelHappy")]
pub const Happy: Self = Self(17);
#[doc(alias = "HKStateOfMindLabelHopeless")]
pub const Hopeless: Self = Self(18);
#[doc(alias = "HKStateOfMindLabelIrritated")]
pub const Irritated: Self = Self(19);
#[doc(alias = "HKStateOfMindLabelJealous")]
pub const Jealous: Self = Self(20);
#[doc(alias = "HKStateOfMindLabelJoyful")]
pub const Joyful: Self = Self(21);
#[doc(alias = "HKStateOfMindLabelLonely")]
pub const Lonely: Self = Self(22);
#[doc(alias = "HKStateOfMindLabelPassionate")]
pub const Passionate: Self = Self(23);
#[doc(alias = "HKStateOfMindLabelPeaceful")]
pub const Peaceful: Self = Self(24);
#[doc(alias = "HKStateOfMindLabelProud")]
pub const Proud: Self = Self(25);
#[doc(alias = "HKStateOfMindLabelRelieved")]
pub const Relieved: Self = Self(26);
#[doc(alias = "HKStateOfMindLabelSad")]
pub const Sad: Self = Self(27);
#[doc(alias = "HKStateOfMindLabelScared")]
pub const Scared: Self = Self(28);
#[doc(alias = "HKStateOfMindLabelStressed")]
pub const Stressed: Self = Self(29);
#[doc(alias = "HKStateOfMindLabelSurprised")]
pub const Surprised: Self = Self(30);
#[doc(alias = "HKStateOfMindLabelWorried")]
pub const Worried: Self = Self(31);
#[doc(alias = "HKStateOfMindLabelAnnoyed")]
pub const Annoyed: Self = Self(32);
#[doc(alias = "HKStateOfMindLabelConfident")]
pub const Confident: Self = Self(33);
#[doc(alias = "HKStateOfMindLabelDrained")]
pub const Drained: Self = Self(34);
#[doc(alias = "HKStateOfMindLabelHopeful")]
pub const Hopeful: Self = Self(35);
#[doc(alias = "HKStateOfMindLabelIndifferent")]
pub const Indifferent: Self = Self(36);
#[doc(alias = "HKStateOfMindLabelOverwhelmed")]
pub const Overwhelmed: Self = Self(37);
#[doc(alias = "HKStateOfMindLabelSatisfied")]
pub const Satisfied: Self = Self(38);
}
unsafe impl Encode for HKStateOfMindLabel {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for HKStateOfMindLabel {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct HKStateOfMindAssociation(pub NSInteger);
impl HKStateOfMindAssociation {
#[doc(alias = "HKStateOfMindAssociationCommunity")]
pub const Community: Self = Self(1);
#[doc(alias = "HKStateOfMindAssociationCurrentEvents")]
pub const CurrentEvents: Self = Self(2);
#[doc(alias = "HKStateOfMindAssociationDating")]
pub const Dating: Self = Self(3);
#[doc(alias = "HKStateOfMindAssociationEducation")]
pub const Education: Self = Self(4);
#[doc(alias = "HKStateOfMindAssociationFamily")]
pub const Family: Self = Self(5);
#[doc(alias = "HKStateOfMindAssociationFitness")]
pub const Fitness: Self = Self(6);
#[doc(alias = "HKStateOfMindAssociationFriends")]
pub const Friends: Self = Self(7);
#[doc(alias = "HKStateOfMindAssociationHealth")]
pub const Health: Self = Self(8);
#[doc(alias = "HKStateOfMindAssociationHobbies")]
pub const Hobbies: Self = Self(9);
#[doc(alias = "HKStateOfMindAssociationIdentity")]
pub const Identity: Self = Self(10);
#[doc(alias = "HKStateOfMindAssociationMoney")]
pub const Money: Self = Self(11);
#[doc(alias = "HKStateOfMindAssociationPartner")]
pub const Partner: Self = Self(12);
#[doc(alias = "HKStateOfMindAssociationSelfCare")]
pub const SelfCare: Self = Self(13);
#[doc(alias = "HKStateOfMindAssociationSpirituality")]
pub const Spirituality: Self = Self(14);
#[doc(alias = "HKStateOfMindAssociationTasks")]
pub const Tasks: Self = Self(15);
#[doc(alias = "HKStateOfMindAssociationTravel")]
pub const Travel: Self = Self(16);
#[doc(alias = "HKStateOfMindAssociationWork")]
pub const Work: Self = Self(17);
#[doc(alias = "HKStateOfMindAssociationWeather")]
pub const Weather: Self = Self(18);
}
unsafe impl Encode for HKStateOfMindAssociation {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for HKStateOfMindAssociation {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct HKStateOfMindKind(pub NSInteger);
impl HKStateOfMindKind {
#[doc(alias = "HKStateOfMindKindMomentaryEmotion")]
pub const MomentaryEmotion: Self = Self(1);
#[doc(alias = "HKStateOfMindKindDailyMood")]
pub const DailyMood: Self = Self(2);
}
unsafe impl Encode for HKStateOfMindKind {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for HKStateOfMindKind {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(HKSample, HKObject, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
pub struct HKStateOfMind;
);
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
unsafe impl Send for HKStateOfMind {}
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
unsafe impl Sync for HKStateOfMind {}
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
extern_conformance!(
unsafe impl NSCoding for HKStateOfMind {}
);
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
extern_conformance!(
unsafe impl NSCopying for HKStateOfMind {}
);
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
unsafe impl CopyingHelper for HKStateOfMind {
type Result = Self;
}
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
extern_conformance!(
unsafe impl NSObjectProtocol for HKStateOfMind {}
);
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
extern_conformance!(
unsafe impl NSSecureCoding for HKStateOfMind {}
);
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
impl HKStateOfMind {
extern_methods!(
#[unsafe(method(kind))]
#[unsafe(method_family = none)]
pub unsafe fn kind(&self) -> HKStateOfMindKind;
#[unsafe(method(valence))]
#[unsafe(method_family = none)]
pub unsafe fn valence(&self) -> c_double;
#[unsafe(method(valenceClassification))]
#[unsafe(method_family = none)]
pub unsafe fn valenceClassification(&self) -> HKStateOfMindValenceClassification;
#[unsafe(method(labels))]
#[unsafe(method_family = none)]
pub unsafe fn labels(&self) -> Retained<NSArray<NSNumber>>;
#[unsafe(method(associations))]
#[unsafe(method_family = none)]
pub unsafe fn associations(&self) -> Retained<NSArray<NSNumber>>;
#[unsafe(method(stateOfMindWithDate:kind:valence:labels:associations:))]
#[unsafe(method_family = none)]
pub unsafe fn stateOfMindWithDate_kind_valence_labels_associations(
date: &NSDate,
kind: HKStateOfMindKind,
valence: c_double,
labels: &NSArray<NSNumber>,
associations: &NSArray<NSNumber>,
) -> Retained<Self>;
#[unsafe(method(stateOfMindWithDate:kind:valence:labels:associations:metadata:))]
#[unsafe(method_family = none)]
pub unsafe fn stateOfMindWithDate_kind_valence_labels_associations_metadata(
date: &NSDate,
kind: HKStateOfMindKind,
valence: c_double,
labels: &NSArray<NSNumber>,
associations: &NSArray<NSNumber>,
metadata: Option<&NSDictionary<NSString, AnyObject>>,
) -> Retained<Self>;
#[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>;
);
}
#[deprecated = "renamed to `HKStateOfMindValenceClassification::for_valence`"]
#[inline]
pub unsafe extern "C-unwind" fn HKStateOfMindValenceClassificationForValence(
valence: c_double,
) -> Option<Retained<NSNumber>> {
extern "C-unwind" {
fn HKStateOfMindValenceClassificationForValence(valence: c_double) -> *mut NSNumber;
}
let ret = unsafe { HKStateOfMindValenceClassificationForValence(valence) };
unsafe { Retained::retain_autoreleased(ret) }
}