use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTextListOptions(pub NSUInteger);
bitflags::bitflags! {
impl NSTextListOptions: NSUInteger {
#[doc(alias = "NSTextListPrependEnclosingMarker")]
const PrependEnclosingMarker = 1<<0;
}
}
unsafe impl Encode for NSTextListOptions {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSTextListOptions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type NSTextListMarkerFormat = NSString;
extern "C" {
pub static NSTextListMarkerBox: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerCheck: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerCircle: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerDiamond: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerDisc: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerHyphen: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerSquare: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerLowercaseHexadecimal: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerUppercaseHexadecimal: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerOctal: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerLowercaseAlpha: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerUppercaseAlpha: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerLowercaseLatin: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerUppercaseLatin: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerLowercaseRoman: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerUppercaseRoman: &'static NSTextListMarkerFormat;
}
extern "C" {
pub static NSTextListMarkerDecimal: &'static NSTextListMarkerFormat;
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSTextList;
);
extern_conformance!(
unsafe impl NSCoding for NSTextList {}
);
extern_conformance!(
unsafe impl NSCopying for NSTextList {}
);
unsafe impl CopyingHelper for NSTextList {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSTextList {}
);
extern_conformance!(
unsafe impl NSSecureCoding for NSTextList {}
);
impl NSTextList {
extern_methods!(
#[unsafe(method(initWithMarkerFormat:options:startingItemNumber:))]
#[unsafe(method_family = init)]
pub fn initWithMarkerFormat_options_startingItemNumber(
this: Allocated<Self>,
marker_format: &NSTextListMarkerFormat,
options: NSTextListOptions,
starting_item_number: NSInteger,
) -> Retained<Self>;
#[unsafe(method(initWithMarkerFormat:options:))]
#[unsafe(method_family = init)]
pub fn initWithMarkerFormat_options(
this: Allocated<Self>,
marker_format: &NSTextListMarkerFormat,
options: NSUInteger,
) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(markerFormat))]
#[unsafe(method_family = none)]
pub fn markerFormat(&self) -> Retained<NSTextListMarkerFormat>;
#[unsafe(method(listOptions))]
#[unsafe(method_family = none)]
pub fn listOptions(&self) -> NSTextListOptions;
#[unsafe(method(startingItemNumber))]
#[unsafe(method_family = none)]
pub fn startingItemNumber(&self) -> NSInteger;
#[unsafe(method(setStartingItemNumber:))]
#[unsafe(method_family = none)]
pub fn setStartingItemNumber(&self, starting_item_number: NSInteger);
#[unsafe(method(isOrdered))]
#[unsafe(method_family = none)]
pub fn isOrdered(&self) -> bool;
#[unsafe(method(markerForItemNumber:))]
#[unsafe(method_family = none)]
pub fn markerForItemNumber(&self, item_number: NSInteger) -> Retained<NSString>;
#[unsafe(method(includesTextListMarkers))]
#[unsafe(method_family = none)]
pub fn includesTextListMarkers() -> bool;
);
}
impl NSTextList {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}
impl DefaultRetained for NSTextList {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}