//! 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::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstableheaderview?language=objc)
    #[unsafe(super(NSView, NSResponder, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "NSResponder", feature = "NSView"))]
    pub struct NSTableHeaderView;
);

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSResponder",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSAccessibility for NSTableHeaderView {}
);

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSResponder",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSAccessibilityElementProtocol for NSTableHeaderView {}
);

#[cfg(all(feature = "NSAnimation", feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
    unsafe impl NSAnimatablePropertyContainer for NSTableHeaderView {}
);

#[cfg(all(feature = "NSAppearance", feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
    unsafe impl NSAppearanceCustomization for NSTableHeaderView {}
);

#[cfg(all(feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
    unsafe impl NSCoding for NSTableHeaderView {}
);

#[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
    unsafe impl NSDraggingDestination for NSTableHeaderView {}
);

#[cfg(all(feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
    unsafe impl NSObjectProtocol for NSTableHeaderView {}
);

#[cfg(all(
    feature = "NSResponder",
    feature = "NSUserInterfaceItemIdentification",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSUserInterfaceItemIdentification for NSTableHeaderView {}
);

#[cfg(all(feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
    unsafe impl NSViewToolTipOwner for NSTableHeaderView {}
);

#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSTableHeaderView {
    extern_methods!(
        #[cfg(all(feature = "NSControl", feature = "NSTableView"))]
        #[unsafe(method(tableView))]
        #[unsafe(method_family = none)]
        pub fn tableView(&self) -> Option<Retained<NSTableView>>;

        #[cfg(all(feature = "NSControl", feature = "NSTableView"))]
        /// Setter for [`tableView`][Self::tableView].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[unsafe(method(setTableView:))]
        #[unsafe(method_family = none)]
        pub fn setTableView(&self, table_view: Option<&NSTableView>);

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

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(draggedDistance))]
        #[unsafe(method_family = none)]
        pub fn draggedDistance(&self) -> CGFloat;

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

        #[unsafe(method(headerRectOfColumn:))]
        #[unsafe(method_family = none)]
        pub fn headerRectOfColumn(&self, column: NSInteger) -> NSRect;

        #[unsafe(method(columnAtPoint:))]
        #[unsafe(method_family = none)]
        pub fn columnAtPoint(&self, point: NSPoint) -> NSInteger;
    );
}

/// Methods declared on superclass `NSView`.
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSTableHeaderView {
    extern_methods!(
        #[unsafe(method(initWithFrame:))]
        #[unsafe(method_family = init)]
        pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> 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>>;
    );
}

/// Methods declared on superclass `NSResponder`.
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSTableHeaderView {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSTableHeaderView {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}
