objc2_app_kit/generated/
NSTextListElement.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10 #[unsafe(super(NSTextParagraph, NSTextElement, NSObject))]
12 #[derive(Debug, PartialEq, Eq, Hash)]
13 #[cfg(feature = "NSTextElement")]
14 pub struct NSTextListElement;
15);
16
17#[cfg(feature = "NSTextElement")]
18extern_conformance!(
19 unsafe impl NSObjectProtocol for NSTextListElement {}
20);
21
22#[cfg(feature = "NSTextElement")]
23impl NSTextListElement {
24 extern_methods!(
25 #[cfg(feature = "NSTextList")]
26 #[unsafe(method(initWithParentElement:textList:contents:markerAttributes:childElements:))]
27 #[unsafe(method_family = init)]
28 pub unsafe fn initWithParentElement_textList_contents_markerAttributes_childElements(
29 this: Allocated<Self>,
30 parent: Option<&NSTextListElement>,
31 text_list: &NSTextList,
32 contents: Option<&NSAttributedString>,
33 marker_attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
34 children: Option<&NSArray<NSTextListElement>>,
35 ) -> Retained<Self>;
36
37 #[unsafe(method(initWithAttributedString:))]
38 #[unsafe(method_family = init)]
39 pub unsafe fn initWithAttributedString(
40 this: Allocated<Self>,
41 attributed_string: Option<&NSAttributedString>,
42 ) -> Retained<Self>;
43
44 #[cfg(feature = "NSTextList")]
45 #[unsafe(method(textListElementWithContents:markerAttributes:textList:childElements:))]
46 #[unsafe(method_family = none)]
47 pub unsafe fn textListElementWithContents_markerAttributes_textList_childElements(
48 contents: &NSAttributedString,
49 marker_attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
50 text_list: &NSTextList,
51 children: Option<&NSArray<NSTextListElement>>,
52 ) -> Retained<Self>;
53
54 #[cfg(feature = "NSTextList")]
55 #[unsafe(method(textListElementWithChildElements:textList:nestingLevel:))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn textListElementWithChildElements_textList_nestingLevel(
58 children: &NSArray<NSTextListElement>,
59 text_list: &NSTextList,
60 nesting_level: NSInteger,
61 ) -> Option<Retained<Self>>;
62
63 #[cfg(feature = "NSTextList")]
64 #[unsafe(method(textList))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn textList(&self) -> Retained<NSTextList>;
67
68 #[unsafe(method(contents))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn contents(&self) -> Option<Retained<NSAttributedString>>;
71
72 #[unsafe(method(markerAttributes))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn markerAttributes(
75 &self,
76 ) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>;
77
78 #[unsafe(method(attributedString))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn attributedString(&self) -> Retained<NSAttributedString>;
81
82 #[unsafe(method(childElements))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn childElements(&self) -> Retained<NSArray<NSTextListElement>>;
85
86 #[unsafe(method(parentElement))]
87 #[unsafe(method_family = none)]
88 pub unsafe fn parentElement(&self) -> Option<Retained<NSTextListElement>>;
89 );
90}
91
92#[cfg(feature = "NSTextElement")]
94impl NSTextListElement {
95 extern_methods!(
96 #[cfg(feature = "NSTextContentManager")]
97 #[unsafe(method(initWithTextContentManager:))]
98 #[unsafe(method_family = init)]
99 pub unsafe fn initWithTextContentManager(
100 this: Allocated<Self>,
101 text_content_manager: Option<&NSTextContentManager>,
102 ) -> Retained<Self>;
103 );
104}
105
106#[cfg(feature = "NSTextElement")]
108impl NSTextListElement {
109 extern_methods!(
110 #[unsafe(method(init))]
111 #[unsafe(method_family = init)]
112 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
113
114 #[unsafe(method(new))]
115 #[unsafe(method_family = new)]
116 pub unsafe fn new() -> Retained<Self>;
117 );
118}