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
//! 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_class!(
/// Specifies the search criteria to fetch contacts.
///
///
/// Used with [CNContactStore enumerateContactsWithFetchRequest:error:usingBlock:]. Can combine any of these options to create a contact fetch request.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/contacts/cncontactfetchrequest?language=objc)
#[unsafe(super(CNFetchRequest, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "CNFetchRequest")]
pub struct CNContactFetchRequest;
);
#[cfg(feature = "CNFetchRequest")]
extern_conformance!(
unsafe impl NSCoding for CNContactFetchRequest {}
);
#[cfg(feature = "CNFetchRequest")]
extern_conformance!(
unsafe impl NSObjectProtocol for CNContactFetchRequest {}
);
#[cfg(feature = "CNFetchRequest")]
extern_conformance!(
unsafe impl NSSecureCoding for CNContactFetchRequest {}
);
#[cfg(feature = "CNFetchRequest")]
impl CNContactFetchRequest {
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>;
#[cfg(feature = "CNContact")]
/// Parameter `keysToFetch`: The properties to fetch for the returned contacts.
///
///
/// Only fetch the properties that will be used.
#[unsafe(method(initWithKeysToFetch:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithKeysToFetch(
this: Allocated<Self>,
keys_to_fetch: &NSArray<ProtocolObject<dyn CNKeyDescriptor>>,
) -> Retained<Self>;
/// The predicate to match contacts against.
///
///
/// Use only predicates from CNContact+Predicates.h. Compound predicates are not supported. Set to nil to match all contacts.
#[unsafe(method(predicate))]
#[unsafe(method_family = none)]
pub unsafe fn predicate(&self) -> Option<Retained<NSPredicate>>;
/// Setter for [`predicate`][Self::predicate].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setPredicate:))]
#[unsafe(method_family = none)]
pub unsafe fn setPredicate(&self, predicate: Option<&NSPredicate>);
#[cfg(feature = "CNContact")]
/// The properties to fetch in the returned contacts.
///
///
/// Should only fetch the properties that will be used. Can combine contact keys and contact key descriptors.
#[unsafe(method(keysToFetch))]
#[unsafe(method_family = none)]
pub unsafe fn keysToFetch(&self) -> Retained<NSArray<ProtocolObject<dyn CNKeyDescriptor>>>;
#[cfg(feature = "CNContact")]
/// Setter for [`keysToFetch`][Self::keysToFetch].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setKeysToFetch:))]
#[unsafe(method_family = none)]
pub unsafe fn setKeysToFetch(
&self,
keys_to_fetch: &NSArray<ProtocolObject<dyn CNKeyDescriptor>>,
);
/// To return mutable contacts.
///
///
/// If YES returns CNMutableContact objects, otherwise returns CNContact objects. Default is NO.
#[unsafe(method(mutableObjects))]
#[unsafe(method_family = none)]
pub unsafe fn mutableObjects(&self) -> bool;
/// Setter for [`mutableObjects`][Self::mutableObjects].
#[unsafe(method(setMutableObjects:))]
#[unsafe(method_family = none)]
pub unsafe fn setMutableObjects(&self, mutable_objects: bool);
/// To return linked contacts as unified contacts.
///
///
/// If YES returns unified contacts, otherwise returns individual contacts. Default is YES.
///
///
/// Note: A unified contact is the aggregation of properties from a set of linked individual contacts. If an individual contact is not linked then the unified contact is simply that individual contact.
#[unsafe(method(unifyResults))]
#[unsafe(method_family = none)]
pub unsafe fn unifyResults(&self) -> bool;
/// Setter for [`unifyResults`][Self::unifyResults].
#[unsafe(method(setUnifyResults:))]
#[unsafe(method_family = none)]
pub unsafe fn setUnifyResults(&self, unify_results: bool);
#[cfg(feature = "CNContact")]
/// To return contacts in a specific sort order.
///
///
/// Default is CNContactSortOrderNone.
#[unsafe(method(sortOrder))]
#[unsafe(method_family = none)]
pub unsafe fn sortOrder(&self) -> CNContactSortOrder;
#[cfg(feature = "CNContact")]
/// Setter for [`sortOrder`][Self::sortOrder].
#[unsafe(method(setSortOrder:))]
#[unsafe(method_family = none)]
pub unsafe fn setSortOrder(&self, sort_order: CNContactSortOrder);
);
}