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-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/passkit/pkpaymentauthorizationviewcontroller?language=objc)
    #[unsafe(super(NSViewController, NSResponder, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "objc2-app-kit")]
    #[cfg(target_os = "macos")]
    pub struct PKPaymentAuthorizationViewController;
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSCoding for PKPaymentAuthorizationViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSEditor for PKPaymentAuthorizationViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSObjectProtocol for PKPaymentAuthorizationViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSSeguePerforming for PKPaymentAuthorizationViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSUserInterfaceItemIdentification for PKPaymentAuthorizationViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl PKPaymentAuthorizationViewController {
    extern_methods!(
        #[unsafe(method(canMakePayments))]
        #[unsafe(method_family = none)]
        pub unsafe fn canMakePayments(mtm: MainThreadMarker) -> bool;

        #[cfg(feature = "PKConstants")]
        #[unsafe(method(canMakePaymentsUsingNetworks:))]
        #[unsafe(method_family = none)]
        pub unsafe fn canMakePaymentsUsingNetworks(
            supported_networks: &NSArray<PKPaymentNetwork>,
            mtm: MainThreadMarker,
        ) -> bool;

        #[cfg(all(feature = "PKConstants", feature = "PKPaymentRequest"))]
        #[unsafe(method(canMakePaymentsUsingNetworks:capabilities:))]
        #[unsafe(method_family = none)]
        pub unsafe fn canMakePaymentsUsingNetworks_capabilities(
            supported_networks: &NSArray<PKPaymentNetwork>,
            capabilties: PKMerchantCapability,
            mtm: MainThreadMarker,
        ) -> bool;

        #[cfg(feature = "PKPaymentAuthorizationViewControllerDelegate")]
        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn PKPaymentAuthorizationViewControllerDelegate>>>;

        #[cfg(feature = "PKPaymentAuthorizationViewControllerDelegate")]
        /// Setter for [`delegate`][Self::delegate].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn PKPaymentAuthorizationViewControllerDelegate>>,
        );

        #[cfg(feature = "PKPaymentRequest")]
        #[unsafe(method(initWithPaymentRequest:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithPaymentRequest(
            this: Allocated<Self>,
            request: &PKPaymentRequest,
        ) -> Option<Retained<Self>>;

        #[unsafe(method(supportsDisbursements))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportsDisbursements(mtm: MainThreadMarker) -> bool;

        #[cfg(feature = "PKConstants")]
        #[unsafe(method(supportsDisbursementsUsingNetworks:))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportsDisbursementsUsingNetworks(
            supported_networks: &NSArray<PKPaymentNetwork>,
            mtm: MainThreadMarker,
        ) -> bool;

        #[cfg(all(feature = "PKConstants", feature = "PKPaymentRequest"))]
        #[unsafe(method(supportsDisbursementsUsingNetworks:capabilities:))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportsDisbursementsUsingNetworks_capabilities(
            supported_networks: &NSArray<PKPaymentNetwork>,
            capabilities: PKMerchantCapability,
            mtm: MainThreadMarker,
        ) -> bool;

        #[cfg(feature = "PKDisbursementRequest")]
        #[unsafe(method(initWithDisbursementRequest:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithDisbursementRequest(
            this: Allocated<Self>,
            request: &PKDisbursementRequest,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSViewController`.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl PKPaymentAuthorizationViewController {
    extern_methods!(
        #[unsafe(method(initWithNibName:bundle:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithNibName_bundle(
            this: Allocated<Self>,
            nib_name_or_nil: Option<&NSNibName>,
            nib_bundle_or_nil: Option<&NSBundle>,
        ) -> Retained<Self>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;
    );
}

/// Methods declared on superclass `NSResponder`.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl PKPaymentAuthorizationViewController {
    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 = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl PKPaymentAuthorizationViewController {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}