//! 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_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsfilepresenter?language=objc)
    pub unsafe trait NSFilePresenter: NSObjectProtocol {
        #[cfg(feature = "NSURL")]
        #[unsafe(method(presentedItemURL))]
        #[unsafe(method_family = none)]
        fn presentedItemURL(&self) -> Option<Retained<NSURL>>;

        #[cfg(feature = "NSOperation")]
        #[unsafe(method(presentedItemOperationQueue))]
        #[unsafe(method_family = none)]
        fn presentedItemOperationQueue(&self) -> Retained<NSOperationQueue>;

        #[cfg(feature = "NSURL")]
        #[optional]
        #[unsafe(method(primaryPresentedItemURL))]
        #[unsafe(method_family = none)]
        fn primaryPresentedItemURL(&self) -> Option<Retained<NSURL>>;

        #[cfg(feature = "block2")]
        /// # Safety
        ///
        /// `reader` block must be sendable.
        #[optional]
        #[unsafe(method(relinquishPresentedItemToReader:))]
        #[unsafe(method_family = none)]
        unsafe fn relinquishPresentedItemToReader(
            &self,
            reader: &block2::DynBlock<dyn Fn(*mut block2::DynBlock<dyn Fn()>)>,
        );

        #[cfg(feature = "block2")]
        /// # Safety
        ///
        /// `writer` block must be sendable.
        #[optional]
        #[unsafe(method(relinquishPresentedItemToWriter:))]
        #[unsafe(method_family = none)]
        unsafe fn relinquishPresentedItemToWriter(
            &self,
            writer: &block2::DynBlock<dyn Fn(*mut block2::DynBlock<dyn Fn()>)>,
        );

        #[cfg(all(feature = "NSError", feature = "block2"))]
        /// # Safety
        ///
        /// `completion_handler` block must be sendable.
        #[optional]
        #[unsafe(method(savePresentedItemChangesWithCompletionHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn savePresentedItemChangesWithCompletionHandler(
            &self,
            completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );

        #[cfg(all(feature = "NSError", feature = "block2"))]
        /// # Safety
        ///
        /// `completion_handler` block must be sendable.
        #[optional]
        #[unsafe(method(accommodatePresentedItemDeletionWithCompletionHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn accommodatePresentedItemDeletionWithCompletionHandler(
            &self,
            completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );

        #[cfg(all(feature = "NSError", feature = "block2"))]
        /// # Safety
        ///
        /// `completion_handler` block must be sendable.
        #[optional]
        #[unsafe(method(accommodatePresentedItemEvictionWithCompletionHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn accommodatePresentedItemEvictionWithCompletionHandler(
            &self,
            completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );

        #[cfg(feature = "NSURL")]
        #[optional]
        #[unsafe(method(presentedItemDidMoveToURL:))]
        #[unsafe(method_family = none)]
        fn presentedItemDidMoveToURL(&self, new_url: &NSURL);

        #[optional]
        #[unsafe(method(presentedItemDidChange))]
        #[unsafe(method_family = none)]
        fn presentedItemDidChange(&self);

        #[cfg(all(feature = "NSSet", feature = "NSString", feature = "NSURL"))]
        #[optional]
        #[unsafe(method(presentedItemDidChangeUbiquityAttributes:))]
        #[unsafe(method_family = none)]
        fn presentedItemDidChangeUbiquityAttributes(&self, attributes: &NSSet<NSURLResourceKey>);

        #[cfg(all(feature = "NSSet", feature = "NSString", feature = "NSURL"))]
        #[optional]
        #[unsafe(method(observedPresentedItemUbiquityAttributes))]
        #[unsafe(method_family = none)]
        fn observedPresentedItemUbiquityAttributes(&self) -> Retained<NSSet<NSURLResourceKey>>;

        #[cfg(feature = "NSFileVersion")]
        #[optional]
        #[unsafe(method(presentedItemDidGainVersion:))]
        #[unsafe(method_family = none)]
        fn presentedItemDidGainVersion(&self, version: &NSFileVersion);

        #[cfg(feature = "NSFileVersion")]
        #[optional]
        #[unsafe(method(presentedItemDidLoseVersion:))]
        #[unsafe(method_family = none)]
        fn presentedItemDidLoseVersion(&self, version: &NSFileVersion);

        #[cfg(feature = "NSFileVersion")]
        #[optional]
        #[unsafe(method(presentedItemDidResolveConflictVersion:))]
        #[unsafe(method_family = none)]
        fn presentedItemDidResolveConflictVersion(&self, version: &NSFileVersion);

        #[cfg(all(feature = "NSError", feature = "NSURL", feature = "block2"))]
        /// # Safety
        ///
        /// `completion_handler` block must be sendable.
        #[optional]
        #[unsafe(method(accommodatePresentedSubitemDeletionAtURL:completionHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn accommodatePresentedSubitemDeletionAtURL_completionHandler(
            &self,
            url: &NSURL,
            completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );

        #[cfg(feature = "NSURL")]
        #[optional]
        #[unsafe(method(presentedSubitemDidAppearAtURL:))]
        #[unsafe(method_family = none)]
        fn presentedSubitemDidAppearAtURL(&self, url: &NSURL);

        #[cfg(feature = "NSURL")]
        #[optional]
        #[unsafe(method(presentedSubitemAtURL:didMoveToURL:))]
        #[unsafe(method_family = none)]
        fn presentedSubitemAtURL_didMoveToURL(&self, old_url: &NSURL, new_url: &NSURL);

        #[cfg(feature = "NSURL")]
        #[optional]
        #[unsafe(method(presentedSubitemDidChangeAtURL:))]
        #[unsafe(method_family = none)]
        fn presentedSubitemDidChangeAtURL(&self, url: &NSURL);

        #[cfg(all(feature = "NSFileVersion", feature = "NSURL"))]
        #[optional]
        #[unsafe(method(presentedSubitemAtURL:didGainVersion:))]
        #[unsafe(method_family = none)]
        fn presentedSubitemAtURL_didGainVersion(&self, url: &NSURL, version: &NSFileVersion);

        #[cfg(all(feature = "NSFileVersion", feature = "NSURL"))]
        #[optional]
        #[unsafe(method(presentedSubitemAtURL:didLoseVersion:))]
        #[unsafe(method_family = none)]
        fn presentedSubitemAtURL_didLoseVersion(&self, url: &NSURL, version: &NSFileVersion);

        #[cfg(all(feature = "NSFileVersion", feature = "NSURL"))]
        #[optional]
        #[unsafe(method(presentedSubitemAtURL:didResolveConflictVersion:))]
        #[unsafe(method_family = none)]
        fn presentedSubitemAtURL_didResolveConflictVersion(
            &self,
            url: &NSURL,
            version: &NSFileVersion,
        );
    }
);
