objc2_cloud_kit/generated/
CKAcceptSharesOperation.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/cloudkit/ckacceptsharesoperation?language=objc)
12    #[unsafe(super(CKOperation, NSOperation, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "CKOperation")]
15    pub struct CKAcceptSharesOperation;
16);
17
18#[cfg(feature = "CKOperation")]
19unsafe impl NSObjectProtocol for CKAcceptSharesOperation {}
20
21#[cfg(feature = "CKOperation")]
22impl CKAcceptSharesOperation {
23    extern_methods!(
24        #[unsafe(method(init))]
25        #[unsafe(method_family = init)]
26        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
27
28        #[cfg(feature = "CKShareMetadata")]
29        #[unsafe(method(initWithShareMetadatas:))]
30        #[unsafe(method_family = init)]
31        pub unsafe fn initWithShareMetadatas(
32            this: Allocated<Self>,
33            share_metadatas: &NSArray<CKShareMetadata>,
34        ) -> Retained<Self>;
35
36        #[cfg(feature = "CKShareMetadata")]
37        #[unsafe(method(shareMetadatas))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn shareMetadatas(&self) -> Option<Retained<NSArray<CKShareMetadata>>>;
40
41        #[cfg(feature = "CKShareMetadata")]
42        /// Setter for [`shareMetadatas`][Self::shareMetadatas].
43        #[unsafe(method(setShareMetadatas:))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn setShareMetadatas(&self, share_metadatas: Option<&NSArray<CKShareMetadata>>);
46
47        #[cfg(all(
48            feature = "CKRecord",
49            feature = "CKShare",
50            feature = "CKShareMetadata",
51            feature = "block2"
52        ))]
53        /// Called once for each share metadata that the server processed
54        ///
55        ///
56        /// If error is nil then the share was successfully accepted.
57        /// Each
58        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
59        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
60        /// should not be concurrently used outside of blocks assigned to this operation.
61        #[unsafe(method(perShareCompletionBlock))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn perShareCompletionBlock(
64            &self,
65        ) -> *mut block2::Block<dyn Fn(NonNull<CKShareMetadata>, *mut CKShare, *mut NSError)>;
66
67        #[cfg(all(
68            feature = "CKRecord",
69            feature = "CKShare",
70            feature = "CKShareMetadata",
71            feature = "block2"
72        ))]
73        /// Setter for [`perShareCompletionBlock`][Self::perShareCompletionBlock].
74        #[unsafe(method(setPerShareCompletionBlock:))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn setPerShareCompletionBlock(
77            &self,
78            per_share_completion_block: Option<
79                &block2::Block<dyn Fn(NonNull<CKShareMetadata>, *mut CKShare, *mut NSError)>,
80            >,
81        );
82
83        #[cfg(feature = "block2")]
84        /// This block is called when the operation completes.
85        ///
86        ///
87        /// The
88        ///
89        /// ```text
90        ///  -[NSOperation completionBlock]
91        /// ```
92        ///
93        /// will also be called if both are set.
94        /// If the error is
95        /// `CKErrorPartialFailure,`the error's userInfo dictionary contains a dictionary of shareURLs to errors keyed off of
96        /// `CKPartialErrorsByItemIDKey.`These errors are repeats of those sent back in previous
97        /// `perShareCompletionBlock`invocations
98        /// Each
99        /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
100        /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
101        /// should not be concurrently used outside of blocks assigned to this operation.
102        #[unsafe(method(acceptSharesCompletionBlock))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn acceptSharesCompletionBlock(
105            &self,
106        ) -> *mut block2::Block<dyn Fn(*mut NSError)>;
107
108        #[cfg(feature = "block2")]
109        /// Setter for [`acceptSharesCompletionBlock`][Self::acceptSharesCompletionBlock].
110        #[unsafe(method(setAcceptSharesCompletionBlock:))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn setAcceptSharesCompletionBlock(
113            &self,
114            accept_shares_completion_block: Option<&block2::Block<dyn Fn(*mut NSError)>>,
115        );
116    );
117}
118
119/// Methods declared on superclass `NSObject`.
120#[cfg(feature = "CKOperation")]
121impl CKAcceptSharesOperation {
122    extern_methods!(
123        #[unsafe(method(new))]
124        #[unsafe(method_family = new)]
125        pub unsafe fn new() -> Retained<Self>;
126    );
127}