use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-uniform-type-identifiers")]
use objc2_uniform_type_identifiers::*;
use crate::*;
extern_protocol!(
pub unsafe trait UIDocumentPickerDelegate: NSObjectProtocol + MainThreadOnly {
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[optional]
#[unsafe(method(documentPicker:didPickDocumentsAtURLs:))]
#[unsafe(method_family = none)]
fn documentPicker_didPickDocumentsAtURLs(
&self,
controller: &UIDocumentPickerViewController,
urls: &NSArray<NSURL>,
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[optional]
#[unsafe(method(documentPickerWasCancelled:))]
#[unsafe(method_family = none)]
fn documentPickerWasCancelled(&self, controller: &UIDocumentPickerViewController);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[deprecated]
#[optional]
#[unsafe(method(documentPicker:didPickDocumentAtURL:))]
#[unsafe(method_family = none)]
fn documentPicker_didPickDocumentAtURL(
&self,
controller: &UIDocumentPickerViewController,
url: &NSURL,
);
}
);
#[deprecated = "Use appropriate initializers instead"]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIDocumentPickerMode(pub NSUInteger);
impl UIDocumentPickerMode {
#[doc(alias = "UIDocumentPickerModeImport")]
#[deprecated = "Use appropriate initializers instead"]
pub const Import: Self = Self(0);
#[doc(alias = "UIDocumentPickerModeOpen")]
#[deprecated = "Use appropriate initializers instead"]
pub const Open: Self = Self(1);
#[doc(alias = "UIDocumentPickerModeExportToService")]
#[deprecated = "Use appropriate initializers instead"]
pub const ExportToService: Self = Self(2);
#[doc(alias = "UIDocumentPickerModeMoveToService")]
#[deprecated = "Use appropriate initializers instead"]
pub const MoveToService: Self = Self(3);
}
unsafe impl Encode for UIDocumentPickerMode {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for UIDocumentPickerMode {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(UIViewController, UIResponder, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
pub struct UIDocumentPickerViewController;
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
unsafe impl NSCoding for UIDocumentPickerViewController {}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
unsafe impl NSObjectProtocol for UIDocumentPickerViewController {}
);
#[cfg(all(
feature = "UIAppearance",
feature = "UIResponder",
feature = "UIViewController"
))]
extern_conformance!(
unsafe impl UIAppearanceContainer for UIDocumentPickerViewController {}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
unsafe impl UIContentContainer for UIDocumentPickerViewController {}
);
#[cfg(all(
feature = "UIFocus",
feature = "UIResponder",
feature = "UIViewController"
))]
extern_conformance!(
unsafe impl UIFocusEnvironment for UIDocumentPickerViewController {}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
unsafe impl UIResponderStandardEditActions for UIDocumentPickerViewController {}
);
#[cfg(all(
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIViewController"
))]
extern_conformance!(
unsafe impl UITraitEnvironment for UIDocumentPickerViewController {}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UIDocumentPickerViewController {
extern_methods!(
#[deprecated]
#[unsafe(method(initWithDocumentTypes:inMode:))]
#[unsafe(method_family = init)]
pub fn initWithDocumentTypes_inMode(
this: Allocated<Self>,
allowed_ut_is: &NSArray<NSString>,
mode: UIDocumentPickerMode,
) -> Retained<Self>;
#[cfg(feature = "objc2-uniform-type-identifiers")]
#[unsafe(method(initForOpeningContentTypes:asCopy:))]
#[unsafe(method_family = init)]
pub fn initForOpeningContentTypes_asCopy(
this: Allocated<Self>,
content_types: &NSArray<UTType>,
as_copy: bool,
) -> Retained<Self>;
#[cfg(feature = "objc2-uniform-type-identifiers")]
#[unsafe(method(initForOpeningContentTypes:))]
#[unsafe(method_family = init)]
pub fn initForOpeningContentTypes(
this: Allocated<Self>,
content_types: &NSArray<UTType>,
) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[deprecated]
#[unsafe(method(initWithURL:inMode:))]
#[unsafe(method_family = init)]
pub fn initWithURL_inMode(
this: Allocated<Self>,
url: &NSURL,
mode: UIDocumentPickerMode,
) -> Retained<Self>;
#[deprecated]
#[unsafe(method(initWithURLs:inMode:))]
#[unsafe(method_family = init)]
pub fn initWithURLs_inMode(
this: Allocated<Self>,
urls: &NSArray<NSURL>,
mode: UIDocumentPickerMode,
) -> Retained<Self>;
#[unsafe(method(initForExportingURLs:asCopy:))]
#[unsafe(method_family = init)]
pub fn initForExportingURLs_asCopy(
this: Allocated<Self>,
urls: &NSArray<NSURL>,
as_copy: bool,
) -> Retained<Self>;
#[unsafe(method(initForExportingURLs:))]
#[unsafe(method_family = init)]
pub fn initForExportingURLs(this: Allocated<Self>, urls: &NSArray<NSURL>)
-> Retained<Self>;
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn UIDocumentPickerDelegate>>>;
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn UIDocumentPickerDelegate>>);
#[deprecated = "Use appropriate initializers instead"]
#[unsafe(method(documentPickerMode))]
#[unsafe(method_family = none)]
pub fn documentPickerMode(&self) -> UIDocumentPickerMode;
#[unsafe(method(allowsMultipleSelection))]
#[unsafe(method_family = none)]
pub fn allowsMultipleSelection(&self) -> bool;
#[unsafe(method(setAllowsMultipleSelection:))]
#[unsafe(method_family = none)]
pub fn setAllowsMultipleSelection(&self, allows_multiple_selection: bool);
#[unsafe(method(shouldShowFileExtensions))]
#[unsafe(method_family = none)]
pub fn shouldShowFileExtensions(&self) -> bool;
#[unsafe(method(setShouldShowFileExtensions:))]
#[unsafe(method_family = none)]
pub fn setShouldShowFileExtensions(&self, should_show_file_extensions: bool);
#[unsafe(method(directoryURL))]
#[unsafe(method_family = none)]
pub fn directoryURL(&self) -> Option<Retained<NSURL>>;
#[unsafe(method(setDirectoryURL:))]
#[unsafe(method_family = none)]
pub fn setDirectoryURL(&self, directory_url: Option<&NSURL>);
);
}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UIDocumentPickerViewController {
extern_methods!(
#[unsafe(method(initWithNibName:bundle:))]
#[unsafe(method_family = init)]
pub fn initWithNibName_bundle(
this: Allocated<Self>,
nib_name_or_nil: Option<&NSString>,
nib_bundle_or_nil: Option<&NSBundle>,
) -> Retained<Self>;
);
}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UIDocumentPickerViewController {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}