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
161
162
163
164
165
166
167
168
169
170
171
//! 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 criteria to fetch change history.
///
///
/// Changes to contacts are always returned.
/// All changes are coalesced to remove redundant adds, updates and deletes.
/// This request is used with [CNContactStore enumeratorForChangeHistoryFetchRequest:error:].
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/contacts/cnchangehistoryfetchrequest?language=objc)
#[unsafe(super(CNFetchRequest, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "CNFetchRequest")]
pub struct CNChangeHistoryFetchRequest;
);
#[cfg(feature = "CNFetchRequest")]
extern_conformance!(
unsafe impl NSCoding for CNChangeHistoryFetchRequest {}
);
#[cfg(feature = "CNFetchRequest")]
extern_conformance!(
unsafe impl NSObjectProtocol for CNChangeHistoryFetchRequest {}
);
#[cfg(feature = "CNFetchRequest")]
extern_conformance!(
unsafe impl NSSecureCoding for CNChangeHistoryFetchRequest {}
);
#[cfg(feature = "CNFetchRequest")]
impl CNChangeHistoryFetchRequest {
extern_methods!(
/// Request changes made after a certain point.
///
///
/// If non-nil, only changes made after this point in history will be returned.
///
/// If nil, a
/// `CNChangeHistoryDropEverythingEvent`will be returned, followed by an add event
/// for every contact and group currently in the contacts database.
#[unsafe(method(startingToken))]
#[unsafe(method_family = none)]
pub unsafe fn startingToken(&self) -> Option<Retained<NSData>>;
/// Setter for [`startingToken`][Self::startingToken].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setStartingToken:))]
#[unsafe(method_family = none)]
pub unsafe fn setStartingToken(&self, starting_token: Option<&NSData>);
#[cfg(feature = "CNContact")]
/// Additional keys to include in the fetched contacts.
///
///
/// By default, only
/// `CNContactIdentifierKey`will be fetched. If you
/// would like to include additional key descriptors to process the contacts,
/// include the key descriptors you need.
///
/// `CNContactIdentifierKey`will always be fetched, whether you
/// request it or not.
#[unsafe(method(additionalContactKeyDescriptors))]
#[unsafe(method_family = none)]
pub unsafe fn additionalContactKeyDescriptors(
&self,
) -> Option<Retained<NSArray<ProtocolObject<dyn CNKeyDescriptor>>>>;
#[cfg(feature = "CNContact")]
/// Setter for [`additionalContactKeyDescriptors`][Self::additionalContactKeyDescriptors].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setAdditionalContactKeyDescriptors:))]
#[unsafe(method_family = none)]
pub unsafe fn setAdditionalContactKeyDescriptors(
&self,
additional_contact_key_descriptors: Option<
&NSArray<ProtocolObject<dyn CNKeyDescriptor>>,
>,
);
/// Returns contact changes as unified contacts.
///
///
/// If
/// `YES,`returns unified contact history. Otherwise returns individual contact history. 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(shouldUnifyResults))]
#[unsafe(method_family = none)]
pub unsafe fn shouldUnifyResults(&self) -> bool;
/// Setter for [`shouldUnifyResults`][Self::shouldUnifyResults].
#[unsafe(method(setShouldUnifyResults:))]
#[unsafe(method_family = none)]
pub unsafe fn setShouldUnifyResults(&self, should_unify_results: bool);
/// To return mutable contacts and groups.
///
///
/// If
/// `YES`returns mutable contacts and groups. 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);
/// Set to
/// `YES`to also fetch group changes. Default is
/// `NO.`
#[unsafe(method(includeGroupChanges))]
#[unsafe(method_family = none)]
pub unsafe fn includeGroupChanges(&self) -> bool;
/// Setter for [`includeGroupChanges`][Self::includeGroupChanges].
#[unsafe(method(setIncludeGroupChanges:))]
#[unsafe(method_family = none)]
pub unsafe fn setIncludeGroupChanges(&self, include_group_changes: bool);
/// Exclude changes made by certain authors.
///
///
/// If set, transactions made by the specified authors will be excluded
/// from the results. Use this, in conjunction with
/// `CNSaveRequest.transactionAuthor,`to suppress processing of changes you already know about.
#[unsafe(method(excludedTransactionAuthors))]
#[unsafe(method_family = none)]
pub unsafe fn excludedTransactionAuthors(&self) -> Option<Retained<NSArray<NSString>>>;
/// Setter for [`excludedTransactionAuthors`][Self::excludedTransactionAuthors].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setExcludedTransactionAuthors:))]
#[unsafe(method_family = none)]
pub unsafe fn setExcludedTransactionAuthors(
&self,
excluded_transaction_authors: Option<&NSArray<NSString>>,
);
);
}
/// Methods declared on superclass `NSObject`.
#[cfg(feature = "CNFetchRequest")]
impl CNChangeHistoryFetchRequest {
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>;
);
}