objc2_ui_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 unsafe 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 unsafe fn initWithMarkerFormat_options(
160 this: Allocated<Self>,
161 marker_format: &NSTextListMarkerFormat,
162 options: NSUInteger,
163 ) -> Retained<Self>;
164
165 #[unsafe(method(initWithCoder:))]
166 #[unsafe(method_family = init)]
167 pub unsafe fn initWithCoder(
168 this: Allocated<Self>,
169 coder: &NSCoder,
170 ) -> Option<Retained<Self>>;
171
172 #[unsafe(method(markerFormat))]
173 #[unsafe(method_family = none)]
174 pub unsafe fn markerFormat(&self) -> Retained<NSTextListMarkerFormat>;
175
176 #[unsafe(method(listOptions))]
177 #[unsafe(method_family = none)]
178 pub unsafe fn listOptions(&self) -> NSTextListOptions;
179
180 #[unsafe(method(startingItemNumber))]
181 #[unsafe(method_family = none)]
182 pub unsafe fn startingItemNumber(&self) -> NSInteger;
183
184 #[unsafe(method(setStartingItemNumber:))]
186 #[unsafe(method_family = none)]
187 pub unsafe fn setStartingItemNumber(&self, starting_item_number: NSInteger);
188
189 #[unsafe(method(isOrdered))]
190 #[unsafe(method_family = none)]
191 pub unsafe fn isOrdered(&self) -> bool;
192
193 #[unsafe(method(markerForItemNumber:))]
194 #[unsafe(method_family = none)]
195 pub unsafe fn markerForItemNumber(&self, item_number: NSInteger) -> Retained<NSString>;
196 );
197}
198
199impl NSTextList {
201 extern_methods!(
202 #[unsafe(method(init))]
203 #[unsafe(method_family = init)]
204 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
205
206 #[unsafe(method(new))]
207 #[unsafe(method_family = new)]
208 pub unsafe fn new() -> Retained<Self>;
209 );
210}