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

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

unsafe impl NSObjectProtocol for NSTextCheckingController {}

impl NSTextCheckingController {
    extern_methods!(
        #[cfg(all(feature = "NSTextCheckingClient", feature = "NSTextInputClient"))]
        #[unsafe(method(initWithClient:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithClient(
            this: Allocated<Self>,
            client: &ProtocolObject<dyn NSTextCheckingClient>,
        ) -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(all(feature = "NSTextCheckingClient", feature = "NSTextInputClient"))]
        #[unsafe(method(client))]
        #[unsafe(method_family = none)]
        pub unsafe fn client(&self) -> Retained<ProtocolObject<dyn NSTextCheckingClient>>;

        #[unsafe(method(invalidate))]
        #[unsafe(method_family = none)]
        pub unsafe fn invalidate(&self);

        #[unsafe(method(didChangeTextInRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn didChangeTextInRange(&self, range: NSRange);

        #[unsafe(method(insertedTextInRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn insertedTextInRange(&self, range: NSRange);

        #[unsafe(method(didChangeSelectedRange))]
        #[unsafe(method_family = none)]
        pub unsafe fn didChangeSelectedRange(&self);

        #[unsafe(method(considerTextCheckingForRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn considerTextCheckingForRange(&self, range: NSRange);

        #[cfg(feature = "NSSpellChecker")]
        #[unsafe(method(checkTextInRange:types:options:))]
        #[unsafe(method_family = none)]
        pub unsafe fn checkTextInRange_types_options(
            &self,
            range: NSRange,
            checking_types: NSTextCheckingTypes,
            options: &NSDictionary<NSTextCheckingOptionKey, AnyObject>,
        );

        #[unsafe(method(checkTextInSelection:))]
        #[unsafe(method_family = none)]
        pub unsafe fn checkTextInSelection(&self, sender: Option<&AnyObject>);

        #[unsafe(method(checkTextInDocument:))]
        #[unsafe(method_family = none)]
        pub unsafe fn checkTextInDocument(&self, sender: Option<&AnyObject>);

        #[unsafe(method(orderFrontSubstitutionsPanel:))]
        #[unsafe(method_family = none)]
        pub unsafe fn orderFrontSubstitutionsPanel(&self, sender: Option<&AnyObject>);

        #[unsafe(method(checkSpelling:))]
        #[unsafe(method_family = none)]
        pub unsafe fn checkSpelling(&self, sender: Option<&AnyObject>);

        #[unsafe(method(showGuessPanel:))]
        #[unsafe(method_family = none)]
        pub unsafe fn showGuessPanel(&self, sender: Option<&AnyObject>);

        #[unsafe(method(changeSpelling:))]
        #[unsafe(method_family = none)]
        pub unsafe fn changeSpelling(&self, sender: Option<&AnyObject>);

        #[unsafe(method(ignoreSpelling:))]
        #[unsafe(method_family = none)]
        pub unsafe fn ignoreSpelling(&self, sender: Option<&AnyObject>);

        #[unsafe(method(updateCandidates))]
        #[unsafe(method_family = none)]
        pub unsafe fn updateCandidates(&self);

        #[unsafe(method(validAnnotations))]
        #[unsafe(method_family = none)]
        pub unsafe fn validAnnotations(&self) -> Retained<NSArray<NSAttributedStringKey>>;

        #[cfg(feature = "NSMenu")]
        #[unsafe(method(menuAtIndex:clickedOnSelection:effectiveRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn menuAtIndex_clickedOnSelection_effectiveRange(
            &self,
            location: NSUInteger,
            clicked_on_selection: bool,
            effective_range: NSRangePointer,
            mtm: MainThreadMarker,
        ) -> Option<Retained<NSMenu>>;

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

        /// Setter for [`spellCheckerDocumentTag`][Self::spellCheckerDocumentTag].
        #[unsafe(method(setSpellCheckerDocumentTag:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSpellCheckerDocumentTag(&self, spell_checker_document_tag: NSInteger);
    );
}

/// Methods declared on superclass `NSObject`.
impl NSTextCheckingController {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}
