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
28extern_conformance!(
29    unsafe impl NSObjectProtocol for NSTextRange {}
30);
31
32impl NSTextRange {
33    extern_methods!(
34        #[unsafe(method(initWithLocation:endLocation:))]
35        #[unsafe(method_family = init)]
36        pub unsafe fn initWithLocation_endLocation(
37            this: Allocated<Self>,
38            location: &ProtocolObject<dyn NSTextLocation>,
39            end_location: Option<&ProtocolObject<dyn NSTextLocation>>,
40        ) -> Option<Retained<Self>>;
41
42        #[unsafe(method(initWithLocation:))]
43        #[unsafe(method_family = init)]
44        pub unsafe fn initWithLocation(
45            this: Allocated<Self>,
46            location: &ProtocolObject<dyn NSTextLocation>,
47        ) -> Retained<Self>;
48
49        #[unsafe(method(init))]
50        #[unsafe(method_family = init)]
51        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
52
53        #[unsafe(method(new))]
54        #[unsafe(method_family = new)]
55        pub unsafe fn new() -> Retained<Self>;
56
57        #[unsafe(method(isEmpty))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn isEmpty(&self) -> bool;
60
61        #[unsafe(method(location))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn location(&self) -> Retained<ProtocolObject<dyn NSTextLocation>>;
64
65        #[unsafe(method(endLocation))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn endLocation(&self) -> Retained<ProtocolObject<dyn NSTextLocation>>;
68
69        #[unsafe(method(isEqualToTextRange:))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn isEqualToTextRange(&self, text_range: &NSTextRange) -> bool;
72
73        #[unsafe(method(containsLocation:))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn containsLocation(
76            &self,
77            location: &ProtocolObject<dyn NSTextLocation>,
78        ) -> bool;
79
80        #[unsafe(method(containsRange:))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn containsRange(&self, text_range: &NSTextRange) -> bool;
83
84        #[unsafe(method(intersectsWithTextRange:))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn intersectsWithTextRange(&self, text_range: &NSTextRange) -> bool;
87
88        #[unsafe(method(textRangeByIntersectingWithTextRange:))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn textRangeByIntersectingWithTextRange(
91            &self,
92            text_range: &NSTextRange,
93        ) -> Option<Retained<Self>>;
94
95        #[unsafe(method(textRangeByFormingUnionWithTextRange:))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn textRangeByFormingUnionWithTextRange(
98            &self,
99            text_range: &NSTextRange,
100        ) -> Retained<Self>;
101    );
102}