objc2_contacts/generated/CNContact_Predicates.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9/// Predicates.
10///
11/// The predicates to match contacts against.
12///
13///
14/// Can only use these predicates with CNContactStore and CNContactFetchRequest.
15#[cfg(feature = "CNContact")]
16impl CNContact {
17 extern_methods!(
18 /// To fetch contacts matching a name.
19 ///
20 ///
21 /// The name can contain any number of words.
22 #[unsafe(method(predicateForContactsMatchingName:))]
23 #[unsafe(method_family = none)]
24 pub unsafe fn predicateForContactsMatchingName(name: &NSString) -> Retained<NSPredicate>;
25
26 /// Fetch contacts matching an email address.
27 ///
28 ///
29 /// Use this predicate to find the contact(s) which contain the specified
30 /// email address. The search is not case-sensitive.
31 ///
32 ///
33 /// Parameter `emailAddress`: The email address to search for. Do not include a scheme (e.g., "mailto:").
34 #[unsafe(method(predicateForContactsMatchingEmailAddress:))]
35 #[unsafe(method_family = none)]
36 pub unsafe fn predicateForContactsMatchingEmailAddress(
37 email_address: &NSString,
38 ) -> Retained<NSPredicate>;
39
40 #[cfg(feature = "CNPhoneNumber")]
41 /// Fetch contacts matching a phone number.
42 ///
43 ///
44 /// If the predicate and contact differ in their use or presence of country
45 /// codes, a best effort will be made to match results; however, inexact
46 /// matches are not guaranteed.
47 ///
48 ///
49 /// Parameter `phoneNumber`: A
50 /// `CNPhoneNumber`representing the phone number to search for.
51 /// Do not include a scheme (e.g., "tel:").
52 #[unsafe(method(predicateForContactsMatchingPhoneNumber:))]
53 #[unsafe(method_family = none)]
54 pub unsafe fn predicateForContactsMatchingPhoneNumber(
55 phone_number: &CNPhoneNumber,
56 ) -> Retained<NSPredicate>;
57
58 /// To fetch contacts matching contact identifiers.
59 #[unsafe(method(predicateForContactsWithIdentifiers:))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn predicateForContactsWithIdentifiers(
62 identifiers: &NSArray<NSString>,
63 ) -> Retained<NSPredicate>;
64
65 #[unsafe(method(predicateForContactsInGroupWithIdentifier:))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn predicateForContactsInGroupWithIdentifier(
68 group_identifier: &NSString,
69 ) -> Retained<NSPredicate>;
70
71 #[unsafe(method(predicateForContactsInContainerWithIdentifier:))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn predicateForContactsInContainerWithIdentifier(
74 container_identifier: &NSString,
75 ) -> Retained<NSPredicate>;
76 );
77}