objc2-pass-kit 0.3.2

Bindings to the PassKit 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::*;
#[cfg(feature = "objc2-core-graphics")]
use objc2_core_graphics::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/passkit/pkaddpassmetadatapreview?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct PKAddPassMetadataPreview;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for PKAddPassMetadataPreview {}
);

impl PKAddPassMetadataPreview {
    extern_methods!(
        #[cfg(feature = "objc2-core-graphics")]
        /// Initializer preview object to represent the pass being added to Wallet.which requires a CGImage of the pass's card art and a localized description.
        /// - Properties:
        /// - passThumbnail: CGImage representing the card artwork of the pass to be presented during provisioning.
        /// - localizedDescription: Localized description of the pass.
        #[unsafe(method(initWithPassThumbnail:localizedDescription:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithPassThumbnail_localizedDescription(
            this: Allocated<Self>,
            pass_thumbnail: &CGImage,
            description: &NSString,
        ) -> Retained<Self>;

        #[cfg(feature = "objc2-core-graphics")]
        #[unsafe(method(previewWithPassThumbnail:localizedDescription:))]
        #[unsafe(method_family = none)]
        pub unsafe fn previewWithPassThumbnail_localizedDescription(
            pass_thumbnail: &CGImage,
            description: &NSString,
        ) -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[cfg(feature = "objc2-core-graphics")]
        /// CGImage representing the pass in our provisioning UI.
        ///
        /// # Safety
        ///
        /// This is not retained internally, you must ensure the object is still alive.
        #[unsafe(method(passThumbnailImage))]
        #[unsafe(method_family = none)]
        pub unsafe fn passThumbnailImage(&self) -> Option<Retained<CGImage>>;

        /// Localized description of the pass to be referenced during provisioning.
        #[unsafe(method(localizedDescription))]
        #[unsafe(method_family = none)]
        pub unsafe fn localizedDescription(&self) -> Option<Retained<NSString>>;
    );
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/passkit/pkaddsecureelementpassconfiguration?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct PKAddSecureElementPassConfiguration;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for PKAddSecureElementPassConfiguration {}
);

impl PKAddSecureElementPassConfiguration {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[unsafe(method(issuerIdentifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn issuerIdentifier(&self) -> Option<Retained<NSString>>;

        /// Setter for [`issuerIdentifier`][Self::issuerIdentifier].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setIssuerIdentifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setIssuerIdentifier(&self, issuer_identifier: Option<&NSString>);

        #[unsafe(method(localizedDescription))]
        #[unsafe(method_family = none)]
        pub unsafe fn localizedDescription(&self) -> Option<Retained<NSString>>;

        /// Setter for [`localizedDescription`][Self::localizedDescription].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setLocalizedDescription:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLocalizedDescription(&self, localized_description: Option<&NSString>);
    );
}