objc2_contacts/generated/
CNChangeHistoryFetchRequest.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    /// Specifies the criteria to fetch change history.
12    ///
13    ///
14    /// Changes to contacts are always returned.
15    /// All changes are coalesced to remove redundant adds, updates and deletes.
16    /// This request is used with [CNContactStore enumeratorForChangeHistoryFetchRequest:error:].
17    ///
18    /// See also [Apple's documentation](https://developer.apple.com/documentation/contacts/cnchangehistoryfetchrequest?language=objc)
19    #[unsafe(super(CNFetchRequest, NSObject))]
20    #[derive(Debug, PartialEq, Eq, Hash)]
21    #[cfg(feature = "CNFetchRequest")]
22    pub struct CNChangeHistoryFetchRequest;
23);
24
25#[cfg(feature = "CNFetchRequest")]
26extern_conformance!(
27    unsafe impl NSCoding for CNChangeHistoryFetchRequest {}
28);
29
30#[cfg(feature = "CNFetchRequest")]
31extern_conformance!(
32    unsafe impl NSObjectProtocol for CNChangeHistoryFetchRequest {}
33);
34
35#[cfg(feature = "CNFetchRequest")]
36extern_conformance!(
37    unsafe impl NSSecureCoding for CNChangeHistoryFetchRequest {}
38);
39
40#[cfg(feature = "CNFetchRequest")]
41impl CNChangeHistoryFetchRequest {
42    extern_methods!(
43        /// Request changes made after a certain point.
44        ///
45        ///
46        /// If non-nil, only changes made after this point in history will be returned.
47        ///
48        /// If nil, a
49        /// `CNChangeHistoryDropEverythingEvent`will be returned, followed by an add event
50        /// for every contact and group currently in the contacts database.
51        #[unsafe(method(startingToken))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn startingToken(&self) -> Option<Retained<NSData>>;
54
55        /// Setter for [`startingToken`][Self::startingToken].
56        ///
57        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
58        #[unsafe(method(setStartingToken:))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn setStartingToken(&self, starting_token: Option<&NSData>);
61
62        #[cfg(feature = "CNContact")]
63        /// Additional keys to include in the fetched contacts.
64        ///
65        ///
66        /// By default, only
67        /// `CNContactIdentifierKey`will be fetched. If you
68        /// would like to include additional key descriptors to process the contacts,
69        /// include the key descriptors you need.
70        ///
71        /// `CNContactIdentifierKey`will always be fetched, whether you
72        /// request it or not.
73        #[unsafe(method(additionalContactKeyDescriptors))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn additionalContactKeyDescriptors(
76            &self,
77        ) -> Option<Retained<NSArray<ProtocolObject<dyn CNKeyDescriptor>>>>;
78
79        #[cfg(feature = "CNContact")]
80        /// Setter for [`additionalContactKeyDescriptors`][Self::additionalContactKeyDescriptors].
81        ///
82        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
83        #[unsafe(method(setAdditionalContactKeyDescriptors:))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn setAdditionalContactKeyDescriptors(
86            &self,
87            additional_contact_key_descriptors: Option<
88                &NSArray<ProtocolObject<dyn CNKeyDescriptor>>,
89            >,
90        );
91
92        /// Returns contact changes as unified contacts.
93        ///
94        ///
95        /// If
96        /// `YES,`returns unified contact history. Otherwise returns individual contact history. Default is
97        /// `YES.`
98        ///
99        /// Note: A unified contact is the aggregation of properties from a set of linked individual contacts.
100        /// If an individual contact is not linked then the unified contact is simply that individual contact.
101        #[unsafe(method(shouldUnifyResults))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn shouldUnifyResults(&self) -> bool;
104
105        /// Setter for [`shouldUnifyResults`][Self::shouldUnifyResults].
106        #[unsafe(method(setShouldUnifyResults:))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn setShouldUnifyResults(&self, should_unify_results: bool);
109
110        /// To return mutable contacts and groups.
111        ///
112        ///
113        /// If
114        /// `YES`returns mutable contacts and groups. Default is
115        /// `NO.`
116        #[unsafe(method(mutableObjects))]
117        #[unsafe(method_family = none)]
118        pub unsafe fn mutableObjects(&self) -> bool;
119
120        /// Setter for [`mutableObjects`][Self::mutableObjects].
121        #[unsafe(method(setMutableObjects:))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn setMutableObjects(&self, mutable_objects: bool);
124
125        /// Set to
126        /// `YES`to also fetch group changes. Default is
127        /// `NO.`
128        #[unsafe(method(includeGroupChanges))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn includeGroupChanges(&self) -> bool;
131
132        /// Setter for [`includeGroupChanges`][Self::includeGroupChanges].
133        #[unsafe(method(setIncludeGroupChanges:))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn setIncludeGroupChanges(&self, include_group_changes: bool);
136
137        /// Exclude changes made by certain authors.
138        ///
139        ///
140        /// If set, transactions made by the specified authors will be excluded
141        /// from the results. Use this, in conjunction with
142        /// `CNSaveRequest.transactionAuthor,`to suppress processing of changes you already know about.
143        #[unsafe(method(excludedTransactionAuthors))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn excludedTransactionAuthors(&self) -> Option<Retained<NSArray<NSString>>>;
146
147        /// Setter for [`excludedTransactionAuthors`][Self::excludedTransactionAuthors].
148        ///
149        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
150        #[unsafe(method(setExcludedTransactionAuthors:))]
151        #[unsafe(method_family = none)]
152        pub unsafe fn setExcludedTransactionAuthors(
153            &self,
154            excluded_transaction_authors: Option<&NSArray<NSString>>,
155        );
156    );
157}
158
159/// Methods declared on superclass `NSObject`.
160#[cfg(feature = "CNFetchRequest")]
161impl CNChangeHistoryFetchRequest {
162    extern_methods!(
163        #[unsafe(method(init))]
164        #[unsafe(method_family = init)]
165        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
166
167        #[unsafe(method(new))]
168        #[unsafe(method_family = new)]
169        pub unsafe fn new() -> Retained<Self>;
170    );
171}