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::DynBlock<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::DynBlock<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        ///
49        /// # Safety
50        ///
51        /// `preparation_handler` must be a valid pointer.
52        #[unsafe(method(registerCKShareWithContainer:allowedSharingOptions:preparationHandler:))]
53        #[unsafe(method_family = none)]
54        unsafe fn registerCKShareWithContainer_allowedSharingOptions_preparationHandler(
55            &self,
56            container: &CKContainer,
57            allowed_options: &CKAllowedSharingOptions,
58            preparation_handler: CKSharePreparationHandler,
59        );
60
61        #[cfg(all(
62            feature = "CKAllowedSharingOptions",
63            feature = "CKContainer",
64            feature = "CKRecord",
65            feature = "CKShare"
66        ))]
67        /// Use this method when you have a
68        /// `CKShare`that is already saved to the server. Invoking the share sheet with a
69        /// `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.
70        #[unsafe(method(registerCKShare:container:allowedSharingOptions:))]
71        #[unsafe(method_family = none)]
72        unsafe fn registerCKShare_container_allowedSharingOptions(
73            &self,
74            share: &CKShare,
75            container: &CKContainer,
76            allowed_options: &CKAllowedSharingOptions,
77        );
78    );
79}
80
81impl private_NSItemProviderCKSharingSupport::Sealed for NSItemProvider {}
82unsafe impl NSItemProviderCKSharingSupport for NSItemProvider {}