1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSTextLineFragment;

    unsafe impl ClassType for NSTextLineFragment {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSCoding for NSTextLineFragment {}

unsafe impl NSObjectProtocol for NSTextLineFragment {}

unsafe impl NSSecureCoding for NSTextLineFragment {}

extern_methods!(
    unsafe impl NSTextLineFragment {
        #[method_id(@__retain_semantics Init initWithAttributedString:range:)]
        pub unsafe fn initWithAttributedString_range(
            this: Allocated<Self>,
            attributed_string: &NSAttributedString,
            range: NSRange,
        ) -> Retained<Self>;

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            a_decoder: &NSCoder,
        ) -> Option<Retained<Self>>;

        #[method_id(@__retain_semantics Init initWithString:attributes:range:)]
        pub unsafe fn initWithString_attributes_range(
            this: Allocated<Self>,
            string: &NSString,
            attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
            range: NSRange,
        ) -> Retained<Self>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics Other attributedString)]
        pub unsafe fn attributedString(&self) -> Retained<NSAttributedString>;

        #[method(characterRange)]
        pub unsafe fn characterRange(&self) -> NSRange;

        #[method(typographicBounds)]
        pub unsafe fn typographicBounds(&self) -> CGRect;

        #[method(glyphOrigin)]
        pub unsafe fn glyphOrigin(&self) -> CGPoint;

        #[method(locationForCharacterAtIndex:)]
        pub unsafe fn locationForCharacterAtIndex(&self, index: NSInteger) -> CGPoint;

        #[method(characterIndexForPoint:)]
        pub unsafe fn characterIndexForPoint(&self, point: CGPoint) -> NSInteger;

        #[method(fractionOfDistanceThroughGlyphForPoint:)]
        pub unsafe fn fractionOfDistanceThroughGlyphForPoint(&self, point: CGPoint) -> CGFloat;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSTextLineFragment {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);