//! Mandatory `data.mimetype` constants. Mirrors AOSP's
//! `android.provider.ContactsContract.CommonDataKinds.*.CONTENT_ITEM_TYPE`.

pub const NAME: &str         = "vnd.android.cursor.item/name";
pub const PHONE_V2: &str     = "vnd.android.cursor.item/phone_v2";
pub const EMAIL_V2: &str     = "vnd.android.cursor.item/email_v2";
pub const POSTAL_V2: &str    = "vnd.android.cursor.item/postal-address_v2";
pub const PHOTO: &str        = "vnd.android.cursor.item/photo";
pub const ORGANIZATION: &str = "vnd.android.cursor.item/organization";
pub const NOTE: &str         = "vnd.android.cursor.item/note";
pub const EVENT: &str        = "vnd.android.cursor.item/contact_event";
pub const IM: &str           = "vnd.android.cursor.item/im";
pub const WEBSITE: &str      = "vnd.android.cursor.item/website";
pub const NICKNAME: &str     = "vnd.android.cursor.item/nickname";

pub const ALL: &[ &str ] = &[
	NAME, PHONE_V2, EMAIL_V2, POSTAL_V2, PHOTO,
	ORGANIZATION, NOTE, EVENT, IM, WEBSITE, NICKNAME,
];

/// Whether `mimetype` is one of the v1 first-class mimetypes. Unknown
/// mimetypes are still accepted by the data layer and serialised as
/// `X-LIBERUX-…` in vCard output (see `docs/vcard-mapping.md`).
pub fn is_known( mimetype: &str ) -> bool
{
	ALL.contains( &mimetype )
}
