objc2_ui_kit/generated/
NSTextList.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistoptions?language=objc)
11// NS_OPTIONS
12#[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
30/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkerformat?language=objc)
31// NS_TYPED_EXTENSIBLE_ENUM
32pub type NSTextListMarkerFormat = NSString;
33
34extern "C" {
35    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkerbox?language=objc)
36    pub static NSTextListMarkerBox: &'static NSTextListMarkerFormat;
37}
38
39extern "C" {
40    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkercheck?language=objc)
41    pub static NSTextListMarkerCheck: &'static NSTextListMarkerFormat;
42}
43
44extern "C" {
45    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkercircle?language=objc)
46    pub static NSTextListMarkerCircle: &'static NSTextListMarkerFormat;
47}
48
49extern "C" {
50    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkerdiamond?language=objc)
51    pub static NSTextListMarkerDiamond: &'static NSTextListMarkerFormat;
52}
53
54extern "C" {
55    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkerdisc?language=objc)
56    pub static NSTextListMarkerDisc: &'static NSTextListMarkerFormat;
57}
58
59extern "C" {
60    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkerhyphen?language=objc)
61    pub static NSTextListMarkerHyphen: &'static NSTextListMarkerFormat;
62}
63
64extern "C" {
65    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkersquare?language=objc)
66    pub static NSTextListMarkerSquare: &'static NSTextListMarkerFormat;
67}
68
69extern "C" {
70    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkerlowercasehexadecimal?language=objc)
71    pub static NSTextListMarkerLowercaseHexadecimal: &'static NSTextListMarkerFormat;
72}
73
74extern "C" {
75    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkeruppercasehexadecimal?language=objc)
76    pub static NSTextListMarkerUppercaseHexadecimal: &'static NSTextListMarkerFormat;
77}
78
79extern "C" {
80    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkeroctal?language=objc)
81    pub static NSTextListMarkerOctal: &'static NSTextListMarkerFormat;
82}
83
84extern "C" {
85    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkerlowercasealpha?language=objc)
86    pub static NSTextListMarkerLowercaseAlpha: &'static NSTextListMarkerFormat;
87}
88
89extern "C" {
90    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkeruppercasealpha?language=objc)
91    pub static NSTextListMarkerUppercaseAlpha: &'static NSTextListMarkerFormat;
92}
93
94extern "C" {
95    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkerlowercaselatin?language=objc)
96    pub static NSTextListMarkerLowercaseLatin: &'static NSTextListMarkerFormat;
97}
98
99extern "C" {
100    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkeruppercaselatin?language=objc)
101    pub static NSTextListMarkerUppercaseLatin: &'static NSTextListMarkerFormat;
102}
103
104extern "C" {
105    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkerlowercaseroman?language=objc)
106    pub static NSTextListMarkerLowercaseRoman: &'static NSTextListMarkerFormat;
107}
108
109extern "C" {
110    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkeruppercaseroman?language=objc)
111    pub static NSTextListMarkerUppercaseRoman: &'static NSTextListMarkerFormat;
112}
113
114extern "C" {
115    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkerdecimal?language=objc)
116    pub static NSTextListMarkerDecimal: &'static NSTextListMarkerFormat;
117}
118
119extern_class!(
120    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlist?language=objc)
121    #[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        /// Setter for [`startingItemNumber`][Self::startingItemNumber].
185        #[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
199/// Methods declared on superclass `NSObject`.
200impl 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}