objc2_cloud_kit/generated/
NSItemProvider_CKSharingSupport.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
10/// [Apple's documentation](https://developer.apple.com/documentation/cloudkit/cksharepreparationcompletionhandler?language=objc)
11#[cfg(all(feature = "CKRecord", feature = "CKShare", feature = "block2"))]
12pub type CKSharePreparationCompletionHandler =
13    *mut block2::Block<dyn Fn(*mut CKShare, *mut NSError)>;
14
15/// [Apple's documentation](https://developer.apple.com/documentation/cloudkit/cksharepreparationhandler?language=objc)
16#[cfg(all(feature = "CKRecord", feature = "CKShare", feature = "block2"))]
17pub type CKSharePreparationHandler =
18    *mut block2::Block<dyn Fn(CKSharePreparationCompletionHandler)>;
19
20mod private_NSItemProviderCKSharingSupport {
21    pub trait Sealed {}
22}
23
24/// Category "CKSharingSupport" on [`NSItemProvider`].
25#[doc(alias = "CKSharingSupport")]
26pub unsafe trait NSItemProviderCKSharingSupport:
27    ClassType + Sized + private_NSItemProviderCKSharingSupport::Sealed
28{
29    extern_methods!(
30        #[cfg(all(
31            feature = "CKAllowedSharingOptions",
32            feature = "CKContainer",
33            feature = "CKRecord",
34            feature = "CKShare",
35            feature = "block2"
36        ))]
37        /// Use this method when you want to share a collection of
38        /// `CKRecords`but don't currently have a
39        /// `CKShare.`When the
40        /// `preparationHandler`is called, you should create a new
41        /// `CKShare`with the appropriate root
42        /// `CKRecord`or
43        /// `CKRecordZoneID.`After ensuring the share and all records have been saved to the server, invoke the
44        /// `preparationCompletionHandler`with either the resulting
45        /// `CKShare,`or an
46        /// `NSError`if saving failed. Invoking the share sheet with a
47        /// `CKShare`registered with this method will prompt the user to start sharing.
48        #[unsafe(method(registerCKShareWithContainer:allowedSharingOptions:preparationHandler:))]
49        #[unsafe(method_family = none)]
50        unsafe fn registerCKShareWithContainer_allowedSharingOptions_preparationHandler(
51            &self,
52            container: &CKContainer,
53            allowed_options: &CKAllowedSharingOptions,
54            preparation_handler: CKSharePreparationHandler,
55        );
56
57        #[cfg(all(
58            feature = "CKAllowedSharingOptions",
59            feature = "CKContainer",
60            feature = "CKRecord",
61            feature = "CKShare"
62        ))]
63        /// Use this method when you have a
64        /// `CKShare`that is already saved to the server. Invoking the share sheet with a
65        /// `CKShare`registered with this method will allow the owner to make modifications to the share settings, or will allow a participant to view the share settings.
66        #[unsafe(method(registerCKShare:container:allowedSharingOptions:))]
67        #[unsafe(method_family = none)]
68        unsafe fn registerCKShare_container_allowedSharingOptions(
69            &self,
70            share: &CKShare,
71            container: &CKContainer,
72            allowed_options: &CKAllowedSharingOptions,
73        );
74    );
75}
76
77impl private_NSItemProviderCKSharingSupport::Sealed for NSItemProvider {}
78unsafe impl NSItemProviderCKSharingSupport for NSItemProvider {}