objc2_ui_kit/generated/
NSTextElement.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSObject))]
13 #[derive(Debug, PartialEq, Eq, Hash)]
14 pub struct NSTextElement;
15);
16
17extern_conformance!(
18 unsafe impl NSObjectProtocol for NSTextElement {}
19);
20
21impl NSTextElement {
22 extern_methods!(
23 #[cfg(feature = "NSTextContentManager")]
24 #[unsafe(method(initWithTextContentManager:))]
25 #[unsafe(method_family = init)]
26 pub unsafe fn initWithTextContentManager(
27 this: Allocated<Self>,
28 text_content_manager: Option<&NSTextContentManager>,
29 ) -> Retained<Self>;
30
31 #[cfg(feature = "NSTextContentManager")]
32 #[unsafe(method(textContentManager))]
33 #[unsafe(method_family = none)]
34 pub unsafe fn textContentManager(&self) -> Option<Retained<NSTextContentManager>>;
35
36 #[cfg(feature = "NSTextContentManager")]
37 #[unsafe(method(setTextContentManager:))]
40 #[unsafe(method_family = none)]
41 pub unsafe fn setTextContentManager(
42 &self,
43 text_content_manager: Option<&NSTextContentManager>,
44 );
45
46 #[cfg(feature = "NSTextRange")]
47 #[unsafe(method(elementRange))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn elementRange(&self) -> Option<Retained<NSTextRange>>;
50
51 #[cfg(feature = "NSTextRange")]
52 #[unsafe(method(setElementRange:))]
54 #[unsafe(method_family = none)]
55 pub unsafe fn setElementRange(&self, element_range: Option<&NSTextRange>);
56
57 #[unsafe(method(childElements))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn childElements(&self) -> Retained<NSArray<NSTextElement>>;
60
61 #[unsafe(method(parentElement))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn parentElement(&self) -> Option<Retained<NSTextElement>>;
64
65 #[unsafe(method(isRepresentedElement))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn isRepresentedElement(&self) -> bool;
68 );
69}
70
71impl NSTextElement {
73 extern_methods!(
74 #[unsafe(method(init))]
75 #[unsafe(method_family = init)]
76 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
77
78 #[unsafe(method(new))]
79 #[unsafe(method_family = new)]
80 pub unsafe fn new() -> Retained<Self>;
81 );
82}
83
84extern_class!(
85 #[unsafe(super(NSTextElement, NSObject))]
87 #[derive(Debug, PartialEq, Eq, Hash)]
88 pub struct NSTextParagraph;
89);
90
91extern_conformance!(
92 unsafe impl NSObjectProtocol for NSTextParagraph {}
93);
94
95impl NSTextParagraph {
96 extern_methods!(
97 #[unsafe(method(initWithAttributedString:))]
98 #[unsafe(method_family = init)]
99 pub unsafe fn initWithAttributedString(
100 this: Allocated<Self>,
101 attributed_string: Option<&NSAttributedString>,
102 ) -> Retained<Self>;
103
104 #[unsafe(method(attributedString))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn attributedString(&self) -> Retained<NSAttributedString>;
107
108 #[cfg(feature = "NSTextRange")]
109 #[unsafe(method(paragraphContentRange))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn paragraphContentRange(&self) -> Option<Retained<NSTextRange>>;
112
113 #[cfg(feature = "NSTextRange")]
114 #[unsafe(method(paragraphSeparatorRange))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn paragraphSeparatorRange(&self) -> Option<Retained<NSTextRange>>;
117 );
118}
119
120impl NSTextParagraph {
122 extern_methods!(
123 #[cfg(feature = "NSTextContentManager")]
124 #[unsafe(method(initWithTextContentManager:))]
125 #[unsafe(method_family = init)]
126 pub unsafe fn initWithTextContentManager(
127 this: Allocated<Self>,
128 text_content_manager: Option<&NSTextContentManager>,
129 ) -> Retained<Self>;
130 );
131}
132
133impl NSTextParagraph {
135 extern_methods!(
136 #[unsafe(method(init))]
137 #[unsafe(method_family = init)]
138 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
139
140 #[unsafe(method(new))]
141 #[unsafe(method_family = new)]
142 pub unsafe fn new() -> Retained<Self>;
143 );
144}