//! 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 crate::*;

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

unsafe impl NSObjectProtocol for NSExtensionContext {}

impl NSExtensionContext {
    extern_methods!(
        #[cfg(feature = "NSArray")]
        #[unsafe(method(inputItems))]
        #[unsafe(method_family = none)]
        pub unsafe fn inputItems(&self) -> Retained<NSArray>;

        #[cfg(all(feature = "NSArray", feature = "block2"))]
        #[unsafe(method(completeRequestReturningItems:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn completeRequestReturningItems_completionHandler(
            &self,
            items: Option<&NSArray>,
            completion_handler: Option<&block2::Block<dyn Fn(Bool)>>,
        );

        #[cfg(feature = "NSError")]
        #[unsafe(method(cancelRequestWithError:))]
        #[unsafe(method_family = none)]
        pub unsafe fn cancelRequestWithError(&self, error: &NSError);

        #[cfg(all(feature = "NSURL", feature = "block2"))]
        #[unsafe(method(openURL:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn openURL_completionHandler(
            &self,
            url: &NSURL,
            completion_handler: Option<&block2::Block<dyn Fn(Bool)>>,
        );
    );
}

/// Methods declared on superclass `NSObject`.
impl NSExtensionContext {
    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 "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsextensionitemsanderrorskey?language=objc)
    #[cfg(feature = "NSString")]
    pub static NSExtensionItemsAndErrorsKey: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsextensionhostwillenterforegroundnotification?language=objc)
    #[cfg(feature = "NSString")]
    pub static NSExtensionHostWillEnterForegroundNotification: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsextensionhostdidenterbackgroundnotification?language=objc)
    #[cfg(feature = "NSString")]
    pub static NSExtensionHostDidEnterBackgroundNotification: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsextensionhostwillresignactivenotification?language=objc)
    #[cfg(feature = "NSString")]
    pub static NSExtensionHostWillResignActiveNotification: Option<&'static NSString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsextensionhostdidbecomeactivenotification?language=objc)
    #[cfg(feature = "NSString")]
    pub static NSExtensionHostDidBecomeActiveNotification: Option<&'static NSString>;
}
