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

mod private_NSObjectUIAccessibilityContainer {
    pub trait Sealed {}
}

/// Category "UIAccessibilityContainer" on [`NSObject`].
#[doc(alias = "UIAccessibilityContainer")]
pub unsafe trait NSObjectUIAccessibilityContainer:
    ClassType + Sized + private_NSObjectUIAccessibilityContainer::Sealed
{
    extern_methods!(
        #[unsafe(method(accessibilityElementCount))]
        #[unsafe(method_family = none)]
        fn accessibilityElementCount(&self, mtm: MainThreadMarker) -> NSInteger;

        #[unsafe(method(accessibilityElementAtIndex:))]
        #[unsafe(method_family = none)]
        fn accessibilityElementAtIndex(
            &self,
            index: NSInteger,
            mtm: MainThreadMarker,
        ) -> Option<Retained<AnyObject>>;

        /// # Safety
        ///
        /// `element` should be of the correct type.
        #[unsafe(method(indexOfAccessibilityElement:))]
        #[unsafe(method_family = none)]
        unsafe fn indexOfAccessibilityElement(
            &self,
            element: &AnyObject,
            mtm: MainThreadMarker,
        ) -> NSInteger;

        #[unsafe(method(accessibilityElements))]
        #[unsafe(method_family = none)]
        fn accessibilityElements(&self, mtm: MainThreadMarker) -> Option<Retained<NSArray>>;

        /// Setter for [`accessibilityElements`][Self::accessibilityElements].
        ///
        /// # Safety
        ///
        /// `accessibility_elements` generic should be of the correct type.
        #[unsafe(method(setAccessibilityElements:))]
        #[unsafe(method_family = none)]
        unsafe fn setAccessibilityElements(
            &self,
            accessibility_elements: Option<&NSArray>,
            mtm: MainThreadMarker,
        );

        #[cfg(feature = "UIAccessibilityConstants")]
        #[unsafe(method(accessibilityContainerType))]
        #[unsafe(method_family = none)]
        fn accessibilityContainerType(&self, mtm: MainThreadMarker)
            -> UIAccessibilityContainerType;

        #[cfg(feature = "UIAccessibilityConstants")]
        /// Setter for [`accessibilityContainerType`][Self::accessibilityContainerType].
        #[unsafe(method(setAccessibilityContainerType:))]
        #[unsafe(method_family = none)]
        fn setAccessibilityContainerType(
            &self,
            accessibility_container_type: UIAccessibilityContainerType,
            mtm: MainThreadMarker,
        );

        #[unsafe(method(automationElements))]
        #[unsafe(method_family = none)]
        fn automationElements(&self, mtm: MainThreadMarker) -> Option<Retained<NSArray>>;

        /// Setter for [`automationElements`][Self::automationElements].
        ///
        /// # Safety
        ///
        /// `automation_elements` generic should be of the correct type.
        #[unsafe(method(setAutomationElements:))]
        #[unsafe(method_family = none)]
        unsafe fn setAutomationElements(
            &self,
            automation_elements: Option<&NSArray>,
            mtm: MainThreadMarker,
        );
    );
}

impl private_NSObjectUIAccessibilityContainer::Sealed for NSObject {}
unsafe impl NSObjectUIAccessibilityContainer for NSObject {}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiaccessibilitycontainerdatatablecell?language=objc)
    pub unsafe trait UIAccessibilityContainerDataTableCell:
        NSObjectProtocol + MainThreadOnly
    {
        #[unsafe(method(accessibilityRowRange))]
        #[unsafe(method_family = none)]
        fn accessibilityRowRange(&self) -> NSRange;

        #[unsafe(method(accessibilityColumnRange))]
        #[unsafe(method_family = none)]
        fn accessibilityColumnRange(&self) -> NSRange;
    }
);

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiaccessibilitycontainerdatatable?language=objc)
    pub unsafe trait UIAccessibilityContainerDataTable:
        NSObjectProtocol + MainThreadOnly
    {
        #[unsafe(method(accessibilityDataTableCellElementForRow:column:))]
        #[unsafe(method_family = none)]
        fn accessibilityDataTableCellElementForRow_column(
            &self,
            row: NSUInteger,
            column: NSUInteger,
        ) -> Option<Retained<ProtocolObject<dyn UIAccessibilityContainerDataTableCell>>>;

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

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

        #[optional]
        #[unsafe(method(accessibilityHeaderElementsForRow:))]
        #[unsafe(method_family = none)]
        fn accessibilityHeaderElementsForRow(
            &self,
            row: NSUInteger,
        ) -> Option<Retained<NSArray<ProtocolObject<dyn UIAccessibilityContainerDataTableCell>>>>;

        #[optional]
        #[unsafe(method(accessibilityHeaderElementsForColumn:))]
        #[unsafe(method_family = none)]
        fn accessibilityHeaderElementsForColumn(
            &self,
            column: NSUInteger,
        ) -> Option<Retained<NSArray<ProtocolObject<dyn UIAccessibilityContainerDataTableCell>>>>;
    }
);
