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 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        ///
42        /// # Safety
43        ///
44        /// The returned block's argument must be a valid pointer.
45        #[unsafe(method(dragItemsProvider))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn dragItemsProvider(
48            &self,
49        ) -> *mut block2::DynBlock<
50            dyn Fn(NonNull<ProtocolObject<dyn UIDragSession>>) -> NonNull<NSArray<UIDragItem>>,
51        >;
52
53        #[cfg(all(feature = "UIDragItem", feature = "UIDragSession", feature = "block2"))]
54        /// Setter for [`dragItemsProvider`][Self::dragItemsProvider].
55        ///
56        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
57        ///
58        /// # Safety
59        ///
60        /// `drag_items_provider` block's return must be a valid pointer.
61        #[unsafe(method(setDragItemsProvider:))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn setDragItemsProvider(
64            &self,
65            drag_items_provider: Option<
66                &block2::DynBlock<
67                    dyn Fn(
68                        NonNull<ProtocolObject<dyn UIDragSession>>,
69                    ) -> NonNull<NSArray<UIDragItem>>,
70                >,
71            >,
72        );
73
74        #[cfg(all(
75            feature = "UIActivityViewController",
76            feature = "UIResponder",
77            feature = "UIViewController",
78            feature = "block2"
79        ))]
80        /// To support sharing, assign a closure to return a UIActivityViewController configured to share the represented document.
81        #[unsafe(method(activityViewControllerProvider))]
82        #[unsafe(method_family = none)]
83        pub fn activityViewControllerProvider(
84            &self,
85        ) -> *mut block2::DynBlock<dyn Fn() -> NonNull<UIActivityViewController>>;
86
87        #[cfg(all(
88            feature = "UIActivityViewController",
89            feature = "UIResponder",
90            feature = "UIViewController",
91            feature = "block2"
92        ))]
93        /// Setter for [`activityViewControllerProvider`][Self::activityViewControllerProvider].
94        ///
95        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
96        ///
97        /// # Safety
98        ///
99        /// `activity_view_controller_provider` block's return must be a valid pointer.
100        #[unsafe(method(setActivityViewControllerProvider:))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn setActivityViewControllerProvider(
103            &self,
104            activity_view_controller_provider: Option<
105                &block2::DynBlock<dyn Fn() -> NonNull<UIActivityViewController>>,
106            >,
107        );
108
109        /// If enabled, shows an icon representation of the document in the navigation bar.
110        #[unsafe(method(wantsIconRepresentation))]
111        #[unsafe(method_family = none)]
112        pub fn wantsIconRepresentation(&self) -> bool;
113
114        /// Setter for [`wantsIconRepresentation`][Self::wantsIconRepresentation].
115        #[unsafe(method(setWantsIconRepresentation:))]
116        #[unsafe(method_family = none)]
117        pub fn setWantsIconRepresentation(&self, wants_icon_representation: bool);
118    );
119}