objc2_app_kit/generated/
NSGlyphInfo.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-graphics")]
6#[cfg(target_vendor = "apple")]
7use objc2_core_graphics::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsglyphinfo?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct NSGlyphInfo;
17);
18
19extern_conformance!(
20    unsafe impl NSCoding for NSGlyphInfo {}
21);
22
23extern_conformance!(
24    unsafe impl NSCopying for NSGlyphInfo {}
25);
26
27unsafe impl CopyingHelper for NSGlyphInfo {
28    type Result = Self;
29}
30
31extern_conformance!(
32    unsafe impl NSObjectProtocol for NSGlyphInfo {}
33);
34
35extern_conformance!(
36    unsafe impl NSSecureCoding for NSGlyphInfo {}
37);
38
39impl NSGlyphInfo {
40    extern_methods!(
41        #[cfg(all(feature = "NSFont", feature = "objc2-core-graphics"))]
42        #[cfg(target_vendor = "apple")]
43        #[unsafe(method(glyphInfoWithCGGlyph:forFont:baseString:))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn glyphInfoWithCGGlyph_forFont_baseString(
46            glyph: CGGlyph,
47            font: &NSFont,
48            string: &NSString,
49        ) -> Option<Retained<NSGlyphInfo>>;
50
51        #[cfg(feature = "objc2-core-graphics")]
52        #[cfg(target_vendor = "apple")]
53        #[unsafe(method(glyphID))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn glyphID(&self) -> CGGlyph;
56
57        #[unsafe(method(baseString))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn baseString(&self) -> Retained<NSString>;
60    );
61}
62
63/// Methods declared on superclass `NSObject`.
64impl NSGlyphInfo {
65    extern_methods!(
66        #[unsafe(method(init))]
67        #[unsafe(method_family = init)]
68        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
69
70        #[unsafe(method(new))]
71        #[unsafe(method_family = new)]
72        pub unsafe fn new() -> Retained<Self>;
73    );
74}
75
76/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscharactercollection?language=objc)
77// NS_ENUM
78#[repr(transparent)]
79#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
80pub struct NSCharacterCollection(pub NSUInteger);
81impl NSCharacterCollection {
82    #[doc(alias = "NSIdentityMappingCharacterCollection")]
83    pub const IdentityMappingCharacterCollection: Self = Self(0);
84    #[doc(alias = "NSAdobeCNS1CharacterCollection")]
85    pub const AdobeCNS1CharacterCollection: Self = Self(1);
86    #[doc(alias = "NSAdobeGB1CharacterCollection")]
87    pub const AdobeGB1CharacterCollection: Self = Self(2);
88    #[doc(alias = "NSAdobeJapan1CharacterCollection")]
89    pub const AdobeJapan1CharacterCollection: Self = Self(3);
90    #[doc(alias = "NSAdobeJapan2CharacterCollection")]
91    pub const AdobeJapan2CharacterCollection: Self = Self(4);
92    #[doc(alias = "NSAdobeKorea1CharacterCollection")]
93    pub const AdobeKorea1CharacterCollection: Self = Self(5);
94}
95
96unsafe impl Encode for NSCharacterCollection {
97    const ENCODING: Encoding = NSUInteger::ENCODING;
98}
99
100unsafe impl RefEncode for NSCharacterCollection {
101    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
102}
103
104/// NSGlyphInfo_Deprecated.
105impl NSGlyphInfo {
106    extern_methods!(
107        #[cfg(feature = "NSFont")]
108        #[unsafe(method(glyphInfoWithGlyphName:forFont:baseString:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn glyphInfoWithGlyphName_forFont_baseString(
111            glyph_name: &NSString,
112            font: &NSFont,
113            string: &NSString,
114        ) -> Option<Retained<NSGlyphInfo>>;
115
116        #[cfg(feature = "NSFont")]
117        #[unsafe(method(glyphInfoWithGlyph:forFont:baseString:))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn glyphInfoWithGlyph_forFont_baseString(
120            glyph: NSGlyph,
121            font: &NSFont,
122            string: &NSString,
123        ) -> Option<Retained<NSGlyphInfo>>;
124
125        #[unsafe(method(glyphInfoWithCharacterIdentifier:collection:baseString:))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn glyphInfoWithCharacterIdentifier_collection_baseString(
128            cid: NSUInteger,
129            character_collection: NSCharacterCollection,
130            string: &NSString,
131        ) -> Option<Retained<NSGlyphInfo>>;
132
133        #[unsafe(method(glyphName))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn glyphName(&self) -> Option<Retained<NSString>>;
136
137        #[unsafe(method(characterIdentifier))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn characterIdentifier(&self) -> NSUInteger;
140
141        #[unsafe(method(characterCollection))]
142        #[unsafe(method_family = none)]
143        pub unsafe fn characterCollection(&self) -> NSCharacterCollection;
144    );
145}