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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
//! 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::*;
extern_protocol!(
/// [Apple's documentation](https://developer.apple.com/documentation/callkit/cxcalldirectoryextensioncontextdelegate?language=objc)
pub unsafe trait CXCallDirectoryExtensionContextDelegate: NSObjectProtocol {
#[unsafe(method(requestFailedForExtensionContext:withError:))]
#[unsafe(method_family = none)]
unsafe fn requestFailedForExtensionContext_withError(
&self,
extension_context: &CXCallDirectoryExtensionContext,
error: &NSError,
);
}
);
extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/callkit/cxcalldirectoryextensioncontext?language=objc)
#[unsafe(super(NSExtensionContext, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CXCallDirectoryExtensionContext;
);
extern_conformance!(
unsafe impl NSObjectProtocol for CXCallDirectoryExtensionContext {}
);
impl CXCallDirectoryExtensionContext {
extern_methods!(
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn CXCallDirectoryExtensionContextDelegate>>>;
/// Setter for [`delegate`][Self::delegate].
///
/// This is a [weak property][objc2::topics::weak_property].
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn CXCallDirectoryExtensionContextDelegate>>,
);
/// Whether the request should provide incremental data.
///
/// If this is called at the beginning of the request (before any entries have been added or removed) and the result is YES,
/// then the request must only provide an "incremental" set of entries, i.e. only add or remove entries relative to the last time data
/// was loaded for the extension. Otherwise, if this method is not called OR is called and returns NO, then the request must provide
/// a "complete" set of entries, adding the full list of entries from scratch (and removing none), regardless of whether data has ever been
/// successfully loaded in the past.
#[unsafe(method(isIncremental))]
#[unsafe(method_family = none)]
pub unsafe fn isIncremental(&self) -> bool;
#[cfg(feature = "CXCallDirectory")]
#[unsafe(method(addBlockingEntryWithNextSequentialPhoneNumber:))]
#[unsafe(method_family = none)]
pub unsafe fn addBlockingEntryWithNextSequentialPhoneNumber(
&self,
phone_number: CXCallDirectoryPhoneNumber,
);
#[cfg(feature = "CXCallDirectory")]
/// Remove blocking entry with the specified phone number.
///
/// May only be used when `-isIncremental` returns YES, indicating that the request should provide incremental entries and thus may use this
/// API to remove a previously-added blocking entry.
///
///
/// Parameter `phoneNumber`: The blocking entry phone number to remove.
#[unsafe(method(removeBlockingEntryWithPhoneNumber:))]
#[unsafe(method_family = none)]
pub unsafe fn removeBlockingEntryWithPhoneNumber(
&self,
phone_number: CXCallDirectoryPhoneNumber,
);
/// Remove all currently-stored blocking entries.
///
/// May only be used when `-isIncremental` returns YES, indicating that the request should provide incremental entries and thus may use this
/// API to remove all previously-added blocking entries.
#[unsafe(method(removeAllBlockingEntries))]
#[unsafe(method_family = none)]
pub unsafe fn removeAllBlockingEntries(&self);
#[cfg(feature = "CXCallDirectory")]
#[unsafe(method(addIdentificationEntryWithNextSequentialPhoneNumber:label:))]
#[unsafe(method_family = none)]
pub unsafe fn addIdentificationEntryWithNextSequentialPhoneNumber_label(
&self,
phone_number: CXCallDirectoryPhoneNumber,
label: &NSString,
);
#[cfg(feature = "CXCallDirectory")]
/// Remove identification entry with the specified phone number.
///
/// May only be used when `-isIncremental` returns YES, indicating that the request should provide incremental entries and thus may use this
/// API to remove a previously-added identification entry. Removes all identification entries with the specified phone number, even if
/// multiple identification entries with different labels are present for a single phone number.
///
///
/// Parameter `phoneNumber`: The identification entry phone number to remove.
#[unsafe(method(removeIdentificationEntryWithPhoneNumber:))]
#[unsafe(method_family = none)]
pub unsafe fn removeIdentificationEntryWithPhoneNumber(
&self,
phone_number: CXCallDirectoryPhoneNumber,
);
/// Remove all currently-stored identification entries.
///
/// May only be used when `-isIncremental` returns YES, indicating that the request should provide incremental entries and thus may use this
/// API to remove all previously-added identification entries.
#[unsafe(method(removeAllIdentificationEntries))]
#[unsafe(method_family = none)]
pub unsafe fn removeAllIdentificationEntries(&self);
#[cfg(feature = "block2")]
#[unsafe(method(completeRequestWithCompletionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn completeRequestWithCompletionHandler(
&self,
completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
);
#[cfg(feature = "block2")]
/// # Safety
///
/// `items` generic should be of the correct type.
#[unsafe(method(completeRequestReturningItems:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn completeRequestReturningItems_completionHandler(
&self,
items: Option<&NSArray>,
completion_handler: Option<&block2::DynBlock<dyn Fn(Bool)>>,
);
);
}
/// Methods declared on superclass `NSObject`.
impl CXCallDirectoryExtensionContext {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}