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        #[unsafe(method(setStartingToken:))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn setStartingToken(&self, starting_token: Option<&NSData>);
59
60        #[cfg(feature = "CNContact")]
61        /// Additional keys to include in the fetched contacts.
62        ///
63        ///
64        /// By default, only
65        /// `CNContactIdentifierKey`will be fetched. If you
66        /// would like to include additional key descriptors to process the contacts,
67        /// include the key descriptors you need.
68        ///
69        /// `CNContactIdentifierKey`will always be fetched, whether you
70        /// request it or not.
71        #[unsafe(method(additionalContactKeyDescriptors))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn additionalContactKeyDescriptors(
74            &self,
75        ) -> Option<Retained<NSArray<ProtocolObject<dyn CNKeyDescriptor>>>>;
76
77        #[cfg(feature = "CNContact")]
78        /// Setter for [`additionalContactKeyDescriptors`][Self::additionalContactKeyDescriptors].
79        #[unsafe(method(setAdditionalContactKeyDescriptors:))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn setAdditionalContactKeyDescriptors(
82            &self,
83            additional_contact_key_descriptors: Option<
84                &NSArray<ProtocolObject<dyn CNKeyDescriptor>>,
85            >,
86        );
87
88        /// Returns contact changes as unified contacts.
89        ///
90        ///
91        /// If
92        /// `YES,`returns unified contact history. Otherwise returns individual contact history. Default is
93        /// `YES.`
94        ///
95        /// Note: A unified contact is the aggregation of properties from a set of linked individual contacts.
96        /// If an individual contact is not linked then the unified contact is simply that individual contact.
97        #[unsafe(method(shouldUnifyResults))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn shouldUnifyResults(&self) -> bool;
100
101        /// Setter for [`shouldUnifyResults`][Self::shouldUnifyResults].
102        #[unsafe(method(setShouldUnifyResults:))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn setShouldUnifyResults(&self, should_unify_results: bool);
105
106        /// To return mutable contacts and groups.
107        ///
108        ///
109        /// If
110        /// `YES`returns mutable contacts and groups. Default is
111        /// `NO.`
112        #[unsafe(method(mutableObjects))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn mutableObjects(&self) -> bool;
115
116        /// Setter for [`mutableObjects`][Self::mutableObjects].
117        #[unsafe(method(setMutableObjects:))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn setMutableObjects(&self, mutable_objects: bool);
120
121        /// Set to
122        /// `YES`to also fetch group changes. Default is
123        /// `NO.`
124        #[unsafe(method(includeGroupChanges))]
125        #[unsafe(method_family = none)]
126        pub unsafe fn includeGroupChanges(&self) -> bool;
127
128        /// Setter for [`includeGroupChanges`][Self::includeGroupChanges].
129        #[unsafe(method(setIncludeGroupChanges:))]
130        #[unsafe(method_family = none)]
131        pub unsafe fn setIncludeGroupChanges(&self, include_group_changes: bool);
132
133        /// Exclude changes made by certain authors.
134        ///
135        ///
136        /// If set, transactions made by the specified authors will be excluded
137        /// from the results. Use this, in conjunction with
138        /// `CNSaveRequest.transactionAuthor,`to suppress processing of changes you already know about.
139        #[unsafe(method(excludedTransactionAuthors))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn excludedTransactionAuthors(&self) -> Option<Retained<NSArray<NSString>>>;
142
143        /// Setter for [`excludedTransactionAuthors`][Self::excludedTransactionAuthors].
144        #[unsafe(method(setExcludedTransactionAuthors:))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn setExcludedTransactionAuthors(
147            &self,
148            excluded_transaction_authors: Option<&NSArray<NSString>>,
149        );
150    );
151}
152
153/// Methods declared on superclass `NSObject`.
154#[cfg(feature = "CNFetchRequest")]
155impl CNChangeHistoryFetchRequest {
156    extern_methods!(
157        #[unsafe(method(init))]
158        #[unsafe(method_family = init)]
159        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
160
161        #[unsafe(method(new))]
162        #[unsafe(method_family = new)]
163        pub unsafe fn new() -> Retained<Self>;
164    );
165}