objc2-class-kit 0.3.2

Bindings to the ClassKit 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!(
    /// CLSQuantityItem represents user generated quantity information.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/classkit/clsquantityitem?language=objc)
    #[unsafe(super(CLSActivityItem, CLSObject, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
    pub struct CLSQuantityItem;
);

#[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
extern_conformance!(
    unsafe impl NSCoding for CLSQuantityItem {}
);

#[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
extern_conformance!(
    unsafe impl NSObjectProtocol for CLSQuantityItem {}
);

#[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
extern_conformance!(
    unsafe impl NSSecureCoding for CLSQuantityItem {}
);

#[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
impl CLSQuantityItem {
    extern_methods!(
        /// Quantity awarded.
        #[unsafe(method(quantity))]
        #[unsafe(method_family = none)]
        pub unsafe fn quantity(&self) -> c_double;

        /// Setter for [`quantity`][Self::quantity].
        #[unsafe(method(setQuantity:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setQuantity(&self, quantity: c_double);

        /// Create a quantity item with an identifier and title.
        ///
        /// Parameter `identifier`: An identifier that is unique within activity.
        ///
        /// Parameter `title`: Title of the quantity. Ex
        /// _Hints_
        #[unsafe(method(initWithIdentifier:title:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithIdentifier_title(
            this: Allocated<Self>,
            identifier: &NSString,
            title: &NSString,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `CLSActivityItem`.
#[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
impl CLSQuantityItem {
    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>;
    );
}