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