//! 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)]
        unsafe fn presentedItemURL(&self) -> Option<Retained<NSURL>>;

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

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

        #[cfg(feature = "block2")]
        #[optional]
        #[unsafe(method(relinquishPresentedItemToReader:))]
        #[unsafe(method_family = none)]
        unsafe fn relinquishPresentedItemToReader(
            &self,
            reader: &block2::Block<dyn Fn(*mut block2::Block<dyn Fn()>)>,
        );

        #[cfg(feature = "block2")]
        #[optional]
        #[unsafe(method(relinquishPresentedItemToWriter:))]
        #[unsafe(method_family = none)]
        unsafe fn relinquishPresentedItemToWriter(
            &self,
            writer: &block2::Block<dyn Fn(*mut block2::Block<dyn Fn()>)>,
        );

        #[cfg(all(feature = "NSError", feature = "block2"))]
        #[optional]
        #[unsafe(method(savePresentedItemChangesWithCompletionHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn savePresentedItemChangesWithCompletionHandler(
            &self,
            completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
        );

        #[cfg(all(feature = "NSError", feature = "block2"))]
        #[optional]
        #[unsafe(method(accommodatePresentedItemDeletionWithCompletionHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn accommodatePresentedItemDeletionWithCompletionHandler(
            &self,
            completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
        );

        #[cfg(all(feature = "NSError", feature = "block2"))]
        #[optional]
        #[unsafe(method(accommodatePresentedItemEvictionWithCompletionHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn accommodatePresentedItemEvictionWithCompletionHandler(
            &self,
            completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
        );

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

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

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

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

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

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

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

        #[cfg(all(feature = "NSError", feature = "NSURL", feature = "block2"))]
        #[optional]
        #[unsafe(method(accommodatePresentedSubitemDeletionAtURL:completionHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn accommodatePresentedSubitemDeletionAtURL_completionHandler(
            &self,
            url: &NSURL,
            completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
        );

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

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

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

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

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

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