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!(
#[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")]
#[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>;
);
}
#[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>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
);
}
#[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>;
);
}
#[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>;
);
}