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