objc2_class_kit/generated/
CLSQuantityItem.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// CLSQuantityItem represents user generated quantity information.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/classkit/clsquantityitem?language=objc)
14    #[unsafe(super(CLSActivityItem, CLSObject, NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
17    pub struct CLSQuantityItem;
18);
19
20#[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
21extern_conformance!(
22    unsafe impl NSCoding for CLSQuantityItem {}
23);
24
25#[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
26extern_conformance!(
27    unsafe impl NSObjectProtocol for CLSQuantityItem {}
28);
29
30#[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
31extern_conformance!(
32    unsafe impl NSSecureCoding for CLSQuantityItem {}
33);
34
35#[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
36impl CLSQuantityItem {
37    extern_methods!(
38        /// Quantity awarded.
39        #[unsafe(method(quantity))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn quantity(&self) -> c_double;
42
43        /// Setter for [`quantity`][Self::quantity].
44        #[unsafe(method(setQuantity:))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn setQuantity(&self, quantity: c_double);
47
48        /// Create a quantity item with an identifier and title.
49        ///
50        /// Parameter `identifier`: An identifier that is unique within activity.
51        ///
52        /// Parameter `title`: Title of the quantity. Ex
53        /// _Hints_
54        #[unsafe(method(initWithIdentifier:title:))]
55        #[unsafe(method_family = init)]
56        pub unsafe fn initWithIdentifier_title(
57            this: Allocated<Self>,
58            identifier: &NSString,
59            title: &NSString,
60        ) -> Retained<Self>;
61    );
62}
63
64/// Methods declared on superclass `CLSActivityItem`.
65#[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
66impl CLSQuantityItem {
67    extern_methods!(
68        #[unsafe(method(new))]
69        #[unsafe(method_family = new)]
70        pub unsafe fn new() -> Retained<Self>;
71
72        #[unsafe(method(init))]
73        #[unsafe(method_family = init)]
74        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
75    );
76}