objc2-health-kit 0.3.2

Bindings to the HealthKit 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!(
    /// An object that represents a summary of a user's activity for a given day.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkactivitysummary?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct HKActivitySummary;
);

extern_conformance!(
    unsafe impl NSCoding for HKActivitySummary {}
);

extern_conformance!(
    unsafe impl NSCopying for HKActivitySummary {}
);

unsafe impl CopyingHelper for HKActivitySummary {
    type Result = Self;
}

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

extern_conformance!(
    unsafe impl NSSecureCoding for HKActivitySummary {}
);

impl HKActivitySummary {
    extern_methods!(
        /// The date components representing the day for this particular HKActivitySummary.
        ///
        /// These date components will contain era, year, month, and day components in the provided calendar.
        #[unsafe(method(dateComponentsForCalendar:))]
        #[unsafe(method_family = none)]
        pub unsafe fn dateComponentsForCalendar(
            &self,
            calendar: &NSCalendar,
        ) -> Retained<NSDateComponents>;

        #[cfg(feature = "HKCharacteristicValues")]
        /// The move mode of this activity summary
        ///
        /// The move mode of an activity summary determines if activeEnergyBurned or appleMoveTime are used for the move ring.
        #[unsafe(method(activityMoveMode))]
        #[unsafe(method_family = none)]
        pub unsafe fn activityMoveMode(&self) -> HKActivityMoveMode;

        #[cfg(feature = "HKCharacteristicValues")]
        /// Setter for [`activityMoveMode`][Self::activityMoveMode].
        #[unsafe(method(setActivityMoveMode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setActivityMoveMode(&self, activity_move_mode: HKActivityMoveMode);

        /// The paused state of this activity summary
        ///
        /// The paused state of an activity summary indicates if the user is tracking their rings for the given day.
        #[unsafe(method(isPaused))]
        #[unsafe(method_family = none)]
        pub unsafe fn isPaused(&self) -> bool;

        /// Setter for [`isPaused`][Self::isPaused].
        #[unsafe(method(setPaused:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPaused(&self, paused: bool);

        #[cfg(feature = "HKQuantity")]
        /// The amount of active energy that the user burned.
        ///
        /// This quantity is compatible with energy units.
        #[unsafe(method(activeEnergyBurned))]
        #[unsafe(method_family = none)]
        pub unsafe fn activeEnergyBurned(&self) -> Retained<HKQuantity>;

        #[cfg(feature = "HKQuantity")]
        /// Setter for [`activeEnergyBurned`][Self::activeEnergyBurned].
        #[unsafe(method(setActiveEnergyBurned:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setActiveEnergyBurned(&self, active_energy_burned: &HKQuantity);

        #[cfg(feature = "HKQuantity")]
        /// The amount of move time that the user performed.
        ///
        /// This quantity is compatible with time units. The measurement criteria of
        /// move time time is defined by Apple.
        #[unsafe(method(appleMoveTime))]
        #[unsafe(method_family = none)]
        pub unsafe fn appleMoveTime(&self) -> Retained<HKQuantity>;

        #[cfg(feature = "HKQuantity")]
        /// Setter for [`appleMoveTime`][Self::appleMoveTime].
        #[unsafe(method(setAppleMoveTime:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAppleMoveTime(&self, apple_move_time: &HKQuantity);

        #[cfg(feature = "HKQuantity")]
        /// The amount of exercise time that the user performed.
        ///
        /// This quantity is compatible with time units. The measurement criteria of
        /// exercise time is defined by Apple.
        #[unsafe(method(appleExerciseTime))]
        #[unsafe(method_family = none)]
        pub unsafe fn appleExerciseTime(&self) -> Retained<HKQuantity>;

        #[cfg(feature = "HKQuantity")]
        /// Setter for [`appleExerciseTime`][Self::appleExerciseTime].
        #[unsafe(method(setAppleExerciseTime:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAppleExerciseTime(&self, apple_exercise_time: &HKQuantity);

        #[cfg(feature = "HKQuantity")]
        /// The number of stand hours that the user earned.
        ///
        /// This quantity is compatible with the count unit. The measurement criteria of
        /// stand hours is defined by Apple.
        #[unsafe(method(appleStandHours))]
        #[unsafe(method_family = none)]
        pub unsafe fn appleStandHours(&self) -> Retained<HKQuantity>;

        #[cfg(feature = "HKQuantity")]
        /// Setter for [`appleStandHours`][Self::appleStandHours].
        #[unsafe(method(setAppleStandHours:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAppleStandHours(&self, apple_stand_hours: &HKQuantity);

        #[cfg(feature = "HKQuantity")]
        /// The user's active energy goal for the day.
        ///
        /// This quantity is compatible with energy units.
        #[unsafe(method(activeEnergyBurnedGoal))]
        #[unsafe(method_family = none)]
        pub unsafe fn activeEnergyBurnedGoal(&self) -> Retained<HKQuantity>;

        #[cfg(feature = "HKQuantity")]
        /// Setter for [`activeEnergyBurnedGoal`][Self::activeEnergyBurnedGoal].
        #[unsafe(method(setActiveEnergyBurnedGoal:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setActiveEnergyBurnedGoal(&self, active_energy_burned_goal: &HKQuantity);

        #[cfg(feature = "HKQuantity")]
        /// The user's move time goal for the day.
        ///
        /// This quantity is compatible with time units.
        #[unsafe(method(appleMoveTimeGoal))]
        #[unsafe(method_family = none)]
        pub unsafe fn appleMoveTimeGoal(&self) -> Retained<HKQuantity>;

        #[cfg(feature = "HKQuantity")]
        /// Setter for [`appleMoveTimeGoal`][Self::appleMoveTimeGoal].
        #[unsafe(method(setAppleMoveTimeGoal:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAppleMoveTimeGoal(&self, apple_move_time_goal: &HKQuantity);

        #[cfg(feature = "HKQuantity")]
        /// The user's exercise time goal for the day.
        ///
        /// This quantity is compatible with time units.
        #[deprecated]
        #[unsafe(method(appleExerciseTimeGoal))]
        #[unsafe(method_family = none)]
        pub unsafe fn appleExerciseTimeGoal(&self) -> Retained<HKQuantity>;

        #[cfg(feature = "HKQuantity")]
        /// Setter for [`appleExerciseTimeGoal`][Self::appleExerciseTimeGoal].
        #[deprecated]
        #[unsafe(method(setAppleExerciseTimeGoal:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAppleExerciseTimeGoal(&self, apple_exercise_time_goal: &HKQuantity);

        #[cfg(feature = "HKQuantity")]
        /// The user's exercise time goal for the day.
        ///
        /// This quantity is compatible with time units.
        #[unsafe(method(exerciseTimeGoal))]
        #[unsafe(method_family = none)]
        pub unsafe fn exerciseTimeGoal(&self) -> Option<Retained<HKQuantity>>;

        #[cfg(feature = "HKQuantity")]
        /// Setter for [`exerciseTimeGoal`][Self::exerciseTimeGoal].
        #[unsafe(method(setExerciseTimeGoal:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setExerciseTimeGoal(&self, exercise_time_goal: Option<&HKQuantity>);

        #[cfg(feature = "HKQuantity")]
        /// The user's active stand hours goal for the day.
        ///
        /// This quantity is compatible with the count unit.
        #[deprecated]
        #[unsafe(method(appleStandHoursGoal))]
        #[unsafe(method_family = none)]
        pub unsafe fn appleStandHoursGoal(&self) -> Retained<HKQuantity>;

        #[cfg(feature = "HKQuantity")]
        /// Setter for [`appleStandHoursGoal`][Self::appleStandHoursGoal].
        #[deprecated]
        #[unsafe(method(setAppleStandHoursGoal:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAppleStandHoursGoal(&self, apple_stand_hours_goal: &HKQuantity);

        #[cfg(feature = "HKQuantity")]
        /// The user's active stand hours goal for the day.
        ///
        /// This quantity is compatible with the count unit.
        #[unsafe(method(standHoursGoal))]
        #[unsafe(method_family = none)]
        pub unsafe fn standHoursGoal(&self) -> Option<Retained<HKQuantity>>;

        #[cfg(feature = "HKQuantity")]
        /// Setter for [`standHoursGoal`][Self::standHoursGoal].
        #[unsafe(method(setStandHoursGoal:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setStandHoursGoal(&self, stand_hours_goal: Option<&HKQuantity>);
    );
}

/// Methods declared on superclass `NSObject`.
impl HKActivitySummary {
    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>;
    );
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkpredicatekeypathdatecomponents?language=objc)
    pub static HKPredicateKeyPathDateComponents: &'static NSString;
}