//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(
        feature = "NSControl",
        feature = "NSMatrix",
        feature = "NSResponder",
        feature = "NSView"
    ))]
    #[deprecated = "Use NSTextField directly instead, and consider NSStackView for layout assistance"]
    pub struct NSForm;

    #[cfg(all(
        feature = "NSControl",
        feature = "NSMatrix",
        feature = "NSResponder",
        feature = "NSView"
    ))]
    unsafe impl ClassType for NSForm {
        #[inherits(NSControl, NSView, NSResponder, NSObject)]
        type Super = NSMatrix;
        type Mutability = MainThreadOnly;
    }
);

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSControl",
    feature = "NSMatrix",
    feature = "NSResponder",
    feature = "NSView"
))]
unsafe impl NSAccessibility for NSForm {}

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSControl",
    feature = "NSMatrix",
    feature = "NSResponder",
    feature = "NSView"
))]
unsafe impl NSAccessibilityElementProtocol for NSForm {}

#[cfg(all(
    feature = "NSAnimation",
    feature = "NSControl",
    feature = "NSMatrix",
    feature = "NSResponder",
    feature = "NSView"
))]
unsafe impl NSAnimatablePropertyContainer for NSForm {}

#[cfg(all(
    feature = "NSAppearance",
    feature = "NSControl",
    feature = "NSMatrix",
    feature = "NSResponder",
    feature = "NSView"
))]
unsafe impl NSAppearanceCustomization for NSForm {}

#[cfg(all(
    feature = "NSControl",
    feature = "NSMatrix",
    feature = "NSResponder",
    feature = "NSView"
))]
unsafe impl NSCoding for NSForm {}

#[cfg(all(
    feature = "NSControl",
    feature = "NSDragging",
    feature = "NSMatrix",
    feature = "NSResponder",
    feature = "NSView"
))]
unsafe impl NSDraggingDestination for NSForm {}

#[cfg(all(
    feature = "NSControl",
    feature = "NSMatrix",
    feature = "NSResponder",
    feature = "NSView"
))]
unsafe impl NSObjectProtocol for NSForm {}

#[cfg(all(
    feature = "NSControl",
    feature = "NSMatrix",
    feature = "NSResponder",
    feature = "NSUserInterfaceItemIdentification",
    feature = "NSView"
))]
unsafe impl NSUserInterfaceItemIdentification for NSForm {}

#[cfg(all(
    feature = "NSControl",
    feature = "NSMatrix",
    feature = "NSResponder",
    feature = "NSUserInterfaceValidation",
    feature = "NSView"
))]
unsafe impl NSUserInterfaceValidations for NSForm {}

#[cfg(all(
    feature = "NSControl",
    feature = "NSMatrix",
    feature = "NSResponder",
    feature = "NSView"
))]
unsafe impl NSViewToolTipOwner for NSForm {}

extern_methods!(
    #[cfg(all(
        feature = "NSControl",
        feature = "NSMatrix",
        feature = "NSResponder",
        feature = "NSView"
    ))]
    unsafe impl NSForm {
        #[method(indexOfSelectedItem)]
        pub unsafe fn indexOfSelectedItem(&self) -> NSInteger;

        #[method(setEntryWidth:)]
        pub unsafe fn setEntryWidth(&self, width: CGFloat);

        #[method(setInterlineSpacing:)]
        pub unsafe fn setInterlineSpacing(&self, spacing: CGFloat);

        #[method(setBordered:)]
        pub unsafe fn setBordered(&self, flag: bool);

        #[method(setBezeled:)]
        pub unsafe fn setBezeled(&self, flag: bool);

        #[cfg(feature = "NSText")]
        #[method(setTitleAlignment:)]
        pub unsafe fn setTitleAlignment(&self, mode: NSTextAlignment);

        #[cfg(feature = "NSText")]
        #[method(setTextAlignment:)]
        pub unsafe fn setTextAlignment(&self, mode: NSTextAlignment);

        #[cfg(feature = "NSFont")]
        #[method(setTitleFont:)]
        pub unsafe fn setTitleFont(&self, font_obj: &NSFont);

        #[cfg(feature = "NSFont")]
        #[method(setTextFont:)]
        pub unsafe fn setTextFont(&self, font_obj: &NSFont);

        #[method_id(@__retain_semantics Other cellAtIndex:)]
        pub unsafe fn cellAtIndex(&self, index: NSInteger) -> Option<Retained<AnyObject>>;

        #[method(drawCellAtIndex:)]
        pub unsafe fn drawCellAtIndex(&self, index: NSInteger);

        #[cfg(all(feature = "NSActionCell", feature = "NSCell", feature = "NSFormCell"))]
        #[method_id(@__retain_semantics Other addEntry:)]
        pub unsafe fn addEntry(&self, title: &NSString) -> Retained<NSFormCell>;

        #[cfg(all(feature = "NSActionCell", feature = "NSCell", feature = "NSFormCell"))]
        #[method_id(@__retain_semantics Other insertEntry:atIndex:)]
        pub unsafe fn insertEntry_atIndex(
            &self,
            title: &NSString,
            index: NSInteger,
        ) -> Option<Retained<NSFormCell>>;

        #[method(removeEntryAtIndex:)]
        pub unsafe fn removeEntryAtIndex(&self, index: NSInteger);

        #[method(indexOfCellWithTag:)]
        pub unsafe fn indexOfCellWithTag(&self, tag: NSInteger) -> NSInteger;

        #[method(selectTextAtIndex:)]
        pub unsafe fn selectTextAtIndex(&self, index: NSInteger);

        #[method(setFrameSize:)]
        pub unsafe fn setFrameSize(&self, new_size: NSSize);

        #[cfg(feature = "NSText")]
        #[method(setTitleBaseWritingDirection:)]
        pub unsafe fn setTitleBaseWritingDirection(&self, writing_direction: NSWritingDirection);

        #[cfg(feature = "NSText")]
        #[method(setTextBaseWritingDirection:)]
        pub unsafe fn setTextBaseWritingDirection(&self, writing_direction: NSWritingDirection);

        #[method(setPreferredTextFieldWidth:)]
        pub unsafe fn setPreferredTextFieldWidth(&self, preferred_width: CGFloat);

        #[method(preferredTextFieldWidth)]
        pub unsafe fn preferredTextFieldWidth(&self) -> CGFloat;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSMatrix`
    #[cfg(all(
        feature = "NSControl",
        feature = "NSMatrix",
        feature = "NSResponder",
        feature = "NSView"
    ))]
    unsafe impl NSForm {
        #[method_id(@__retain_semantics Init initWithFrame:)]
        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;

        #[cfg(feature = "NSCell")]
        #[method_id(@__retain_semantics Init initWithFrame:mode:prototype:numberOfRows:numberOfColumns:)]
        pub unsafe fn initWithFrame_mode_prototype_numberOfRows_numberOfColumns(
            this: Allocated<Self>,
            frame_rect: NSRect,
            mode: NSMatrixMode,
            cell: &NSCell,
            rows_high: NSInteger,
            cols_wide: NSInteger,
        ) -> Retained<Self>;

        #[method_id(@__retain_semantics Init initWithFrame:mode:cellClass:numberOfRows:numberOfColumns:)]
        pub unsafe fn initWithFrame_mode_cellClass_numberOfRows_numberOfColumns(
            this: Allocated<Self>,
            frame_rect: NSRect,
            mode: NSMatrixMode,
            factory_id: Option<&AnyClass>,
            rows_high: NSInteger,
            cols_wide: NSInteger,
        ) -> Retained<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSControl`
    #[cfg(all(
        feature = "NSControl",
        feature = "NSMatrix",
        feature = "NSResponder",
        feature = "NSView"
    ))]
    unsafe impl NSForm {
        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSResponder`
    #[cfg(all(
        feature = "NSControl",
        feature = "NSMatrix",
        feature = "NSResponder",
        feature = "NSView"
    ))]
    unsafe impl NSForm {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(all(
        feature = "NSControl",
        feature = "NSMatrix",
        feature = "NSResponder",
        feature = "NSView"
    ))]
    unsafe impl NSForm {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    }
);
