Skip to main content

objc2_health_kit/generated/
HKSourceRevision.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// Represents a specific revision of an HKSource.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hksourcerevision?language=objc)
13    #[unsafe(super(NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct HKSourceRevision;
16);
17
18unsafe impl Send for HKSourceRevision {}
19
20unsafe impl Sync for HKSourceRevision {}
21
22extern_conformance!(
23    unsafe impl NSCoding for HKSourceRevision {}
24);
25
26extern_conformance!(
27    unsafe impl NSCopying for HKSourceRevision {}
28);
29
30unsafe impl CopyingHelper for HKSourceRevision {
31    type Result = Self;
32}
33
34extern_conformance!(
35    unsafe impl NSObjectProtocol for HKSourceRevision {}
36);
37
38extern_conformance!(
39    unsafe impl NSSecureCoding for HKSourceRevision {}
40);
41
42impl HKSourceRevision {
43    extern_methods!(
44        #[cfg(feature = "HKSource")]
45        /// The HKSource of the receiver.
46        #[unsafe(method(source))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn source(&self) -> Retained<HKSource>;
49
50        /// The version of the source property.
51        ///
52        /// This value is taken from the CFBundleVersion of the source. May be nil for older data.
53        #[unsafe(method(version))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn version(&self) -> Option<Retained<NSString>>;
56
57        /// Represents the product type of the device running HealthKit when the object was created.
58        ///
59        /// This value may be nil for older data, which indicates an unknown product type.
60        #[unsafe(method(productType))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn productType(&self) -> Option<Retained<NSString>>;
63
64        /// Represents the operating system version of the device running HealthKit when the object was created.
65        ///
66        /// iOS versions after 8.0 but prior to 8.2 are saved as 8.0, and iOS version after 8.2 but prior to 9.0
67        /// are saved as 8.2.
68        #[unsafe(method(operatingSystemVersion))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn operatingSystemVersion(&self) -> NSOperatingSystemVersion;
71
72        #[cfg(feature = "HKSource")]
73        /// Initializes a new HKSourceRevision with the given source, version, product type, and operating system
74        /// version.
75        #[unsafe(method(initWithSource:version:productType:operatingSystemVersion:))]
76        #[unsafe(method_family = init)]
77        pub unsafe fn initWithSource_version_productType_operatingSystemVersion(
78            this: Allocated<Self>,
79            source: &HKSource,
80            version: Option<&NSString>,
81            product_type: Option<&NSString>,
82            operating_system_version: NSOperatingSystemVersion,
83        ) -> Retained<Self>;
84
85        #[cfg(feature = "HKSource")]
86        /// Initializes a new HKSourceRevision with the given source and version.
87        #[unsafe(method(initWithSource:version:))]
88        #[unsafe(method_family = init)]
89        pub unsafe fn initWithSource_version(
90            this: Allocated<Self>,
91            source: &HKSource,
92            version: Option<&NSString>,
93        ) -> Retained<Self>;
94
95        #[unsafe(method(init))]
96        #[unsafe(method_family = init)]
97        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
98    );
99}
100
101/// Methods declared on superclass `NSObject`.
102impl HKSourceRevision {
103    extern_methods!(
104        #[unsafe(method(new))]
105        #[unsafe(method_family = new)]
106        pub unsafe fn new() -> Retained<Self>;
107    );
108}
109
110extern "C" {
111    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hksourcerevisionanyversion?language=objc)
112    pub static HKSourceRevisionAnyVersion: &'static NSString;
113}
114
115extern "C" {
116    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hksourcerevisionanyproducttype?language=objc)
117    pub static HKSourceRevisionAnyProductType: &'static NSString;
118}
119
120extern "C" {
121    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hksourcerevisionanyoperatingsystem?language=objc)
122    pub static HKSourceRevisionAnyOperatingSystem: NSOperatingSystemVersion;
123}