objc2_app_kit/generated/
NSTextLineFragment.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8#[cfg(feature = "objc2-core-graphics")]
9#[cfg(target_vendor = "apple")]
10use objc2_core_graphics::*;
11use objc2_foundation::*;
12
13use crate::*;
14
15extern_class!(
16    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextlinefragment?language=objc)
17    #[unsafe(super(NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    pub struct NSTextLineFragment;
20);
21
22unsafe impl NSCoding for NSTextLineFragment {}
23
24unsafe impl NSObjectProtocol for NSTextLineFragment {}
25
26unsafe impl NSSecureCoding for NSTextLineFragment {}
27
28impl NSTextLineFragment {
29    extern_methods!(
30        #[unsafe(method(initWithAttributedString:range:))]
31        #[unsafe(method_family = init)]
32        pub unsafe fn initWithAttributedString_range(
33            this: Allocated<Self>,
34            attributed_string: &NSAttributedString,
35            range: NSRange,
36        ) -> Retained<Self>;
37
38        #[unsafe(method(initWithCoder:))]
39        #[unsafe(method_family = init)]
40        pub unsafe fn initWithCoder(
41            this: Allocated<Self>,
42            a_decoder: &NSCoder,
43        ) -> Option<Retained<Self>>;
44
45        #[unsafe(method(initWithString:attributes:range:))]
46        #[unsafe(method_family = init)]
47        pub unsafe fn initWithString_attributes_range(
48            this: Allocated<Self>,
49            string: &NSString,
50            attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
51            range: NSRange,
52        ) -> Retained<Self>;
53
54        #[unsafe(method(init))]
55        #[unsafe(method_family = init)]
56        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
57
58        #[unsafe(method(attributedString))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn attributedString(&self) -> Retained<NSAttributedString>;
61
62        #[unsafe(method(characterRange))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn characterRange(&self) -> NSRange;
65
66        #[cfg(feature = "objc2-core-foundation")]
67        #[unsafe(method(typographicBounds))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn typographicBounds(&self) -> CGRect;
70
71        #[cfg(feature = "objc2-core-foundation")]
72        #[unsafe(method(glyphOrigin))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn glyphOrigin(&self) -> CGPoint;
75
76        #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-graphics"))]
77        #[cfg(target_vendor = "apple")]
78        #[unsafe(method(drawAtPoint:inContext:))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn drawAtPoint_inContext(&self, point: CGPoint, context: &CGContext);
81
82        #[cfg(feature = "objc2-core-foundation")]
83        #[unsafe(method(locationForCharacterAtIndex:))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn locationForCharacterAtIndex(&self, index: NSInteger) -> CGPoint;
86
87        #[cfg(feature = "objc2-core-foundation")]
88        #[unsafe(method(characterIndexForPoint:))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn characterIndexForPoint(&self, point: CGPoint) -> NSInteger;
91
92        #[cfg(feature = "objc2-core-foundation")]
93        #[unsafe(method(fractionOfDistanceThroughGlyphForPoint:))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn fractionOfDistanceThroughGlyphForPoint(&self, point: CGPoint) -> CGFloat;
96    );
97}
98
99/// Methods declared on superclass `NSObject`.
100impl NSTextLineFragment {
101    extern_methods!(
102        #[unsafe(method(new))]
103        #[unsafe(method_family = new)]
104        pub unsafe fn new() -> Retained<Self>;
105    );
106}