objc2_app_kit/generated/
NSTextRange.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::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_protocol!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextlocation?language=objc)
11    pub unsafe trait NSTextLocation: NSObjectProtocol {
12        #[unsafe(method(compare:))]
13        #[unsafe(method_family = none)]
14        unsafe fn compare(
15            &self,
16            location: &ProtocolObject<dyn NSTextLocation>,
17        ) -> NSComparisonResult;
18    }
19);
20
21extern_class!(
22    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextrange?language=objc)
23    #[unsafe(super(NSObject))]
24    #[derive(Debug, PartialEq, Eq, Hash)]
25    pub struct NSTextRange;
26);
27
28unsafe impl NSObjectProtocol for NSTextRange {}
29
30impl NSTextRange {
31    extern_methods!(
32        #[unsafe(method(initWithLocation:endLocation:))]
33        #[unsafe(method_family = init)]
34        pub unsafe fn initWithLocation_endLocation(
35            this: Allocated<Self>,
36            location: &ProtocolObject<dyn NSTextLocation>,
37            end_location: Option<&ProtocolObject<dyn NSTextLocation>>,
38        ) -> Option<Retained<Self>>;
39
40        #[unsafe(method(initWithLocation:))]
41        #[unsafe(method_family = init)]
42        pub unsafe fn initWithLocation(
43            this: Allocated<Self>,
44            location: &ProtocolObject<dyn NSTextLocation>,
45        ) -> Retained<Self>;
46
47        #[unsafe(method(init))]
48        #[unsafe(method_family = init)]
49        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
50
51        #[unsafe(method(new))]
52        #[unsafe(method_family = new)]
53        pub unsafe fn new() -> Retained<Self>;
54
55        #[unsafe(method(isEmpty))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn isEmpty(&self) -> bool;
58
59        #[unsafe(method(location))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn location(&self) -> Retained<ProtocolObject<dyn NSTextLocation>>;
62
63        #[unsafe(method(endLocation))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn endLocation(&self) -> Retained<ProtocolObject<dyn NSTextLocation>>;
66
67        #[unsafe(method(isEqualToTextRange:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn isEqualToTextRange(&self, text_range: &NSTextRange) -> bool;
70
71        #[unsafe(method(containsLocation:))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn containsLocation(
74            &self,
75            location: &ProtocolObject<dyn NSTextLocation>,
76        ) -> bool;
77
78        #[unsafe(method(containsRange:))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn containsRange(&self, text_range: &NSTextRange) -> bool;
81
82        #[unsafe(method(intersectsWithTextRange:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn intersectsWithTextRange(&self, text_range: &NSTextRange) -> bool;
85
86        #[unsafe(method(textRangeByIntersectingWithTextRange:))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn textRangeByIntersectingWithTextRange(
89            &self,
90            text_range: &NSTextRange,
91        ) -> Option<Retained<Self>>;
92
93        #[unsafe(method(textRangeByFormingUnionWithTextRange:))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn textRangeByFormingUnionWithTextRange(
96            &self,
97            text_range: &NSTextRange,
98        ) -> Retained<Self>;
99    );
100}