//! 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 crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsscanner?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSScanner;
);

#[cfg(feature = "NSObject")]
unsafe impl NSCopying for NSScanner {}

#[cfg(feature = "NSObject")]
unsafe impl CopyingHelper for NSScanner {
    type Result = Self;
}

unsafe impl NSObjectProtocol for NSScanner {}

impl NSScanner {
    extern_methods!(
        #[cfg(feature = "NSString")]
        #[unsafe(method(string))]
        #[unsafe(method_family = none)]
        pub unsafe fn string(&self) -> Retained<NSString>;

        #[unsafe(method(scanLocation))]
        #[unsafe(method_family = none)]
        pub unsafe fn scanLocation(&self) -> NSUInteger;

        /// Setter for [`scanLocation`][Self::scanLocation].
        #[unsafe(method(setScanLocation:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setScanLocation(&self, scan_location: NSUInteger);

        #[cfg(feature = "NSCharacterSet")]
        #[unsafe(method(charactersToBeSkipped))]
        #[unsafe(method_family = none)]
        pub unsafe fn charactersToBeSkipped(&self) -> Option<Retained<NSCharacterSet>>;

        #[cfg(feature = "NSCharacterSet")]
        /// Setter for [`charactersToBeSkipped`][Self::charactersToBeSkipped].
        #[unsafe(method(setCharactersToBeSkipped:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCharactersToBeSkipped(
            &self,
            characters_to_be_skipped: Option<&NSCharacterSet>,
        );

        #[unsafe(method(caseSensitive))]
        #[unsafe(method_family = none)]
        pub unsafe fn caseSensitive(&self) -> bool;

        /// Setter for [`caseSensitive`][Self::caseSensitive].
        #[unsafe(method(setCaseSensitive:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCaseSensitive(&self, case_sensitive: bool);

        #[unsafe(method(locale))]
        #[unsafe(method_family = none)]
        pub unsafe fn locale(&self) -> Option<Retained<AnyObject>>;

        /// Setter for [`locale`][Self::locale].
        #[unsafe(method(setLocale:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLocale(&self, locale: Option<&AnyObject>);

        #[cfg(feature = "NSString")]
        #[unsafe(method(initWithString:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithString(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
impl NSScanner {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

/// NSExtendedScanner.
impl NSScanner {
    extern_methods!(
        #[unsafe(method(scanInt:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scanInt(&self, result: *mut c_int) -> bool;

        #[unsafe(method(scanInteger:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scanInteger(&self, result: *mut NSInteger) -> bool;

        #[unsafe(method(scanLongLong:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scanLongLong(&self, result: *mut c_longlong) -> bool;

        #[unsafe(method(scanUnsignedLongLong:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scanUnsignedLongLong(&self, result: *mut c_ulonglong) -> bool;

        #[unsafe(method(scanFloat:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scanFloat(&self, result: *mut c_float) -> bool;

        #[unsafe(method(scanDouble:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scanDouble(&self, result: *mut c_double) -> bool;

        #[unsafe(method(scanHexInt:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scanHexInt(&self, result: *mut c_uint) -> bool;

        #[unsafe(method(scanHexLongLong:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scanHexLongLong(&self, result: *mut c_ulonglong) -> bool;

        #[unsafe(method(scanHexFloat:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scanHexFloat(&self, result: *mut c_float) -> bool;

        #[unsafe(method(scanHexDouble:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scanHexDouble(&self, result: *mut c_double) -> bool;

        #[cfg(feature = "NSString")]
        #[unsafe(method(scanString:intoString:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scanString_intoString(
            &self,
            string: &NSString,
            result: Option<&mut Option<Retained<NSString>>>,
        ) -> bool;

        #[cfg(all(feature = "NSCharacterSet", feature = "NSString"))]
        #[unsafe(method(scanCharactersFromSet:intoString:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scanCharactersFromSet_intoString(
            &self,
            set: &NSCharacterSet,
            result: Option<&mut Option<Retained<NSString>>>,
        ) -> bool;

        #[cfg(feature = "NSString")]
        #[unsafe(method(scanUpToString:intoString:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scanUpToString_intoString(
            &self,
            string: &NSString,
            result: Option<&mut Option<Retained<NSString>>>,
        ) -> bool;

        #[cfg(all(feature = "NSCharacterSet", feature = "NSString"))]
        #[unsafe(method(scanUpToCharactersFromSet:intoString:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scanUpToCharactersFromSet_intoString(
            &self,
            set: &NSCharacterSet,
            result: Option<&mut Option<Retained<NSString>>>,
        ) -> bool;

        #[unsafe(method(isAtEnd))]
        #[unsafe(method_family = none)]
        pub unsafe fn isAtEnd(&self) -> bool;

        #[cfg(feature = "NSString")]
        #[unsafe(method(scannerWithString:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scannerWithString(string: &NSString) -> Retained<Self>;

        #[cfg(feature = "NSString")]
        #[unsafe(method(localizedScannerWithString:))]
        #[unsafe(method_family = none)]
        pub unsafe fn localizedScannerWithString(string: &NSString) -> Retained<AnyObject>;
    );
}
