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
18unsafe impl NSObjectProtocol for UIDocumentProperties {}
19
20impl UIDocumentProperties {
21    extern_methods!(
22        #[unsafe(method(init))]
23        #[unsafe(method_family = init)]
24        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
25
26        #[unsafe(method(new))]
27        #[unsafe(method_family = new)]
28        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
29
30        /// When initializing with a url, UIKit will automatically lookup metadata based on the data at that url.
31        #[unsafe(method(initWithURL:))]
32        #[unsafe(method_family = init)]
33        pub unsafe fn initWithURL(this: Allocated<Self>, url: &NSURL) -> Retained<Self>;
34
35        #[cfg(all(feature = "UIDragItem", feature = "UIDragSession", feature = "block2"))]
36        /// To support drag
37        /// &
38        /// drop, assign a closure to return an array of drag items corresponding to the represented document.
39        #[unsafe(method(dragItemsProvider))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn dragItemsProvider(
42            &self,
43        ) -> *mut block2::Block<
44            dyn Fn(NonNull<ProtocolObject<dyn UIDragSession>>) -> NonNull<NSArray<UIDragItem>>,
45        >;
46
47        #[cfg(all(feature = "UIDragItem", feature = "UIDragSession", feature = "block2"))]
48        /// Setter for [`dragItemsProvider`][Self::dragItemsProvider].
49        #[unsafe(method(setDragItemsProvider:))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn setDragItemsProvider(
52            &self,
53            drag_items_provider: Option<
54                &block2::Block<
55                    dyn Fn(
56                        NonNull<ProtocolObject<dyn UIDragSession>>,
57                    ) -> NonNull<NSArray<UIDragItem>>,
58                >,
59            >,
60        );
61
62        #[cfg(all(
63            feature = "UIActivityViewController",
64            feature = "UIResponder",
65            feature = "UIViewController",
66            feature = "block2"
67        ))]
68        /// To support sharing, assign a closure to return a UIActivityViewController configured to share the represented document.
69        #[unsafe(method(activityViewControllerProvider))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn activityViewControllerProvider(
72            &self,
73        ) -> *mut block2::Block<dyn Fn() -> NonNull<UIActivityViewController>>;
74
75        #[cfg(all(
76            feature = "UIActivityViewController",
77            feature = "UIResponder",
78            feature = "UIViewController",
79            feature = "block2"
80        ))]
81        /// Setter for [`activityViewControllerProvider`][Self::activityViewControllerProvider].
82        #[unsafe(method(setActivityViewControllerProvider:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn setActivityViewControllerProvider(
85            &self,
86            activity_view_controller_provider: Option<
87                &block2::Block<dyn Fn() -> NonNull<UIActivityViewController>>,
88            >,
89        );
90
91        /// If enabled, shows an icon representation of the document in the navigation bar.
92        #[unsafe(method(wantsIconRepresentation))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn wantsIconRepresentation(&self) -> bool;
95
96        /// Setter for [`wantsIconRepresentation`][Self::wantsIconRepresentation].
97        #[unsafe(method(setWantsIconRepresentation:))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn setWantsIconRepresentation(&self, wants_icon_representation: bool);
100    );
101}