objc2_app_kit/generated/
NSTextListElement.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_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextlistelement?language=objc)
11    #[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        /// # Safety
27        ///
28        /// `marker_attributes` generic should be of the correct type.
29        #[unsafe(method(initWithParentElement:textList:contents:markerAttributes:childElements:))]
30        #[unsafe(method_family = init)]
31        pub unsafe fn initWithParentElement_textList_contents_markerAttributes_childElements(
32            this: Allocated<Self>,
33            parent: Option<&NSTextListElement>,
34            text_list: &NSTextList,
35            contents: Option<&NSAttributedString>,
36            marker_attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
37            children: Option<&NSArray<NSTextListElement>>,
38        ) -> Retained<Self>;
39
40        #[unsafe(method(initWithAttributedString:))]
41        #[unsafe(method_family = init)]
42        pub unsafe fn initWithAttributedString(
43            this: Allocated<Self>,
44            attributed_string: Option<&NSAttributedString>,
45        ) -> Retained<Self>;
46
47        #[cfg(feature = "NSTextList")]
48        /// # Safety
49        ///
50        /// `marker_attributes` generic should be of the correct type.
51        #[unsafe(method(textListElementWithContents:markerAttributes:textList:childElements:))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn textListElementWithContents_markerAttributes_textList_childElements(
54            contents: &NSAttributedString,
55            marker_attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
56            text_list: &NSTextList,
57            children: Option<&NSArray<NSTextListElement>>,
58        ) -> Retained<Self>;
59
60        #[cfg(feature = "NSTextList")]
61        #[unsafe(method(textListElementWithChildElements:textList:nestingLevel:))]
62        #[unsafe(method_family = none)]
63        pub fn textListElementWithChildElements_textList_nestingLevel(
64            children: &NSArray<NSTextListElement>,
65            text_list: &NSTextList,
66            nesting_level: NSInteger,
67        ) -> Option<Retained<Self>>;
68
69        #[cfg(feature = "NSTextList")]
70        #[unsafe(method(textList))]
71        #[unsafe(method_family = none)]
72        pub fn textList(&self) -> Retained<NSTextList>;
73
74        #[unsafe(method(contents))]
75        #[unsafe(method_family = none)]
76        pub fn contents(&self) -> Option<Retained<NSAttributedString>>;
77
78        #[unsafe(method(markerAttributes))]
79        #[unsafe(method_family = none)]
80        pub fn markerAttributes(
81            &self,
82        ) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>;
83
84        #[unsafe(method(attributedString))]
85        #[unsafe(method_family = none)]
86        pub fn attributedString(&self) -> Retained<NSAttributedString>;
87
88        #[unsafe(method(childElements))]
89        #[unsafe(method_family = none)]
90        pub fn childElements(&self) -> Retained<NSArray<NSTextListElement>>;
91
92        #[unsafe(method(parentElement))]
93        #[unsafe(method_family = none)]
94        pub fn parentElement(&self) -> Option<Retained<NSTextListElement>>;
95    );
96}
97
98/// Methods declared on superclass `NSTextElement`.
99#[cfg(feature = "NSTextElement")]
100impl NSTextListElement {
101    extern_methods!(
102        #[cfg(feature = "NSTextContentManager")]
103        #[unsafe(method(initWithTextContentManager:))]
104        #[unsafe(method_family = init)]
105        pub fn initWithTextContentManager(
106            this: Allocated<Self>,
107            text_content_manager: Option<&NSTextContentManager>,
108        ) -> Retained<Self>;
109    );
110}
111
112/// Methods declared on superclass `NSObject`.
113#[cfg(feature = "NSTextElement")]
114impl NSTextListElement {
115    extern_methods!(
116        #[unsafe(method(init))]
117        #[unsafe(method_family = init)]
118        pub fn init(this: Allocated<Self>) -> Retained<Self>;
119
120        #[unsafe(method(new))]
121        #[unsafe(method_family = new)]
122        pub fn new() -> Retained<Self>;
123    );
124}
125
126#[cfg(feature = "NSTextElement")]
127impl DefaultRetained for NSTextListElement {
128    #[inline]
129    fn default_retained() -> Retained<Self> {
130        Self::new()
131    }
132}