//! 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_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsinputserviceprovider?language=objc)
    pub unsafe trait NSInputServiceProvider {
        /// # Safety
        ///
        /// - `string` should be of the correct type.
        /// - `string` might not allow `None`.
        /// - `sender` should be of the correct type.
        /// - `sender` might not allow `None`.
        #[deprecated]
        #[unsafe(method(insertText:client:))]
        #[unsafe(method_family = none)]
        unsafe fn insertText_client(&self, string: Option<&AnyObject>, sender: Option<&AnyObject>);

        /// # Safety
        ///
        /// - `selector` must be a valid selector.
        /// - `sender` should be of the correct type.
        /// - `sender` might not allow `None`.
        #[deprecated]
        #[unsafe(method(doCommandBySelector:client:))]
        #[unsafe(method_family = none)]
        unsafe fn doCommandBySelector_client(
            &self,
            selector: Option<Sel>,
            sender: Option<&AnyObject>,
        );

        /// # Safety
        ///
        /// `sender` should be of the correct type.
        #[deprecated]
        #[unsafe(method(markedTextAbandoned:))]
        #[unsafe(method_family = none)]
        unsafe fn markedTextAbandoned(&self, sender: Option<&AnyObject>);

        /// # Safety
        ///
        /// - `sender` should be of the correct type.
        /// - `sender` might not allow `None`.
        #[deprecated]
        #[unsafe(method(markedTextSelectionChanged:client:))]
        #[unsafe(method_family = none)]
        unsafe fn markedTextSelectionChanged_client(
            &self,
            new_sel: NSRange,
            sender: Option<&AnyObject>,
        );

        /// # Safety
        ///
        /// `sender` should be of the correct type.
        #[deprecated]
        #[unsafe(method(terminate:))]
        #[unsafe(method_family = none)]
        unsafe fn terminate(&self, sender: Option<&AnyObject>);

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

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

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

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

        /// # Safety
        ///
        /// `sender` should be of the correct type.
        #[deprecated]
        #[unsafe(method(inputClientBecomeActive:))]
        #[unsafe(method_family = none)]
        unsafe fn inputClientBecomeActive(&self, sender: Option<&AnyObject>);

        /// # Safety
        ///
        /// `sender` should be of the correct type.
        #[deprecated]
        #[unsafe(method(inputClientResignActive:))]
        #[unsafe(method_family = none)]
        unsafe fn inputClientResignActive(&self, sender: Option<&AnyObject>);

        /// # Safety
        ///
        /// `sender` should be of the correct type.
        #[deprecated]
        #[unsafe(method(inputClientEnabled:))]
        #[unsafe(method_family = none)]
        unsafe fn inputClientEnabled(&self, sender: Option<&AnyObject>);

        /// # Safety
        ///
        /// `sender` should be of the correct type.
        #[deprecated]
        #[unsafe(method(inputClientDisabled:))]
        #[unsafe(method_family = none)]
        unsafe fn inputClientDisabled(&self, sender: Option<&AnyObject>);

        /// # Safety
        ///
        /// - `sender` should be of the correct type.
        /// - `sender` might not allow `None`.
        #[deprecated]
        #[unsafe(method(activeConversationWillChange:fromOldConversation:))]
        #[unsafe(method_family = none)]
        unsafe fn activeConversationWillChange_fromOldConversation(
            &self,
            sender: Option<&AnyObject>,
            old_conversation: NSInteger,
        );

        /// # Safety
        ///
        /// - `sender` should be of the correct type.
        /// - `sender` might not allow `None`.
        #[deprecated]
        #[unsafe(method(activeConversationChanged:toNewConversation:))]
        #[unsafe(method_family = none)]
        unsafe fn activeConversationChanged_toNewConversation(
            &self,
            sender: Option<&AnyObject>,
            new_conversation: NSInteger,
        );
    }
);

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsinputservermousetracker?language=objc)
    pub unsafe trait NSInputServerMouseTracker {
        /// # Safety
        ///
        /// - `sender` should be of the correct type.
        /// - `sender` might not allow `None`.
        #[deprecated]
        #[unsafe(method(mouseDownOnCharacterIndex:atCoordinate:withModifier:client:))]
        #[unsafe(method_family = none)]
        unsafe fn mouseDownOnCharacterIndex_atCoordinate_withModifier_client(
            &self,
            index: NSUInteger,
            point: NSPoint,
            flags: NSUInteger,
            sender: Option<&AnyObject>,
        ) -> bool;

        /// # Safety
        ///
        /// - `sender` should be of the correct type.
        /// - `sender` might not allow `None`.
        #[deprecated]
        #[unsafe(method(mouseDraggedOnCharacterIndex:atCoordinate:withModifier:client:))]
        #[unsafe(method_family = none)]
        unsafe fn mouseDraggedOnCharacterIndex_atCoordinate_withModifier_client(
            &self,
            index: NSUInteger,
            point: NSPoint,
            flags: NSUInteger,
            sender: Option<&AnyObject>,
        ) -> bool;

        /// # Safety
        ///
        /// - `sender` should be of the correct type.
        /// - `sender` might not allow `None`.
        #[deprecated]
        #[unsafe(method(mouseUpOnCharacterIndex:atCoordinate:withModifier:client:))]
        #[unsafe(method_family = none)]
        unsafe fn mouseUpOnCharacterIndex_atCoordinate_withModifier_client(
            &self,
            index: NSUInteger,
            point: NSPoint,
            flags: NSUInteger,
            sender: Option<&AnyObject>,
        );
    }
);

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

extern_conformance!(
    unsafe impl NSInputServerMouseTracker for NSInputServer {}
);

extern_conformance!(
    unsafe impl NSInputServiceProvider for NSInputServer {}
);

extern_conformance!(
    unsafe impl NSObjectProtocol for NSInputServer {}
);

impl NSInputServer {
    extern_methods!(
        /// # Safety
        ///
        /// - `delegate` should be of the correct type.
        /// - `delegate` might not allow `None`.
        /// - `name` might not allow `None`.
        #[deprecated]
        #[unsafe(method(initWithDelegate:name:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithDelegate_name(
            this: Allocated<Self>,
            delegate: Option<&AnyObject>,
            name: Option<&NSString>,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
impl NSInputServer {
    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 NSInputServer {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}
