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
126unsafe impl NSCoding for NSTextList {}
127
128unsafe impl NSCopying for NSTextList {}
129
130unsafe impl CopyingHelper for NSTextList {
131 type Result = Self;
132}
133
134unsafe impl NSObjectProtocol for NSTextList {}
135
136unsafe impl NSSecureCoding for NSTextList {}
137
138impl NSTextList {
139 extern_methods!(
140 #[unsafe(method(initWithMarkerFormat:options:startingItemNumber:))]
141 #[unsafe(method_family = init)]
142 pub unsafe fn initWithMarkerFormat_options_startingItemNumber(
143 this: Allocated<Self>,
144 marker_format: &NSTextListMarkerFormat,
145 options: NSTextListOptions,
146 starting_item_number: NSInteger,
147 ) -> Retained<Self>;
148
149 #[unsafe(method(initWithMarkerFormat:options:))]
150 #[unsafe(method_family = init)]
151 pub unsafe fn initWithMarkerFormat_options(
152 this: Allocated<Self>,
153 marker_format: &NSTextListMarkerFormat,
154 options: NSUInteger,
155 ) -> Retained<Self>;
156
157 #[unsafe(method(initWithCoder:))]
158 #[unsafe(method_family = init)]
159 pub unsafe fn initWithCoder(
160 this: Allocated<Self>,
161 coder: &NSCoder,
162 ) -> Option<Retained<Self>>;
163
164 #[unsafe(method(markerFormat))]
165 #[unsafe(method_family = none)]
166 pub unsafe fn markerFormat(&self) -> Retained<NSTextListMarkerFormat>;
167
168 #[unsafe(method(listOptions))]
169 #[unsafe(method_family = none)]
170 pub unsafe fn listOptions(&self) -> NSTextListOptions;
171
172 #[unsafe(method(startingItemNumber))]
173 #[unsafe(method_family = none)]
174 pub unsafe fn startingItemNumber(&self) -> NSInteger;
175
176 #[unsafe(method(setStartingItemNumber:))]
178 #[unsafe(method_family = none)]
179 pub unsafe fn setStartingItemNumber(&self, starting_item_number: NSInteger);
180
181 #[unsafe(method(isOrdered))]
182 #[unsafe(method_family = none)]
183 pub unsafe fn isOrdered(&self) -> bool;
184
185 #[unsafe(method(markerForItemNumber:))]
186 #[unsafe(method_family = none)]
187 pub unsafe fn markerForItemNumber(&self, item_number: NSInteger) -> Retained<NSString>;
188 );
189}
190
191impl NSTextList {
193 extern_methods!(
194 #[unsafe(method(init))]
195 #[unsafe(method_family = init)]
196 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
197
198 #[unsafe(method(new))]
199 #[unsafe(method_family = new)]
200 pub unsafe fn new() -> Retained<Self>;
201 );
202}