objc2-contacts 0.3.2

Bindings to the Contacts framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// Predicates.
///
/// The predicates to match contacts against.
///
///
/// Can only use these predicates with CNContactStore and CNContactFetchRequest.
#[cfg(feature = "CNContact")]
impl CNContact {
    extern_methods!(
        /// To fetch contacts matching a name.
        ///
        ///
        /// The name can contain any number of words.
        #[unsafe(method(predicateForContactsMatchingName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn predicateForContactsMatchingName(name: &NSString) -> Retained<NSPredicate>;

        /// Fetch contacts matching an email address.
        ///
        ///
        /// Use this predicate to find the contact(s) which contain the specified
        /// email address. The search is not case-sensitive.
        ///
        ///
        /// Parameter `emailAddress`: The email address to search for. Do not include a scheme (e.g., "mailto:").
        #[unsafe(method(predicateForContactsMatchingEmailAddress:))]
        #[unsafe(method_family = none)]
        pub unsafe fn predicateForContactsMatchingEmailAddress(
            email_address: &NSString,
        ) -> Retained<NSPredicate>;

        #[cfg(feature = "CNPhoneNumber")]
        /// Fetch contacts matching a phone number.
        ///
        ///
        /// If the predicate and contact differ in their use or presence of country
        /// codes, a best effort will be made to match results; however, inexact
        /// matches are not guaranteed.
        ///
        ///
        /// Parameter `phoneNumber`: A
        /// `CNPhoneNumber`representing the phone number to search for.
        /// Do not include a scheme (e.g., "tel:").
        #[unsafe(method(predicateForContactsMatchingPhoneNumber:))]
        #[unsafe(method_family = none)]
        pub unsafe fn predicateForContactsMatchingPhoneNumber(
            phone_number: &CNPhoneNumber,
        ) -> Retained<NSPredicate>;

        /// To fetch contacts matching contact identifiers.
        #[unsafe(method(predicateForContactsWithIdentifiers:))]
        #[unsafe(method_family = none)]
        pub unsafe fn predicateForContactsWithIdentifiers(
            identifiers: &NSArray<NSString>,
        ) -> Retained<NSPredicate>;

        #[unsafe(method(predicateForContactsInGroupWithIdentifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn predicateForContactsInGroupWithIdentifier(
            group_identifier: &NSString,
        ) -> Retained<NSPredicate>;

        #[unsafe(method(predicateForContactsInContainerWithIdentifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn predicateForContactsInContainerWithIdentifier(
            container_identifier: &NSString,
        ) -> Retained<NSPredicate>;
    );
}