icrate/generated/AppKit/
NSTextRange.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use crate::common::*;
4use crate::AppKit::*;
5use crate::CoreData::*;
6use crate::Foundation::*;
7
8extern_protocol!(
9    pub unsafe trait NSTextLocation: NSObjectProtocol {
10        #[method(compare:)]
11        unsafe fn compare(
12            &self,
13            location: &ProtocolObject<dyn NSTextLocation>,
14        ) -> NSComparisonResult;
15    }
16
17    unsafe impl ProtocolType for dyn NSTextLocation {}
18);
19
20extern_class!(
21    #[derive(Debug, PartialEq, Eq, Hash)]
22    #[cfg(feature = "AppKit_NSTextRange")]
23    pub struct NSTextRange;
24
25    #[cfg(feature = "AppKit_NSTextRange")]
26    unsafe impl ClassType for NSTextRange {
27        type Super = NSObject;
28        type Mutability = InteriorMutable;
29    }
30);
31
32#[cfg(feature = "AppKit_NSTextRange")]
33unsafe impl NSObjectProtocol for NSTextRange {}
34
35extern_methods!(
36    #[cfg(feature = "AppKit_NSTextRange")]
37    unsafe impl NSTextRange {
38        #[method_id(@__retain_semantics Init initWithLocation:endLocation:)]
39        pub unsafe fn initWithLocation_endLocation(
40            this: Allocated<Self>,
41            location: &ProtocolObject<dyn NSTextLocation>,
42            end_location: Option<&ProtocolObject<dyn NSTextLocation>>,
43        ) -> Option<Id<Self>>;
44
45        #[method_id(@__retain_semantics Init initWithLocation:)]
46        pub unsafe fn initWithLocation(
47            this: Allocated<Self>,
48            location: &ProtocolObject<dyn NSTextLocation>,
49        ) -> Id<Self>;
50
51        #[method_id(@__retain_semantics Init init)]
52        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
53
54        #[method_id(@__retain_semantics New new)]
55        pub unsafe fn new() -> Id<Self>;
56
57        #[method(isEmpty)]
58        pub unsafe fn isEmpty(&self) -> bool;
59
60        #[method_id(@__retain_semantics Other location)]
61        pub unsafe fn location(&self) -> Id<ProtocolObject<dyn NSTextLocation>>;
62
63        #[method_id(@__retain_semantics Other endLocation)]
64        pub unsafe fn endLocation(&self) -> Id<ProtocolObject<dyn NSTextLocation>>;
65
66        #[method(isEqualToTextRange:)]
67        pub unsafe fn isEqualToTextRange(&self, text_range: &NSTextRange) -> bool;
68
69        #[method(containsLocation:)]
70        pub unsafe fn containsLocation(
71            &self,
72            location: &ProtocolObject<dyn NSTextLocation>,
73        ) -> bool;
74
75        #[method(containsRange:)]
76        pub unsafe fn containsRange(&self, text_range: &NSTextRange) -> bool;
77
78        #[method(intersectsWithTextRange:)]
79        pub unsafe fn intersectsWithTextRange(&self, text_range: &NSTextRange) -> bool;
80
81        #[method_id(@__retain_semantics Other textRangeByIntersectingWithTextRange:)]
82        pub unsafe fn textRangeByIntersectingWithTextRange(
83            &self,
84            text_range: &NSTextRange,
85        ) -> Option<Id<Self>>;
86
87        #[method_id(@__retain_semantics Other textRangeByFormingUnionWithTextRange:)]
88        pub unsafe fn textRangeByFormingUnionWithTextRange(
89            &self,
90            text_range: &NSTextRange,
91        ) -> Id<Self>;
92    }
93);