objc2_core_services/generated/Metadata/
MDSchema.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2_core_foundation::*;
5
6use crate::*;
7
8/// Returns an dictionary attributes to display or show the
9/// user for a given UTI type. This function does not walk up the
10/// UTI hiearchy and perform a union of the information.
11///
12/// Parameter `utiType`: the UTI type to be interrogated.
13///
14/// Returns: A CFDictionaryRef with keys ==  to kMDAttributeDisplayValues etc..
15///
16/// # Safety
17///
18/// `content_type_uti` might not allow `None`.
19#[inline]
20pub unsafe extern "C-unwind" fn MDSchemaCopyAttributesForContentType(
21    content_type_uti: Option<&CFString>,
22) -> Option<CFRetained<CFDictionary>> {
23    extern "C-unwind" {
24        fn MDSchemaCopyAttributesForContentType(
25            content_type_uti: Option<&CFString>,
26        ) -> Option<NonNull<CFDictionary>>;
27    }
28    let ret = unsafe { MDSchemaCopyAttributesForContentType(content_type_uti) };
29    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
30}
31
32/// Returns an dictionary of the meta attributes of attribute
33///
34/// Parameter `name`: the attribute whose schema you are interested in.
35///
36/// Returns: A CFDictionary of the description of the attribute.
37///
38/// # Safety
39///
40/// `name` might not allow `None`.
41#[inline]
42pub unsafe extern "C-unwind" fn MDSchemaCopyMetaAttributesForAttribute(
43    name: Option<&CFString>,
44) -> Option<CFRetained<CFDictionary>> {
45    extern "C-unwind" {
46        fn MDSchemaCopyMetaAttributesForAttribute(
47            name: Option<&CFString>,
48        ) -> Option<NonNull<CFDictionary>>;
49    }
50    let ret = unsafe { MDSchemaCopyMetaAttributesForAttribute(name) };
51    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
52}
53
54/// Returns an array of all of the attributes defined in the schema
55///
56/// Returns: A CFArray of the attribute names.
57#[inline]
58pub unsafe extern "C-unwind" fn MDSchemaCopyAllAttributes() -> Option<CFRetained<CFArray>> {
59    extern "C-unwind" {
60        fn MDSchemaCopyAllAttributes() -> Option<NonNull<CFArray>>;
61    }
62    let ret = unsafe { MDSchemaCopyAllAttributes() };
63    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
64}
65
66/// Returns the localized name of an attribute
67///
68/// Parameter `name`: the attribute whose localization you are interested in
69///
70/// Returns: the localized name of the passed in attribute, or NULL if there is
71/// no localized name is avaliable.
72///
73/// # Safety
74///
75/// `name` might not allow `None`.
76#[inline]
77pub unsafe extern "C-unwind" fn MDSchemaCopyDisplayNameForAttribute(
78    name: Option<&CFString>,
79) -> Option<CFRetained<CFString>> {
80    extern "C-unwind" {
81        fn MDSchemaCopyDisplayNameForAttribute(
82            name: Option<&CFString>,
83        ) -> Option<NonNull<CFString>>;
84    }
85    let ret = unsafe { MDSchemaCopyDisplayNameForAttribute(name) };
86    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
87}
88
89/// Returns the localized description of an attribute.
90///
91/// Parameter `name`: the attribute whose localization you are interested in
92///
93/// Returns: the localized description of the passed in attribute, or NULL if there is
94/// no localized description is avaliable.
95///
96/// # Safety
97///
98/// `name` might not allow `None`.
99#[inline]
100pub unsafe extern "C-unwind" fn MDSchemaCopyDisplayDescriptionForAttribute(
101    name: Option<&CFString>,
102) -> Option<CFRetained<CFString>> {
103    extern "C-unwind" {
104        fn MDSchemaCopyDisplayDescriptionForAttribute(
105            name: Option<&CFString>,
106        ) -> Option<NonNull<CFString>>;
107    }
108    let ret = unsafe { MDSchemaCopyDisplayDescriptionForAttribute(name) };
109    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
110}
111
112extern "C" {
113    /// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kmdattributedisplayvalues?language=objc)
114    pub static kMDAttributeDisplayValues: Option<&'static CFString>;
115}
116
117extern "C" {
118    /// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kmdattributeallvalues?language=objc)
119    pub static kMDAttributeAllValues: Option<&'static CFString>;
120}
121
122extern "C" {
123    /// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kmdattributereadonlyvalues?language=objc)
124    pub static kMDAttributeReadOnlyValues: Option<&'static CFString>;
125}
126
127extern "C" {
128    /// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kmdexporteravaliable?language=objc)
129    pub static kMDExporterAvaliable: Option<&'static CFString>;
130}
131
132extern "C" {
133    /// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kmdattributename?language=objc)
134    pub static kMDAttributeName: Option<&'static CFString>;
135}
136
137extern "C" {
138    /// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kmdattributetype?language=objc)
139    pub static kMDAttributeType: Option<&'static CFString>;
140}
141
142extern "C" {
143    /// [Apple's documentation](https://developer.apple.com/documentation/coreservices/kmdattributemultivalued?language=objc)
144    pub static kMDAttributeMultiValued: Option<&'static CFString>;
145}