Source code

Revision control

Copy as Markdown

Other Tools

//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::cell::UnsafeCell;
use core::marker::{PhantomData, PhantomPinned};
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
use crate::*;
// NS_TYPED_EXTENSIBLE_ENUM
pub type CFLocaleIdentifier = CFString;
// NS_TYPED_ENUM
pub type CFLocaleKey = CFString;
///
/// This is toll-free bridged with `NSLocale`.
#[doc(alias = "CFLocaleRef")]
#[repr(C)]
pub struct CFLocale {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
cf_type!(
unsafe impl CFLocale {}
);
#[cfg(feature = "objc2")]
cf_objc2_type!(
unsafe impl RefEncode<"__CFLocale"> for CFLocale {}
);
unsafe impl ConcreteType for CFLocale {
#[doc(alias = "CFLocaleGetTypeID")]
#[inline]
fn type_id() -> CFTypeID {
extern "C-unwind" {
fn CFLocaleGetTypeID() -> CFTypeID;
}
unsafe { CFLocaleGetTypeID() }
}
}
impl CFLocale {
#[doc(alias = "CFLocaleGetSystem")]
#[inline]
pub fn system() -> Option<CFRetained<CFLocale>> {
extern "C-unwind" {
fn CFLocaleGetSystem() -> Option<NonNull<CFLocale>>;
}
let ret = unsafe { CFLocaleGetSystem() };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "CFLocaleCopyCurrent")]
#[inline]
pub fn current() -> Option<CFRetained<CFLocale>> {
extern "C-unwind" {
fn CFLocaleCopyCurrent() -> Option<NonNull<CFLocale>>;
}
let ret = unsafe { CFLocaleCopyCurrent() };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "CFLocaleCopyAvailableLocaleIdentifiers")]
#[cfg(feature = "CFArray")]
#[inline]
pub fn available_locale_identifiers() -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn CFLocaleCopyAvailableLocaleIdentifiers() -> Option<NonNull<CFArray>>;
}
let ret = unsafe { CFLocaleCopyAvailableLocaleIdentifiers() };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "CFLocaleCopyISOLanguageCodes")]
#[cfg(feature = "CFArray")]
#[inline]
pub fn iso_language_codes() -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn CFLocaleCopyISOLanguageCodes() -> Option<NonNull<CFArray>>;
}
let ret = unsafe { CFLocaleCopyISOLanguageCodes() };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "CFLocaleCopyISOCountryCodes")]
#[cfg(feature = "CFArray")]
#[inline]
pub fn iso_country_codes() -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn CFLocaleCopyISOCountryCodes() -> Option<NonNull<CFArray>>;
}
let ret = unsafe { CFLocaleCopyISOCountryCodes() };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "CFLocaleCopyISOCurrencyCodes")]
#[cfg(feature = "CFArray")]
#[inline]
pub fn iso_currency_codes() -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn CFLocaleCopyISOCurrencyCodes() -> Option<NonNull<CFArray>>;
}
let ret = unsafe { CFLocaleCopyISOCurrencyCodes() };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "CFLocaleCopyCommonISOCurrencyCodes")]
#[cfg(feature = "CFArray")]
#[inline]
pub fn common_iso_currency_codes() -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn CFLocaleCopyCommonISOCurrencyCodes() -> Option<NonNull<CFArray>>;
}
let ret = unsafe { CFLocaleCopyCommonISOCurrencyCodes() };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "CFLocaleCopyPreferredLanguages")]
#[cfg(feature = "CFArray")]
#[inline]
pub fn preferred_languages() -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn CFLocaleCopyPreferredLanguages() -> Option<NonNull<CFArray>>;
}
let ret = unsafe { CFLocaleCopyPreferredLanguages() };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "CFLocaleCreateCanonicalLanguageIdentifierFromString")]
#[inline]
pub fn new_canonical_language_identifier_from_string(
allocator: Option<&CFAllocator>,
locale_identifier: Option<&CFString>,
) -> Option<CFRetained<CFLocaleIdentifier>> {
extern "C-unwind" {
fn CFLocaleCreateCanonicalLanguageIdentifierFromString(
allocator: Option<&CFAllocator>,
locale_identifier: Option<&CFString>,
) -> Option<NonNull<CFLocaleIdentifier>>;
}
let ret = unsafe {
CFLocaleCreateCanonicalLanguageIdentifierFromString(allocator, locale_identifier)
};
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "CFLocaleCreateCanonicalLocaleIdentifierFromString")]
#[inline]
pub fn new_canonical_locale_identifier_from_string(
allocator: Option<&CFAllocator>,
locale_identifier: Option<&CFString>,
) -> Option<CFRetained<CFLocaleIdentifier>> {
extern "C-unwind" {
fn CFLocaleCreateCanonicalLocaleIdentifierFromString(
allocator: Option<&CFAllocator>,
locale_identifier: Option<&CFString>,
) -> Option<NonNull<CFLocaleIdentifier>>;
}
let ret = unsafe {
CFLocaleCreateCanonicalLocaleIdentifierFromString(allocator, locale_identifier)
};
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes")]
#[inline]
pub fn new_canonical_locale_identifier_from_script_manager_codes(
allocator: Option<&CFAllocator>,
lcode: LangCode,
rcode: RegionCode,
) -> Option<CFRetained<CFLocaleIdentifier>> {
extern "C-unwind" {
fn CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(
allocator: Option<&CFAllocator>,
lcode: LangCode,
rcode: RegionCode,
) -> Option<NonNull<CFLocaleIdentifier>>;
}
let ret = unsafe {
CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(allocator, lcode, rcode)
};
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode")]
#[inline]
pub fn new_locale_identifier_from_windows_locale_code(
allocator: Option<&CFAllocator>,
lcid: u32,
) -> Option<CFRetained<CFLocaleIdentifier>> {
extern "C-unwind" {
fn CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode(
allocator: Option<&CFAllocator>,
lcid: u32,
) -> Option<NonNull<CFLocaleIdentifier>>;
}
let ret = unsafe { CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode(allocator, lcid) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier")]
#[inline]
pub fn windows_locale_code_from_locale_identifier(
locale_identifier: Option<&CFLocaleIdentifier>,
) -> u32 {
extern "C-unwind" {
fn CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier(
locale_identifier: Option<&CFLocaleIdentifier>,
) -> u32;
}
unsafe { CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier(locale_identifier) }
}
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CFLocaleLanguageDirection(pub CFIndex);
impl CFLocaleLanguageDirection {
#[doc(alias = "kCFLocaleLanguageDirectionUnknown")]
pub const Unknown: Self = Self(0);
#[doc(alias = "kCFLocaleLanguageDirectionLeftToRight")]
pub const LeftToRight: Self = Self(1);
#[doc(alias = "kCFLocaleLanguageDirectionRightToLeft")]
pub const RightToLeft: Self = Self(2);
#[doc(alias = "kCFLocaleLanguageDirectionTopToBottom")]
pub const TopToBottom: Self = Self(3);
#[doc(alias = "kCFLocaleLanguageDirectionBottomToTop")]
pub const BottomToTop: Self = Self(4);
}
#[cfg(feature = "objc2")]
unsafe impl Encode for CFLocaleLanguageDirection {
const ENCODING: Encoding = CFIndex::ENCODING;
}
#[cfg(feature = "objc2")]
unsafe impl RefEncode for CFLocaleLanguageDirection {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
impl CFLocale {
#[doc(alias = "CFLocaleGetLanguageCharacterDirection")]
#[inline]
pub fn language_character_direction(
iso_lang_code: Option<&CFString>,
) -> CFLocaleLanguageDirection {
extern "C-unwind" {
fn CFLocaleGetLanguageCharacterDirection(
iso_lang_code: Option<&CFString>,
) -> CFLocaleLanguageDirection;
}
unsafe { CFLocaleGetLanguageCharacterDirection(iso_lang_code) }
}
#[doc(alias = "CFLocaleGetLanguageLineDirection")]
#[inline]
pub fn language_line_direction(iso_lang_code: Option<&CFString>) -> CFLocaleLanguageDirection {
extern "C-unwind" {
fn CFLocaleGetLanguageLineDirection(
iso_lang_code: Option<&CFString>,
) -> CFLocaleLanguageDirection;
}
unsafe { CFLocaleGetLanguageLineDirection(iso_lang_code) }
}
#[doc(alias = "CFLocaleCreateComponentsFromLocaleIdentifier")]
#[cfg(feature = "CFDictionary")]
#[inline]
pub fn new_components_from_locale_identifier(
allocator: Option<&CFAllocator>,
locale_id: Option<&CFLocaleIdentifier>,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn CFLocaleCreateComponentsFromLocaleIdentifier(
allocator: Option<&CFAllocator>,
locale_id: Option<&CFLocaleIdentifier>,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { CFLocaleCreateComponentsFromLocaleIdentifier(allocator, locale_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
/// # Safety
///
/// - `allocator` might not allow `None`.
/// - `dictionary` generics must be of the correct type.
/// - `dictionary` might not allow `None`.
#[doc(alias = "CFLocaleCreateLocaleIdentifierFromComponents")]
#[cfg(feature = "CFDictionary")]
#[inline]
pub unsafe fn new_locale_identifier_from_components(
allocator: Option<&CFAllocator>,
dictionary: Option<&CFDictionary>,
) -> Option<CFRetained<CFLocaleIdentifier>> {
extern "C-unwind" {
fn CFLocaleCreateLocaleIdentifierFromComponents(
allocator: Option<&CFAllocator>,
dictionary: Option<&CFDictionary>,
) -> Option<NonNull<CFLocaleIdentifier>>;
}
let ret = unsafe { CFLocaleCreateLocaleIdentifierFromComponents(allocator, dictionary) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "CFLocaleCreate")]
#[inline]
pub fn new(
allocator: Option<&CFAllocator>,
locale_identifier: Option<&CFLocaleIdentifier>,
) -> Option<CFRetained<CFLocale>> {
extern "C-unwind" {
fn CFLocaleCreate(
allocator: Option<&CFAllocator>,
locale_identifier: Option<&CFLocaleIdentifier>,
) -> Option<NonNull<CFLocale>>;
}
let ret = unsafe { CFLocaleCreate(allocator, locale_identifier) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "CFLocaleCreateCopy")]
#[inline]
pub fn new_copy(
allocator: Option<&CFAllocator>,
locale: Option<&CFLocale>,
) -> Option<CFRetained<CFLocale>> {
extern "C-unwind" {
fn CFLocaleCreateCopy(
allocator: Option<&CFAllocator>,
locale: Option<&CFLocale>,
) -> Option<NonNull<CFLocale>>;
}
let ret = unsafe { CFLocaleCreateCopy(allocator, locale) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[doc(alias = "CFLocaleGetIdentifier")]
#[inline]
pub fn identifier(&self) -> Option<CFRetained<CFLocaleIdentifier>> {
extern "C-unwind" {
fn CFLocaleGetIdentifier(locale: &CFLocale) -> Option<NonNull<CFLocaleIdentifier>>;
}
let ret = unsafe { CFLocaleGetIdentifier(self) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "CFLocaleGetValue")]
#[inline]
pub fn value(&self, key: Option<&CFLocaleKey>) -> Option<CFRetained<CFType>> {
extern "C-unwind" {
fn CFLocaleGetValue(
locale: &CFLocale,
key: Option<&CFLocaleKey>,
) -> Option<NonNull<CFType>>;
}
let ret = unsafe { CFLocaleGetValue(self, key) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[doc(alias = "CFLocaleCopyDisplayNameForPropertyValue")]
#[inline]
pub fn display_name_for_property_value(
&self,
key: Option<&CFLocaleKey>,
value: Option<&CFString>,
) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn CFLocaleCopyDisplayNameForPropertyValue(
display_locale: &CFLocale,
key: Option<&CFLocaleKey>,
value: Option<&CFString>,
) -> Option<NonNull<CFString>>;
}
let ret = unsafe { CFLocaleCopyDisplayNameForPropertyValue(self, key, value) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
}
extern "C" {
#[cfg(feature = "CFNotificationCenter")]
pub static kCFLocaleCurrentLocaleDidChangeNotification: Option<&'static CFNotificationName>;
}
extern "C" {
pub static kCFLocaleIdentifier: Option<&'static CFLocaleKey>;
}
extern "C" {
pub static kCFLocaleLanguageCode: Option<&'static CFLocaleKey>;
}
extern "C" {
pub static kCFLocaleCountryCode: Option<&'static CFLocaleKey>;
}
extern "C" {
pub static kCFLocaleScriptCode: Option<&'static CFLocaleKey>;
}
extern "C" {
pub static kCFLocaleVariantCode: Option<&'static CFLocaleKey>;
}
extern "C" {
pub static kCFLocaleExemplarCharacterSet: Option<&'static CFLocaleKey>;
}
extern "C" {
pub static kCFLocaleCalendarIdentifier: Option<&'static CFLocaleKey>;
}
extern "C" {
pub static kCFLocaleCalendar: Option<&'static CFLocaleKey>;
}
extern "C" {
pub static kCFLocaleCollationIdentifier: Option<&'static CFLocaleKey>;
}
extern "C" {
pub static kCFLocaleUsesMetricSystem: Option<&'static CFLocaleKey>;
}
extern "C" {
pub static kCFLocaleMeasurementSystem: Option<&'static CFLocaleKey>;
}
extern "C" {
pub static kCFLocaleDecimalSeparator: Option<&'static CFLocaleKey>;
}
extern "C" {
pub static kCFLocaleGroupingSeparator: Option<&'static CFLocaleKey>;
}
extern "C" {
pub static kCFLocaleCurrencySymbol: Option<&'static CFLocaleKey>;
}
extern "C" {
pub static kCFLocaleCurrencyCode: Option<&'static CFLocaleKey>;
}
extern "C" {
pub static kCFLocaleCollatorIdentifier: Option<&'static CFLocaleKey>;
}
extern "C" {
pub static kCFLocaleQuotationBeginDelimiterKey: Option<&'static CFLocaleKey>;
}
extern "C" {
pub static kCFLocaleQuotationEndDelimiterKey: Option<&'static CFLocaleKey>;
}
extern "C" {
pub static kCFLocaleAlternateQuotationBeginDelimiterKey: Option<&'static CFLocaleKey>;
}
extern "C" {
pub static kCFLocaleAlternateQuotationEndDelimiterKey: Option<&'static CFLocaleKey>;
}
// NS_TYPED_ENUM
pub type CFCalendarIdentifier = CFString;
extern "C" {
pub static kCFGregorianCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFBuddhistCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFChineseCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFHebrewCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFIslamicCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFIslamicCivilCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFJapaneseCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFRepublicOfChinaCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFPersianCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFIndianCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFISO8601Calendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFIslamicTabularCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFIslamicUmmAlQuraCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFBanglaCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFGujaratiCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFKannadaCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFMalayalamCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFMarathiCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFOdiaCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFTamilCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFTeluguCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFVikramCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFDangiCalendar: Option<&'static CFCalendarIdentifier>;
}
extern "C" {
pub static kCFVietnameseCalendar: Option<&'static CFCalendarIdentifier>;
}
#[deprecated = "renamed to `CFLocale::system`"]
#[inline]
pub extern "C-unwind" fn CFLocaleGetSystem() -> Option<CFRetained<CFLocale>> {
extern "C-unwind" {
fn CFLocaleGetSystem() -> Option<NonNull<CFLocale>>;
}
let ret = unsafe { CFLocaleGetSystem() };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `CFLocale::current`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCopyCurrent() -> Option<CFRetained<CFLocale>> {
extern "C-unwind" {
fn CFLocaleCopyCurrent() -> Option<NonNull<CFLocale>>;
}
let ret = unsafe { CFLocaleCopyCurrent() };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[cfg(feature = "CFArray")]
#[deprecated = "renamed to `CFLocale::available_locale_identifiers`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCopyAvailableLocaleIdentifiers() -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn CFLocaleCopyAvailableLocaleIdentifiers() -> Option<NonNull<CFArray>>;
}
let ret = unsafe { CFLocaleCopyAvailableLocaleIdentifiers() };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[cfg(feature = "CFArray")]
#[deprecated = "renamed to `CFLocale::iso_language_codes`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCopyISOLanguageCodes() -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn CFLocaleCopyISOLanguageCodes() -> Option<NonNull<CFArray>>;
}
let ret = unsafe { CFLocaleCopyISOLanguageCodes() };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[cfg(feature = "CFArray")]
#[deprecated = "renamed to `CFLocale::iso_country_codes`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCopyISOCountryCodes() -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn CFLocaleCopyISOCountryCodes() -> Option<NonNull<CFArray>>;
}
let ret = unsafe { CFLocaleCopyISOCountryCodes() };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[cfg(feature = "CFArray")]
#[deprecated = "renamed to `CFLocale::iso_currency_codes`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCopyISOCurrencyCodes() -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn CFLocaleCopyISOCurrencyCodes() -> Option<NonNull<CFArray>>;
}
let ret = unsafe { CFLocaleCopyISOCurrencyCodes() };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[cfg(feature = "CFArray")]
#[deprecated = "renamed to `CFLocale::common_iso_currency_codes`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCopyCommonISOCurrencyCodes() -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn CFLocaleCopyCommonISOCurrencyCodes() -> Option<NonNull<CFArray>>;
}
let ret = unsafe { CFLocaleCopyCommonISOCurrencyCodes() };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[cfg(feature = "CFArray")]
#[deprecated = "renamed to `CFLocale::preferred_languages`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCopyPreferredLanguages() -> Option<CFRetained<CFArray>> {
extern "C-unwind" {
fn CFLocaleCopyPreferredLanguages() -> Option<NonNull<CFArray>>;
}
let ret = unsafe { CFLocaleCopyPreferredLanguages() };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `CFLocale::new_canonical_language_identifier_from_string`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCreateCanonicalLanguageIdentifierFromString(
allocator: Option<&CFAllocator>,
locale_identifier: Option<&CFString>,
) -> Option<CFRetained<CFLocaleIdentifier>> {
extern "C-unwind" {
fn CFLocaleCreateCanonicalLanguageIdentifierFromString(
allocator: Option<&CFAllocator>,
locale_identifier: Option<&CFString>,
) -> Option<NonNull<CFLocaleIdentifier>>;
}
let ret = unsafe {
CFLocaleCreateCanonicalLanguageIdentifierFromString(allocator, locale_identifier)
};
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `CFLocale::new_canonical_locale_identifier_from_string`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCreateCanonicalLocaleIdentifierFromString(
allocator: Option<&CFAllocator>,
locale_identifier: Option<&CFString>,
) -> Option<CFRetained<CFLocaleIdentifier>> {
extern "C-unwind" {
fn CFLocaleCreateCanonicalLocaleIdentifierFromString(
allocator: Option<&CFAllocator>,
locale_identifier: Option<&CFString>,
) -> Option<NonNull<CFLocaleIdentifier>>;
}
let ret =
unsafe { CFLocaleCreateCanonicalLocaleIdentifierFromString(allocator, locale_identifier) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `CFLocale::new_canonical_locale_identifier_from_script_manager_codes`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(
allocator: Option<&CFAllocator>,
lcode: LangCode,
rcode: RegionCode,
) -> Option<CFRetained<CFLocaleIdentifier>> {
extern "C-unwind" {
fn CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(
allocator: Option<&CFAllocator>,
lcode: LangCode,
rcode: RegionCode,
) -> Option<NonNull<CFLocaleIdentifier>>;
}
let ret = unsafe {
CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(allocator, lcode, rcode)
};
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `CFLocale::new_locale_identifier_from_windows_locale_code`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode(
allocator: Option<&CFAllocator>,
lcid: u32,
) -> Option<CFRetained<CFLocaleIdentifier>> {
extern "C-unwind" {
fn CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode(
allocator: Option<&CFAllocator>,
lcid: u32,
) -> Option<NonNull<CFLocaleIdentifier>>;
}
let ret = unsafe { CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode(allocator, lcid) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `CFLocale::windows_locale_code_from_locale_identifier`"]
#[inline]
pub extern "C-unwind" fn CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier(
locale_identifier: Option<&CFLocaleIdentifier>,
) -> u32 {
extern "C-unwind" {
fn CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier(
locale_identifier: Option<&CFLocaleIdentifier>,
) -> u32;
}
unsafe { CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier(locale_identifier) }
}
#[deprecated = "renamed to `CFLocale::language_character_direction`"]
#[inline]
pub extern "C-unwind" fn CFLocaleGetLanguageCharacterDirection(
iso_lang_code: Option<&CFString>,
) -> CFLocaleLanguageDirection {
extern "C-unwind" {
fn CFLocaleGetLanguageCharacterDirection(
iso_lang_code: Option<&CFString>,
) -> CFLocaleLanguageDirection;
}
unsafe { CFLocaleGetLanguageCharacterDirection(iso_lang_code) }
}
#[deprecated = "renamed to `CFLocale::language_line_direction`"]
#[inline]
pub extern "C-unwind" fn CFLocaleGetLanguageLineDirection(
iso_lang_code: Option<&CFString>,
) -> CFLocaleLanguageDirection {
extern "C-unwind" {
fn CFLocaleGetLanguageLineDirection(
iso_lang_code: Option<&CFString>,
) -> CFLocaleLanguageDirection;
}
unsafe { CFLocaleGetLanguageLineDirection(iso_lang_code) }
}
#[cfg(feature = "CFDictionary")]
#[deprecated = "renamed to `CFLocale::new_components_from_locale_identifier`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCreateComponentsFromLocaleIdentifier(
allocator: Option<&CFAllocator>,
locale_id: Option<&CFLocaleIdentifier>,
) -> Option<CFRetained<CFDictionary>> {
extern "C-unwind" {
fn CFLocaleCreateComponentsFromLocaleIdentifier(
allocator: Option<&CFAllocator>,
locale_id: Option<&CFLocaleIdentifier>,
) -> Option<NonNull<CFDictionary>>;
}
let ret = unsafe { CFLocaleCreateComponentsFromLocaleIdentifier(allocator, locale_id) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[cfg(feature = "CFDictionary")]
#[deprecated = "renamed to `CFLocale::new_locale_identifier_from_components`"]
#[inline]
pub unsafe extern "C-unwind" fn CFLocaleCreateLocaleIdentifierFromComponents(
allocator: Option<&CFAllocator>,
dictionary: Option<&CFDictionary>,
) -> Option<CFRetained<CFLocaleIdentifier>> {
extern "C-unwind" {
fn CFLocaleCreateLocaleIdentifierFromComponents(
allocator: Option<&CFAllocator>,
dictionary: Option<&CFDictionary>,
) -> Option<NonNull<CFLocaleIdentifier>>;
}
let ret = unsafe { CFLocaleCreateLocaleIdentifierFromComponents(allocator, dictionary) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `CFLocale::new`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCreate(
allocator: Option<&CFAllocator>,
locale_identifier: Option<&CFLocaleIdentifier>,
) -> Option<CFRetained<CFLocale>> {
extern "C-unwind" {
fn CFLocaleCreate(
allocator: Option<&CFAllocator>,
locale_identifier: Option<&CFLocaleIdentifier>,
) -> Option<NonNull<CFLocale>>;
}
let ret = unsafe { CFLocaleCreate(allocator, locale_identifier) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `CFLocale::new_copy`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCreateCopy(
allocator: Option<&CFAllocator>,
locale: Option<&CFLocale>,
) -> Option<CFRetained<CFLocale>> {
extern "C-unwind" {
fn CFLocaleCreateCopy(
allocator: Option<&CFAllocator>,
locale: Option<&CFLocale>,
) -> Option<NonNull<CFLocale>>;
}
let ret = unsafe { CFLocaleCreateCopy(allocator, locale) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}
#[deprecated = "renamed to `CFLocale::identifier`"]
#[inline]
pub extern "C-unwind" fn CFLocaleGetIdentifier(
locale: &CFLocale,
) -> Option<CFRetained<CFLocaleIdentifier>> {
extern "C-unwind" {
fn CFLocaleGetIdentifier(locale: &CFLocale) -> Option<NonNull<CFLocaleIdentifier>>;
}
let ret = unsafe { CFLocaleGetIdentifier(locale) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `CFLocale::value`"]
#[inline]
pub extern "C-unwind" fn CFLocaleGetValue(
locale: &CFLocale,
key: Option<&CFLocaleKey>,
) -> Option<CFRetained<CFType>> {
extern "C-unwind" {
fn CFLocaleGetValue(
locale: &CFLocale,
key: Option<&CFLocaleKey>,
) -> Option<NonNull<CFType>>;
}
let ret = unsafe { CFLocaleGetValue(locale, key) };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[deprecated = "renamed to `CFLocale::display_name_for_property_value`"]
#[inline]
pub extern "C-unwind" fn CFLocaleCopyDisplayNameForPropertyValue(
display_locale: &CFLocale,
key: Option<&CFLocaleKey>,
value: Option<&CFString>,
) -> Option<CFRetained<CFString>> {
extern "C-unwind" {
fn CFLocaleCopyDisplayNameForPropertyValue(
display_locale: &CFLocale,
key: Option<&CFLocaleKey>,
value: Option<&CFString>,
) -> Option<NonNull<CFString>>;
}
let ret = unsafe { CFLocaleCopyDisplayNameForPropertyValue(display_locale, key, value) };
ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
}