objc2_ui_kit/generated/
UIDocumentProperties.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uidocumentproperties?language=objc)
12    #[unsafe(super(NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct UIDocumentProperties;
16);
17
18extern_conformance!(
19    unsafe impl NSObjectProtocol for UIDocumentProperties {}
20);
21
22impl UIDocumentProperties {
23    extern_methods!(
24        #[unsafe(method(init))]
25        #[unsafe(method_family = init)]
26        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
27
28        #[unsafe(method(new))]
29        #[unsafe(method_family = new)]
30        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
31
32        /// When initializing with a url, UIKit will automatically lookup metadata based on the data at that url.
33        #[unsafe(method(initWithURL:))]
34        #[unsafe(method_family = init)]
35        pub unsafe fn initWithURL(this: Allocated<Self>, url: &NSURL) -> Retained<Self>;
36
37        #[cfg(all(feature = "UIDragItem", feature = "UIDragSession", feature = "block2"))]
38        /// To support drag
39        /// &
40        /// drop, assign a closure to return an array of drag items corresponding to the represented document.
41        #[unsafe(method(dragItemsProvider))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn dragItemsProvider(
44            &self,
45        ) -> *mut block2::DynBlock<
46            dyn Fn(NonNull<ProtocolObject<dyn UIDragSession>>) -> NonNull<NSArray<UIDragItem>>,
47        >;
48
49        #[cfg(all(feature = "UIDragItem", feature = "UIDragSession", feature = "block2"))]
50        /// Setter for [`dragItemsProvider`][Self::dragItemsProvider].
51        #[unsafe(method(setDragItemsProvider:))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn setDragItemsProvider(
54            &self,
55            drag_items_provider: Option<
56                &block2::DynBlock<
57                    dyn Fn(
58                        NonNull<ProtocolObject<dyn UIDragSession>>,
59                    ) -> NonNull<NSArray<UIDragItem>>,
60                >,
61            >,
62        );
63
64        #[cfg(all(
65            feature = "UIActivityViewController",
66            feature = "UIResponder",
67            feature = "UIViewController",
68            feature = "block2"
69        ))]
70        /// To support sharing, assign a closure to return a UIActivityViewController configured to share the represented document.
71        #[unsafe(method(activityViewControllerProvider))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn activityViewControllerProvider(
74            &self,
75        ) -> *mut block2::DynBlock<dyn Fn() -> NonNull<UIActivityViewController>>;
76
77        #[cfg(all(
78            feature = "UIActivityViewController",
79            feature = "UIResponder",
80            feature = "UIViewController",
81            feature = "block2"
82        ))]
83        /// Setter for [`activityViewControllerProvider`][Self::activityViewControllerProvider].
84        #[unsafe(method(setActivityViewControllerProvider:))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn setActivityViewControllerProvider(
87            &self,
88            activity_view_controller_provider: Option<
89                &block2::DynBlock<dyn Fn() -> NonNull<UIActivityViewController>>,
90            >,
91        );
92
93        /// If enabled, shows an icon representation of the document in the navigation bar.
94        #[unsafe(method(wantsIconRepresentation))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn wantsIconRepresentation(&self) -> bool;
97
98        /// Setter for [`wantsIconRepresentation`][Self::wantsIconRepresentation].
99        #[unsafe(method(setWantsIconRepresentation:))]
100        #[unsafe(method_family = none)]
101        pub unsafe fn setWantsIconRepresentation(&self, wants_icon_representation: bool);
102    );
103}