objc2_app_kit/generated/
NSTextElement.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextelement?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct NSTextElement;
15);
16
17unsafe impl NSObjectProtocol for NSTextElement {}
18
19impl NSTextElement {
20    extern_methods!(
21        #[cfg(feature = "NSTextContentManager")]
22        #[unsafe(method(initWithTextContentManager:))]
23        #[unsafe(method_family = init)]
24        pub unsafe fn initWithTextContentManager(
25            this: Allocated<Self>,
26            text_content_manager: Option<&NSTextContentManager>,
27        ) -> Retained<Self>;
28
29        #[cfg(feature = "NSTextContentManager")]
30        #[unsafe(method(textContentManager))]
31        #[unsafe(method_family = none)]
32        pub unsafe fn textContentManager(&self) -> Option<Retained<NSTextContentManager>>;
33
34        #[cfg(feature = "NSTextContentManager")]
35        /// This is a [weak property][objc2::topics::weak_property].
36        /// Setter for [`textContentManager`][Self::textContentManager].
37        #[unsafe(method(setTextContentManager:))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn setTextContentManager(
40            &self,
41            text_content_manager: Option<&NSTextContentManager>,
42        );
43
44        #[cfg(feature = "NSTextRange")]
45        #[unsafe(method(elementRange))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn elementRange(&self) -> Option<Retained<NSTextRange>>;
48
49        #[cfg(feature = "NSTextRange")]
50        /// Setter for [`elementRange`][Self::elementRange].
51        #[unsafe(method(setElementRange:))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn setElementRange(&self, element_range: Option<&NSTextRange>);
54
55        #[unsafe(method(childElements))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn childElements(&self) -> Retained<NSArray<NSTextElement>>;
58
59        #[unsafe(method(parentElement))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn parentElement(&self) -> Option<Retained<NSTextElement>>;
62
63        #[unsafe(method(isRepresentedElement))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn isRepresentedElement(&self) -> bool;
66    );
67}
68
69/// Methods declared on superclass `NSObject`.
70impl NSTextElement {
71    extern_methods!(
72        #[unsafe(method(init))]
73        #[unsafe(method_family = init)]
74        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
75
76        #[unsafe(method(new))]
77        #[unsafe(method_family = new)]
78        pub unsafe fn new() -> Retained<Self>;
79    );
80}
81
82extern_class!(
83    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextparagraph?language=objc)
84    #[unsafe(super(NSTextElement, NSObject))]
85    #[derive(Debug, PartialEq, Eq, Hash)]
86    pub struct NSTextParagraph;
87);
88
89unsafe impl NSObjectProtocol for NSTextParagraph {}
90
91impl NSTextParagraph {
92    extern_methods!(
93        #[unsafe(method(initWithAttributedString:))]
94        #[unsafe(method_family = init)]
95        pub unsafe fn initWithAttributedString(
96            this: Allocated<Self>,
97            attributed_string: Option<&NSAttributedString>,
98        ) -> Retained<Self>;
99
100        #[unsafe(method(attributedString))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn attributedString(&self) -> Retained<NSAttributedString>;
103
104        #[cfg(feature = "NSTextRange")]
105        #[unsafe(method(paragraphContentRange))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn paragraphContentRange(&self) -> Option<Retained<NSTextRange>>;
108
109        #[cfg(feature = "NSTextRange")]
110        #[unsafe(method(paragraphSeparatorRange))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn paragraphSeparatorRange(&self) -> Option<Retained<NSTextRange>>;
113    );
114}
115
116/// Methods declared on superclass `NSTextElement`.
117impl NSTextParagraph {
118    extern_methods!(
119        #[cfg(feature = "NSTextContentManager")]
120        #[unsafe(method(initWithTextContentManager:))]
121        #[unsafe(method_family = init)]
122        pub unsafe fn initWithTextContentManager(
123            this: Allocated<Self>,
124            text_content_manager: Option<&NSTextContentManager>,
125        ) -> Retained<Self>;
126    );
127}
128
129/// Methods declared on superclass `NSObject`.
130impl NSTextParagraph {
131    extern_methods!(
132        #[unsafe(method(init))]
133        #[unsafe(method_family = init)]
134        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
135
136        #[unsafe(method(new))]
137        #[unsafe(method_family = new)]
138        pub unsafe fn new() -> Retained<Self>;
139    );
140}