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