objc2_core_text/generated/
CTFontManagerErrors.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4#[cfg(feature = "objc2")]
5use objc2::__framework_prelude::*;
6use objc2_core_foundation::*;
7
8use crate::*;
9
10extern "C" {
11    /// CFError domain for CTFontManager errors
12    ///
13    /// CFErrors with this domain will have error codes corresponding to one of the CTFontManagerErrors above.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/coretext/kctfontmanagererrordomain?language=objc)
16    pub static kCTFontManagerErrorDomain: &'static CFString;
17}
18
19extern "C" {
20    /// User info key to be used with CFError references returned from registration functions.
21    ///
22    /// The value associated with this key in the user info dictionary of a CFError is a CFArray of font URLs that failed with given error.
23    ///
24    /// See also [Apple's documentation](https://developer.apple.com/documentation/coretext/kctfontmanagererrorfonturlskey?language=objc)
25    pub static kCTFontManagerErrorFontURLsKey: &'static CFString;
26}
27
28extern "C" {
29    /// User info key to be used with CFError references returned from registration functions.
30    ///
31    /// The value associated with this key in the user info dictionary of a CFError is a CFArray of font descriptors that failed with given error.
32    ///
33    /// See also [Apple's documentation](https://developer.apple.com/documentation/coretext/kctfontmanagererrorfontdescriptorskey?language=objc)
34    pub static kCTFontManagerErrorFontDescriptorsKey: &'static CFString;
35}
36
37extern "C" {
38    /// User info key to be used with CFError references returned from registration functions.
39    ///
40    /// The value associated with this key in the user info dictionary of a CFError is a CFArray of font asset name strings that failed with given error.
41    ///
42    /// See also [Apple's documentation](https://developer.apple.com/documentation/coretext/kctfontmanagererrorfontassetnamekey?language=objc)
43    pub static kCTFontManagerErrorFontAssetNameKey: &'static CFString;
44}
45
46/// Font registration errors
47///
48/// Errors that would prevent registration of fonts for a specified font file URL.
49///
50/// The file does not exist at the specified URL.
51///
52/// Cannot access the file due to insufficient permissions.
53///
54/// The file is not a recognized or supported font file format.
55///
56/// The file contains invalid font data that could cause system problems.
57///
58/// The file has already been registered in the specified scope.
59///
60/// Errors that would prevent un-registration of fonts for a specified font file URL.
61///
62/// The file is not registered in the specified scope.
63///
64/// The font file is actively in use and cannot be unregistered.
65///
66/// The file is required by the system and cannot be unregistered.
67///
68/// The file could not be processed due to an unexpected FontProvider error.
69///
70/// The file could not be processed because the provider does not have a necessary entitlement.
71///
72/// The font descriptor does not have information to specify a font file.
73///
74/// The operation was cancelled by the user.
75///
76/// The file could not be registered because of a duplicated font name.
77///
78/// The file is not in an allowed location. It must be either in the application's bundle or an on-demand resource.
79///
80/// The operation failed due to a system limitation.
81///
82/// The specified scope is not supported.
83///
84/// See also [Apple's documentation](https://developer.apple.com/documentation/coretext/ctfontmanagererror?language=objc)
85// NS_ENUM
86#[repr(transparent)]
87#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
88pub struct CTFontManagerError(pub CFIndex);
89impl CTFontManagerError {
90    #[doc(alias = "kCTFontManagerErrorFileNotFound")]
91    pub const FileNotFound: Self = Self(101);
92    #[doc(alias = "kCTFontManagerErrorInsufficientPermissions")]
93    pub const InsufficientPermissions: Self = Self(102);
94    #[doc(alias = "kCTFontManagerErrorUnrecognizedFormat")]
95    pub const UnrecognizedFormat: Self = Self(103);
96    #[doc(alias = "kCTFontManagerErrorInvalidFontData")]
97    pub const InvalidFontData: Self = Self(104);
98    #[doc(alias = "kCTFontManagerErrorAlreadyRegistered")]
99    pub const AlreadyRegistered: Self = Self(105);
100    #[doc(alias = "kCTFontManagerErrorExceededResourceLimit")]
101    pub const ExceededResourceLimit: Self = Self(106);
102    #[doc(alias = "kCTFontManagerErrorAssetNotFound")]
103    pub const AssetNotFound: Self = Self(107);
104    #[doc(alias = "kCTFontManagerErrorNotRegistered")]
105    pub const NotRegistered: Self = Self(201);
106    #[doc(alias = "kCTFontManagerErrorInUse")]
107    pub const InUse: Self = Self(202);
108    #[doc(alias = "kCTFontManagerErrorSystemRequired")]
109    pub const SystemRequired: Self = Self(203);
110    #[doc(alias = "kCTFontManagerErrorRegistrationFailed")]
111    pub const RegistrationFailed: Self = Self(301);
112    #[doc(alias = "kCTFontManagerErrorMissingEntitlement")]
113    pub const MissingEntitlement: Self = Self(302);
114    #[doc(alias = "kCTFontManagerErrorInsufficientInfo")]
115    pub const InsufficientInfo: Self = Self(303);
116    #[doc(alias = "kCTFontManagerErrorCancelledByUser")]
117    pub const CancelledByUser: Self = Self(304);
118    #[doc(alias = "kCTFontManagerErrorDuplicatedName")]
119    pub const DuplicatedName: Self = Self(305);
120    #[doc(alias = "kCTFontManagerErrorInvalidFilePath")]
121    pub const InvalidFilePath: Self = Self(306);
122    #[doc(alias = "kCTFontManagerErrorUnsupportedScope")]
123    pub const UnsupportedScope: Self = Self(307);
124}
125
126#[cfg(feature = "objc2")]
127unsafe impl Encode for CTFontManagerError {
128    const ENCODING: Encoding = CFIndex::ENCODING;
129}
130
131#[cfg(feature = "objc2")]
132unsafe impl RefEncode for CTFontManagerError {
133    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
134}