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!(
    /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkuserannotatedmedicationquery?language=objc)
    #[unsafe(super(HKQuery, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "HKQuery")]
    pub struct HKUserAnnotatedMedicationQuery;
);

#[cfg(feature = "HKQuery")]
unsafe impl Send for HKUserAnnotatedMedicationQuery {}

#[cfg(feature = "HKQuery")]
unsafe impl Sync for HKUserAnnotatedMedicationQuery {}

#[cfg(feature = "HKQuery")]
extern_conformance!(
    unsafe impl NSObjectProtocol for HKUserAnnotatedMedicationQuery {}
);

#[cfg(feature = "HKQuery")]
impl HKUserAnnotatedMedicationQuery {
    extern_methods!(
        #[cfg(all(feature = "HKUserAnnotatedMedication", feature = "block2"))]
        /// Returns a query that will retrieve HKUserAnnotatedMedications matching the given predicate and limit.
        ///
        /// Parameter `predicate`: The predicate which user annotated medications should match.
        ///
        /// Parameter `limit`: The maximum number of  user annotated medications to return.  Pass HKObjectQueryNoLimit for no limit.
        ///
        /// Parameter `resultsHandler`: The block to invoke with results to deliver to the client. The results handler will be called with done = YES when there are no more user annotated medications to enumerate.
        #[unsafe(method(initWithPredicate:limit:resultsHandler:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithPredicate_limit_resultsHandler(
            this: Allocated<Self>,
            predicate: Option<&NSPredicate>,
            limit: NSUInteger,
            results_handler: &block2::DynBlock<
                dyn Fn(
                    NonNull<HKUserAnnotatedMedicationQuery>,
                    *mut HKUserAnnotatedMedication,
                    Bool,
                    *mut NSError,
                ),
            >,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `HKQuery`.
#[cfg(feature = "HKQuery")]
impl HKUserAnnotatedMedicationQuery {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "HKQuery")]
impl HKUserAnnotatedMedicationQuery {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}