//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistoptions?language=objc)
// NS_OPTIONS
#[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);
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkerformat?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type NSTextListMarkerFormat = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkerbox?language=objc)
    pub static NSTextListMarkerBox: &'static NSTextListMarkerFormat;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkercheck?language=objc)
    pub static NSTextListMarkerCheck: &'static NSTextListMarkerFormat;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkercircle?language=objc)
    pub static NSTextListMarkerCircle: &'static NSTextListMarkerFormat;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkerdiamond?language=objc)
    pub static NSTextListMarkerDiamond: &'static NSTextListMarkerFormat;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkerdisc?language=objc)
    pub static NSTextListMarkerDisc: &'static NSTextListMarkerFormat;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkerhyphen?language=objc)
    pub static NSTextListMarkerHyphen: &'static NSTextListMarkerFormat;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkersquare?language=objc)
    pub static NSTextListMarkerSquare: &'static NSTextListMarkerFormat;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkerlowercasehexadecimal?language=objc)
    pub static NSTextListMarkerLowercaseHexadecimal: &'static NSTextListMarkerFormat;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkeruppercasehexadecimal?language=objc)
    pub static NSTextListMarkerUppercaseHexadecimal: &'static NSTextListMarkerFormat;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkeroctal?language=objc)
    pub static NSTextListMarkerOctal: &'static NSTextListMarkerFormat;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkerlowercasealpha?language=objc)
    pub static NSTextListMarkerLowercaseAlpha: &'static NSTextListMarkerFormat;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkeruppercasealpha?language=objc)
    pub static NSTextListMarkerUppercaseAlpha: &'static NSTextListMarkerFormat;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkerlowercaselatin?language=objc)
    pub static NSTextListMarkerLowercaseLatin: &'static NSTextListMarkerFormat;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkeruppercaselatin?language=objc)
    pub static NSTextListMarkerUppercaseLatin: &'static NSTextListMarkerFormat;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkerlowercaseroman?language=objc)
    pub static NSTextListMarkerLowercaseRoman: &'static NSTextListMarkerFormat;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkeruppercaseroman?language=objc)
    pub static NSTextListMarkerUppercaseRoman: &'static NSTextListMarkerFormat;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlistmarkerdecimal?language=objc)
    pub static NSTextListMarkerDecimal: &'static NSTextListMarkerFormat;
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlist?language=objc)
    #[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>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[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;

        /// Setter for [`startingItemNumber`][Self::startingItemNumber].
        #[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;
    );
}

/// Methods declared on superclass `NSObject`.
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()
    }
}
