objc2-store-kit 0.3.2

Bindings to the StoreKit 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::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skrequest?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated = "No longer supported"]
    pub struct SKRequest;
);

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

impl SKRequest {
    extern_methods!(
        #[deprecated = "No longer supported"]
        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn SKRequestDelegate>>>;

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

        #[deprecated = "No longer supported"]
        #[unsafe(method(cancel))]
        #[unsafe(method_family = none)]
        pub unsafe fn cancel(&self);

        #[deprecated = "No longer supported"]
        #[unsafe(method(start))]
        #[unsafe(method_family = none)]
        pub unsafe fn start(&self);
    );
}

/// Methods declared on superclass `NSObject`.
impl SKRequest {
    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>;
    );
}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skrequestdelegate?language=objc)
    #[deprecated = "No longer supported"]
    pub unsafe trait SKRequestDelegate: NSObjectProtocol {
        #[deprecated = "No longer supported"]
        #[optional]
        #[unsafe(method(requestDidFinish:))]
        #[unsafe(method_family = none)]
        unsafe fn requestDidFinish(&self, request: &SKRequest);

        #[deprecated = "No longer supported"]
        #[optional]
        #[unsafe(method(request:didFailWithError:))]
        #[unsafe(method_family = none)]
        unsafe fn request_didFailWithError(&self, request: &SKRequest, error: &NSError);
    }
);