objc2-core-services 0.3.2

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

use crate::*;

/// Returns an dictionary attributes to display or show the
/// user for a given UTI type. This function does not walk up the
/// UTI hiearchy and perform a union of the information.
///
/// Parameter `utiType`: the UTI type to be interrogated.
///
/// Returns: A CFDictionaryRef with keys ==  to kMDAttributeDisplayValues etc..
///
/// # Safety
///
/// `content_type_uti` might not allow `None`.
#[inline]
pub unsafe extern "C-unwind" fn MDSchemaCopyAttributesForContentType(
    content_type_uti: Option<&CFString>,
) -> Option<CFRetained<CFDictionary>> {
    extern "C-unwind" {
        fn MDSchemaCopyAttributesForContentType(
            content_type_uti: Option<&CFString>,
        ) -> Option<NonNull<CFDictionary>>;
    }
    let ret = unsafe { MDSchemaCopyAttributesForContentType(content_type_uti) };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}

/// Returns an dictionary of the meta attributes of attribute
///
/// Parameter `name`: the attribute whose schema you are interested in.
///
/// Returns: A CFDictionary of the description of the attribute.
///
/// # Safety
///
/// `name` might not allow `None`.
#[inline]
pub unsafe extern "C-unwind" fn MDSchemaCopyMetaAttributesForAttribute(
    name: Option<&CFString>,
) -> Option<CFRetained<CFDictionary>> {
    extern "C-unwind" {
        fn MDSchemaCopyMetaAttributesForAttribute(
            name: Option<&CFString>,
        ) -> Option<NonNull<CFDictionary>>;
    }
    let ret = unsafe { MDSchemaCopyMetaAttributesForAttribute(name) };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}

/// Returns an array of all of the attributes defined in the schema
///
/// Returns: A CFArray of the attribute names.
#[inline]
pub unsafe extern "C-unwind" fn MDSchemaCopyAllAttributes() -> Option<CFRetained<CFArray>> {
    extern "C-unwind" {
        fn MDSchemaCopyAllAttributes() -> Option<NonNull<CFArray>>;
    }
    let ret = unsafe { MDSchemaCopyAllAttributes() };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}

/// Returns the localized name of an attribute
///
/// Parameter `name`: the attribute whose localization you are interested in
///
/// Returns: the localized name of the passed in attribute, or NULL if there is
/// no localized name is avaliable.
///
/// # Safety
///
/// `name` might not allow `None`.
#[inline]
pub unsafe extern "C-unwind" fn MDSchemaCopyDisplayNameForAttribute(
    name: Option<&CFString>,
) -> Option<CFRetained<CFString>> {
    extern "C-unwind" {
        fn MDSchemaCopyDisplayNameForAttribute(
            name: Option<&CFString>,
        ) -> Option<NonNull<CFString>>;
    }
    let ret = unsafe { MDSchemaCopyDisplayNameForAttribute(name) };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}

/// Returns the localized description of an attribute.
///
/// Parameter `name`: the attribute whose localization you are interested in
///
/// Returns: the localized description of the passed in attribute, or NULL if there is
/// no localized description is avaliable.
///
/// # Safety
///
/// `name` might not allow `None`.
#[inline]
pub unsafe extern "C-unwind" fn MDSchemaCopyDisplayDescriptionForAttribute(
    name: Option<&CFString>,
) -> Option<CFRetained<CFString>> {
    extern "C-unwind" {
        fn MDSchemaCopyDisplayDescriptionForAttribute(
            name: Option<&CFString>,
        ) -> Option<NonNull<CFString>>;
    }
    let ret = unsafe { MDSchemaCopyDisplayDescriptionForAttribute(name) };
    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kmdattributedisplayvalues?language=objc)
    pub static kMDAttributeDisplayValues: Option<&'static CFString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kmdattributeallvalues?language=objc)
    pub static kMDAttributeAllValues: Option<&'static CFString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kmdattributereadonlyvalues?language=objc)
    pub static kMDAttributeReadOnlyValues: Option<&'static CFString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kmdexporteravaliable?language=objc)
    pub static kMDExporterAvaliable: Option<&'static CFString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kmdattributename?language=objc)
    pub static kMDAttributeName: Option<&'static CFString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kmdattributetype?language=objc)
    pub static kMDAttributeType: Option<&'static CFString>;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kmdattributemultivalued?language=objc)
    pub static kMDAttributeMultiValued: Option<&'static CFString>;
}