objc2_app_kit/generated/
NSTextList.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct NSTextListOptions(pub NSUInteger);
15bitflags::bitflags! {
16 impl NSTextListOptions: NSUInteger {
17 #[doc(alias = "NSTextListPrependEnclosingMarker")]
18 const PrependEnclosingMarker = 1<<0;
19 }
20}
21
22unsafe impl Encode for NSTextListOptions {
23 const ENCODING: Encoding = NSUInteger::ENCODING;
24}
25
26unsafe impl RefEncode for NSTextListOptions {
27 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
28}
29
30pub type NSTextListMarkerFormat = NSString;
33
34extern "C" {
35 pub static NSTextListMarkerBox: &'static NSTextListMarkerFormat;
37}
38
39extern "C" {
40 pub static NSTextListMarkerCheck: &'static NSTextListMarkerFormat;
42}
43
44extern "C" {
45 pub static NSTextListMarkerCircle: &'static NSTextListMarkerFormat;
47}
48
49extern "C" {
50 pub static NSTextListMarkerDiamond: &'static NSTextListMarkerFormat;
52}
53
54extern "C" {
55 pub static NSTextListMarkerDisc: &'static NSTextListMarkerFormat;
57}
58
59extern "C" {
60 pub static NSTextListMarkerHyphen: &'static NSTextListMarkerFormat;
62}
63
64extern "C" {
65 pub static NSTextListMarkerSquare: &'static NSTextListMarkerFormat;
67}
68
69extern "C" {
70 pub static NSTextListMarkerLowercaseHexadecimal: &'static NSTextListMarkerFormat;
72}
73
74extern "C" {
75 pub static NSTextListMarkerUppercaseHexadecimal: &'static NSTextListMarkerFormat;
77}
78
79extern "C" {
80 pub static NSTextListMarkerOctal: &'static NSTextListMarkerFormat;
82}
83
84extern "C" {
85 pub static NSTextListMarkerLowercaseAlpha: &'static NSTextListMarkerFormat;
87}
88
89extern "C" {
90 pub static NSTextListMarkerUppercaseAlpha: &'static NSTextListMarkerFormat;
92}
93
94extern "C" {
95 pub static NSTextListMarkerLowercaseLatin: &'static NSTextListMarkerFormat;
97}
98
99extern "C" {
100 pub static NSTextListMarkerUppercaseLatin: &'static NSTextListMarkerFormat;
102}
103
104extern "C" {
105 pub static NSTextListMarkerLowercaseRoman: &'static NSTextListMarkerFormat;
107}
108
109extern "C" {
110 pub static NSTextListMarkerUppercaseRoman: &'static NSTextListMarkerFormat;
112}
113
114extern "C" {
115 pub static NSTextListMarkerDecimal: &'static NSTextListMarkerFormat;
117}
118
119extern_class!(
120 #[unsafe(super(NSObject))]
122 #[derive(Debug, PartialEq, Eq, Hash)]
123 pub struct NSTextList;
124);
125
126extern_conformance!(
127 unsafe impl NSCoding for NSTextList {}
128);
129
130extern_conformance!(
131 unsafe impl NSCopying for NSTextList {}
132);
133
134unsafe impl CopyingHelper for NSTextList {
135 type Result = Self;
136}
137
138extern_conformance!(
139 unsafe impl NSObjectProtocol for NSTextList {}
140);
141
142extern_conformance!(
143 unsafe impl NSSecureCoding for NSTextList {}
144);
145
146impl NSTextList {
147 extern_methods!(
148 #[unsafe(method(initWithMarkerFormat:options:startingItemNumber:))]
149 #[unsafe(method_family = init)]
150 pub fn initWithMarkerFormat_options_startingItemNumber(
151 this: Allocated<Self>,
152 marker_format: &NSTextListMarkerFormat,
153 options: NSTextListOptions,
154 starting_item_number: NSInteger,
155 ) -> Retained<Self>;
156
157 #[unsafe(method(initWithMarkerFormat:options:))]
158 #[unsafe(method_family = init)]
159 pub fn initWithMarkerFormat_options(
160 this: Allocated<Self>,
161 marker_format: &NSTextListMarkerFormat,
162 options: NSUInteger,
163 ) -> Retained<Self>;
164
165 #[unsafe(method(initWithCoder:))]
169 #[unsafe(method_family = init)]
170 pub unsafe fn initWithCoder(
171 this: Allocated<Self>,
172 coder: &NSCoder,
173 ) -> Option<Retained<Self>>;
174
175 #[unsafe(method(markerFormat))]
176 #[unsafe(method_family = none)]
177 pub fn markerFormat(&self) -> Retained<NSTextListMarkerFormat>;
178
179 #[unsafe(method(listOptions))]
180 #[unsafe(method_family = none)]
181 pub fn listOptions(&self) -> NSTextListOptions;
182
183 #[unsafe(method(startingItemNumber))]
184 #[unsafe(method_family = none)]
185 pub fn startingItemNumber(&self) -> NSInteger;
186
187 #[unsafe(method(setStartingItemNumber:))]
189 #[unsafe(method_family = none)]
190 pub fn setStartingItemNumber(&self, starting_item_number: NSInteger);
191
192 #[unsafe(method(isOrdered))]
193 #[unsafe(method_family = none)]
194 pub fn isOrdered(&self) -> bool;
195
196 #[unsafe(method(markerForItemNumber:))]
197 #[unsafe(method_family = none)]
198 pub fn markerForItemNumber(&self, item_number: NSInteger) -> Retained<NSString>;
199
200 #[unsafe(method(includesTextListMarkers))]
201 #[unsafe(method_family = none)]
202 pub fn includesTextListMarkers() -> bool;
203 );
204}
205
206impl NSTextList {
208 extern_methods!(
209 #[unsafe(method(init))]
210 #[unsafe(method_family = init)]
211 pub fn init(this: Allocated<Self>) -> Retained<Self>;
212
213 #[unsafe(method(new))]
214 #[unsafe(method_family = new)]
215 pub fn new() -> Retained<Self>;
216 );
217}
218
219impl DefaultRetained for NSTextList {
220 #[inline]
221 fn default_retained() -> Retained<Self> {
222 Self::new()
223 }
224}