//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
#[cfg(feature = "block2")]
use block2::*;
use objc2::__framework_prelude::*;
use objc2_file_provider::*;
use objc2_foundation::*;

use crate::*;

extern "C" {
    pub static FPUIErrorDomain: &'static NSString;
}

// NS_TYPED_EXTENSIBLE_ENUM
pub type FPUIActionIdentifier = NSString;

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct FPUIExtensionErrorCode(pub NSUInteger);
impl FPUIExtensionErrorCode {
    #[doc(alias = "FPUIExtensionErrorCodeUserCancelled")]
    pub const UserCancelled: Self = Self(0);
    #[doc(alias = "FPUIExtensionErrorCodeFailed")]
    pub const Failed: Self = Self(1);
}

unsafe impl Encode for FPUIExtensionErrorCode {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for FPUIExtensionErrorCode {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

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

    unsafe impl ClassType for FPUIActionExtensionContext {
        #[inherits(NSObject)]
        type Super = NSExtensionContext;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for FPUIActionExtensionContext {}

extern_methods!(
    unsafe impl FPUIActionExtensionContext {
        #[method_id(@__retain_semantics Other domainIdentifier)]
        pub unsafe fn domainIdentifier(&self) -> Option<Id<NSFileProviderDomainIdentifier>>;

        #[method(completeRequest)]
        pub unsafe fn completeRequest(&self);

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

        #[method(cancelRequestWithError:)]
        pub unsafe fn cancelRequestWithError(&self, error: &NSError);
    }
);

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

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