objc2-app-kit 0.3.2

Bindings to the AppKit framework
Documentation
//! 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/appkit/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/appkit/nstextlistmarkerformat?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type NSTextListMarkerFormat = NSString;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/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()
    }
}