objc2-store-kit 0.2.2

Bindings to the StoreKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_protocol!(
    #[cfg(feature = "SKRequest")]
    pub unsafe trait SKProductsRequestDelegate: SKRequestDelegate {
        #[method(productsRequest:didReceiveResponse:)]
        unsafe fn productsRequest_didReceiveResponse(
            &self,
            request: &SKProductsRequest,
            response: &SKProductsResponse,
        );
    }

    #[cfg(feature = "SKRequest")]
    unsafe impl ProtocolType for dyn SKProductsRequestDelegate {}
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "SKRequest")]
    pub struct SKProductsRequest;

    #[cfg(feature = "SKRequest")]
    unsafe impl ClassType for SKProductsRequest {
        #[inherits(NSObject)]
        type Super = SKRequest;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "SKRequest")]
unsafe impl NSObjectProtocol for SKProductsRequest {}

extern_methods!(
    #[cfg(feature = "SKRequest")]
    unsafe impl SKProductsRequest {
        #[method_id(@__retain_semantics Init initWithProductIdentifiers:)]
        pub unsafe fn initWithProductIdentifiers(
            this: Allocated<Self>,
            product_identifiers: &NSSet<NSString>,
        ) -> Retained<Self>;

        #[method_id(@__retain_semantics Other delegate)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn SKProductsRequestDelegate>>>;

        #[method(setDelegate:)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn SKProductsRequestDelegate>>,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "SKRequest")]
    unsafe impl SKProductsRequest {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct SKProductsResponse;

    unsafe impl ClassType for SKProductsResponse {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl Send for SKProductsResponse {}

unsafe impl Sync for SKProductsResponse {}

unsafe impl NSObjectProtocol for SKProductsResponse {}

extern_methods!(
    unsafe impl SKProductsResponse {
        #[cfg(feature = "SKProduct")]
        #[method_id(@__retain_semantics Other products)]
        pub unsafe fn products(&self) -> Retained<NSArray<SKProduct>>;

        #[method_id(@__retain_semantics Other invalidProductIdentifiers)]
        pub unsafe fn invalidProductIdentifiers(&self) -> Retained<NSArray<NSString>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl SKProductsResponse {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);