icrate 0.1.2

Bindings to Apple's frameworks
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::AppKit::*;
use crate::CoreData::*;
use crate::Foundation::*;

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

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

#[cfg(feature = "AppKit_NSForm")]
unsafe impl NSAccessibility for NSForm {}

#[cfg(feature = "AppKit_NSForm")]
unsafe impl NSAccessibilityElementProtocol for NSForm {}

#[cfg(feature = "AppKit_NSForm")]
unsafe impl NSAnimatablePropertyContainer for NSForm {}

#[cfg(feature = "AppKit_NSForm")]
unsafe impl NSAppearanceCustomization for NSForm {}

#[cfg(feature = "AppKit_NSForm")]
unsafe impl NSCoding for NSForm {}

#[cfg(feature = "AppKit_NSForm")]
unsafe impl NSDraggingDestination for NSForm {}

#[cfg(feature = "AppKit_NSForm")]
unsafe impl NSObjectProtocol for NSForm {}

#[cfg(feature = "AppKit_NSForm")]
unsafe impl NSUserInterfaceItemIdentification for NSForm {}

#[cfg(feature = "AppKit_NSForm")]
unsafe impl NSUserInterfaceValidations for NSForm {}

#[cfg(feature = "AppKit_NSForm")]
unsafe impl NSViewToolTipOwner for NSForm {}

extern_methods!(
    #[cfg(feature = "AppKit_NSForm")]
    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);

        #[method(setTitleAlignment:)]
        pub unsafe fn setTitleAlignment(&self, mode: NSTextAlignment);

        #[method(setTextAlignment:)]
        pub unsafe fn setTextAlignment(&self, mode: NSTextAlignment);

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

        #[cfg(feature = "AppKit_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<Id<AnyObject>>;

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

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

        #[cfg(all(feature = "AppKit_NSFormCell", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Other insertEntry:atIndex:)]
        pub unsafe fn insertEntry_atIndex(
            &self,
            title: &NSString,
            index: NSInteger,
        ) -> Option<Id<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);

        #[method(setTitleBaseWritingDirection:)]
        pub unsafe fn setTitleBaseWritingDirection(&self, writing_direction: NSWritingDirection);

        #[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(feature = "AppKit_NSForm")]
    unsafe impl NSForm {
        #[method_id(@__retain_semantics Init initWithFrame:)]
        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Id<Self>;

        #[cfg(feature = "AppKit_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,
        ) -> Id<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,
        ) -> Id<Self>;
    }
);

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

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

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