objc2_pass_kit/generated/
PKPaymentSummaryItem.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
10/// [Apple's documentation](https://developer.apple.com/documentation/passkit/pkpaymentsummaryitemtype?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct PKPaymentSummaryItemType(pub NSUInteger);
15impl PKPaymentSummaryItemType {
16    #[doc(alias = "PKPaymentSummaryItemTypeFinal")]
17    pub const Final: Self = Self(0);
18    #[doc(alias = "PKPaymentSummaryItemTypePending")]
19    pub const Pending: Self = Self(1);
20}
21
22unsafe impl Encode for PKPaymentSummaryItemType {
23    const ENCODING: Encoding = NSUInteger::ENCODING;
24}
25
26unsafe impl RefEncode for PKPaymentSummaryItemType {
27    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
28}
29
30extern_class!(
31    /// [Apple's documentation](https://developer.apple.com/documentation/passkit/pkpaymentsummaryitem?language=objc)
32    #[unsafe(super(NSObject))]
33    #[derive(Debug, PartialEq, Eq, Hash)]
34    pub struct PKPaymentSummaryItem;
35);
36
37extern_conformance!(
38    unsafe impl NSObjectProtocol for PKPaymentSummaryItem {}
39);
40
41impl PKPaymentSummaryItem {
42    extern_methods!(
43        #[unsafe(method(summaryItemWithLabel:amount:))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn summaryItemWithLabel_amount(
46            label: &NSString,
47            amount: &NSDecimalNumber,
48        ) -> Retained<Self>;
49
50        #[unsafe(method(summaryItemWithLabel:amount:type:))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn summaryItemWithLabel_amount_type(
53            label: &NSString,
54            amount: &NSDecimalNumber,
55            r#type: PKPaymentSummaryItemType,
56        ) -> Retained<Self>;
57
58        #[unsafe(method(label))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn label(&self) -> Retained<NSString>;
61
62        /// Setter for [`label`][Self::label].
63        #[unsafe(method(setLabel:))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn setLabel(&self, label: &NSString);
66
67        #[unsafe(method(amount))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn amount(&self) -> Retained<NSDecimalNumber>;
70
71        /// Setter for [`amount`][Self::amount].
72        #[unsafe(method(setAmount:))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn setAmount(&self, amount: &NSDecimalNumber);
75
76        #[unsafe(method(type))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn r#type(&self) -> PKPaymentSummaryItemType;
79
80        /// Setter for [`type`][Self::type].
81        #[unsafe(method(setType:))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn setType(&self, r#type: PKPaymentSummaryItemType);
84    );
85}
86
87/// Methods declared on superclass `NSObject`.
88impl PKPaymentSummaryItem {
89    extern_methods!(
90        #[unsafe(method(init))]
91        #[unsafe(method_family = init)]
92        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
93
94        #[unsafe(method(new))]
95        #[unsafe(method_family = new)]
96        pub unsafe fn new() -> Retained<Self>;
97    );
98}