objc2_call_kit/generated/
CXCallDirectoryExtensionContext.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_protocol!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/callkit/cxcalldirectoryextensioncontextdelegate?language=objc)
12    pub unsafe trait CXCallDirectoryExtensionContextDelegate: NSObjectProtocol {
13        #[unsafe(method(requestFailedForExtensionContext:withError:))]
14        #[unsafe(method_family = none)]
15        unsafe fn requestFailedForExtensionContext_withError(
16            &self,
17            extension_context: &CXCallDirectoryExtensionContext,
18            error: &NSError,
19        );
20    }
21);
22
23extern_class!(
24    /// [Apple's documentation](https://developer.apple.com/documentation/callkit/cxcalldirectoryextensioncontext?language=objc)
25    #[unsafe(super(NSExtensionContext, NSObject))]
26    #[derive(Debug, PartialEq, Eq, Hash)]
27    pub struct CXCallDirectoryExtensionContext;
28);
29
30extern_conformance!(
31    unsafe impl NSObjectProtocol for CXCallDirectoryExtensionContext {}
32);
33
34impl CXCallDirectoryExtensionContext {
35    extern_methods!(
36        #[unsafe(method(delegate))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn delegate(
39            &self,
40        ) -> Option<Retained<ProtocolObject<dyn CXCallDirectoryExtensionContextDelegate>>>;
41
42        /// This is a [weak property][objc2::topics::weak_property].
43        /// Setter for [`delegate`][Self::delegate].
44        #[unsafe(method(setDelegate:))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn setDelegate(
47            &self,
48            delegate: Option<&ProtocolObject<dyn CXCallDirectoryExtensionContextDelegate>>,
49        );
50
51        /// Whether the request should provide incremental data.
52        ///
53        /// If this is called at the beginning of the request (before any entries have been added or removed) and the result is YES,
54        /// then the request must only provide an "incremental" set of entries, i.e. only add or remove entries relative to the last time data
55        /// was loaded for the extension. Otherwise, if this method is not called OR is called and returns NO, then the request must provide
56        /// a "complete" set of entries, adding the full list of entries from scratch (and removing none), regardless of whether data has ever been
57        /// successfully loaded in the past.
58        #[unsafe(method(isIncremental))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn isIncremental(&self) -> bool;
61
62        #[cfg(feature = "CXCallDirectory")]
63        #[unsafe(method(addBlockingEntryWithNextSequentialPhoneNumber:))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn addBlockingEntryWithNextSequentialPhoneNumber(
66            &self,
67            phone_number: CXCallDirectoryPhoneNumber,
68        );
69
70        #[cfg(feature = "CXCallDirectory")]
71        /// Remove blocking entry with the specified phone number.
72        ///
73        /// May only be used when `-isIncremental` returns YES, indicating that the request should provide incremental entries and thus may use this
74        /// API to remove a previously-added blocking entry.
75        ///
76        ///
77        /// Parameter `phoneNumber`: The blocking entry phone number to remove.
78        #[unsafe(method(removeBlockingEntryWithPhoneNumber:))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn removeBlockingEntryWithPhoneNumber(
81            &self,
82            phone_number: CXCallDirectoryPhoneNumber,
83        );
84
85        /// Remove all currently-stored blocking entries.
86        ///
87        /// May only be used when `-isIncremental` returns YES, indicating that the request should provide incremental entries and thus may use this
88        /// API to remove all previously-added blocking entries.
89        #[unsafe(method(removeAllBlockingEntries))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn removeAllBlockingEntries(&self);
92
93        #[cfg(feature = "CXCallDirectory")]
94        #[unsafe(method(addIdentificationEntryWithNextSequentialPhoneNumber:label:))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn addIdentificationEntryWithNextSequentialPhoneNumber_label(
97            &self,
98            phone_number: CXCallDirectoryPhoneNumber,
99            label: &NSString,
100        );
101
102        #[cfg(feature = "CXCallDirectory")]
103        /// Remove identification entry with the specified phone number.
104        ///
105        /// May only be used when `-isIncremental` returns YES, indicating that the request should provide incremental entries and thus may use this
106        /// API to remove a previously-added identification entry. Removes all identification entries with the specified phone number, even if
107        /// multiple identification entries with different labels are present for a single phone number.
108        ///
109        ///
110        /// Parameter `phoneNumber`: The identification entry phone number to remove.
111        #[unsafe(method(removeIdentificationEntryWithPhoneNumber:))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn removeIdentificationEntryWithPhoneNumber(
114            &self,
115            phone_number: CXCallDirectoryPhoneNumber,
116        );
117
118        /// Remove all currently-stored identification entries.
119        ///
120        /// May only be used when `-isIncremental` returns YES, indicating that the request should provide incremental entries and thus may use this
121        /// API to remove all previously-added identification entries.
122        #[unsafe(method(removeAllIdentificationEntries))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn removeAllIdentificationEntries(&self);
125
126        #[cfg(feature = "block2")]
127        #[unsafe(method(completeRequestWithCompletionHandler:))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn completeRequestWithCompletionHandler(
130            &self,
131            completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
132        );
133
134        #[cfg(feature = "block2")]
135        #[unsafe(method(completeRequestReturningItems:completionHandler:))]
136        #[unsafe(method_family = none)]
137        pub unsafe fn completeRequestReturningItems_completionHandler(
138            &self,
139            items: Option<&NSArray>,
140            completion_handler: Option<&block2::DynBlock<dyn Fn(Bool)>>,
141        );
142    );
143}
144
145/// Methods declared on superclass `NSObject`.
146impl CXCallDirectoryExtensionContext {
147    extern_methods!(
148        #[unsafe(method(init))]
149        #[unsafe(method_family = init)]
150        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
151
152        #[unsafe(method(new))]
153        #[unsafe(method_family = new)]
154        pub unsafe fn new() -> Retained<Self>;
155    );
156}