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

use crate::*;

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

extern_conformance!(
    unsafe impl NSObjectProtocol for UIDocumentProperties {}
);

impl UIDocumentProperties {
    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(mtm: MainThreadMarker) -> Retained<Self>;

        /// When initializing with a url, UIKit will automatically lookup metadata based on the data at that url.
        #[unsafe(method(initWithURL:))]
        #[unsafe(method_family = init)]
        pub fn initWithURL(this: Allocated<Self>, url: &NSURL) -> Retained<Self>;

        #[cfg(all(feature = "UIDragItem", feature = "UIDragSession", feature = "block2"))]
        /// To support drag
        /// &
        /// drop, assign a closure to return an array of drag items corresponding to the represented document.
        ///
        /// # Safety
        ///
        /// The returned block's argument must be a valid pointer.
        #[unsafe(method(dragItemsProvider))]
        #[unsafe(method_family = none)]
        pub unsafe fn dragItemsProvider(
            &self,
        ) -> *mut block2::DynBlock<
            dyn Fn(NonNull<ProtocolObject<dyn UIDragSession>>) -> NonNull<NSArray<UIDragItem>>,
        >;

        #[cfg(all(feature = "UIDragItem", feature = "UIDragSession", feature = "block2"))]
        /// Setter for [`dragItemsProvider`][Self::dragItemsProvider].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        ///
        /// # Safety
        ///
        /// `drag_items_provider` block's return must be a valid pointer.
        #[unsafe(method(setDragItemsProvider:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDragItemsProvider(
            &self,
            drag_items_provider: Option<
                &block2::DynBlock<
                    dyn Fn(
                        NonNull<ProtocolObject<dyn UIDragSession>>,
                    ) -> NonNull<NSArray<UIDragItem>>,
                >,
            >,
        );

        #[cfg(all(
            feature = "UIActivityViewController",
            feature = "UIResponder",
            feature = "UIViewController",
            feature = "block2"
        ))]
        /// To support sharing, assign a closure to return a UIActivityViewController configured to share the represented document.
        #[unsafe(method(activityViewControllerProvider))]
        #[unsafe(method_family = none)]
        pub fn activityViewControllerProvider(
            &self,
        ) -> *mut block2::DynBlock<dyn Fn() -> NonNull<UIActivityViewController>>;

        #[cfg(all(
            feature = "UIActivityViewController",
            feature = "UIResponder",
            feature = "UIViewController",
            feature = "block2"
        ))]
        /// Setter for [`activityViewControllerProvider`][Self::activityViewControllerProvider].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        ///
        /// # Safety
        ///
        /// `activity_view_controller_provider` block's return must be a valid pointer.
        #[unsafe(method(setActivityViewControllerProvider:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setActivityViewControllerProvider(
            &self,
            activity_view_controller_provider: Option<
                &block2::DynBlock<dyn Fn() -> NonNull<UIActivityViewController>>,
            >,
        );

        /// If enabled, shows an icon representation of the document in the navigation bar.
        #[unsafe(method(wantsIconRepresentation))]
        #[unsafe(method_family = none)]
        pub fn wantsIconRepresentation(&self) -> bool;

        /// Setter for [`wantsIconRepresentation`][Self::wantsIconRepresentation].
        #[unsafe(method(setWantsIconRepresentation:))]
        #[unsafe(method_family = none)]
        pub fn setWantsIconRepresentation(&self, wants_icon_representation: bool);
    );
}
