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

ns_enum!(
    #[underlying(NSUInteger)]
    pub enum NSPrinterTableStatus {
        NSPrinterTableOK = 0,
        NSPrinterTableNotFound = 1,
        NSPrinterTableError = 2,
    }
);

typed_extensible_enum!(
    pub type NSPrinterTypeName = NSString;
);

typed_extensible_enum!(
    pub type NSPrinterPaperName = NSString;
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "AppKit_NSPrinter")]
    pub struct NSPrinter;

    #[cfg(feature = "AppKit_NSPrinter")]
    unsafe impl ClassType for NSPrinter {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "AppKit_NSPrinter")]
unsafe impl NSCoding for NSPrinter {}

#[cfg(feature = "AppKit_NSPrinter")]
unsafe impl NSCopying for NSPrinter {}

#[cfg(feature = "AppKit_NSPrinter")]
unsafe impl NSObjectProtocol for NSPrinter {}

extern_methods!(
    #[cfg(feature = "AppKit_NSPrinter")]
    unsafe impl NSPrinter {
        #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Other printerNames)]
        pub unsafe fn printerNames() -> Id<NSArray<NSString>>;

        #[cfg(feature = "Foundation_NSArray")]
        #[method_id(@__retain_semantics Other printerTypes)]
        pub unsafe fn printerTypes() -> Id<NSArray<NSPrinterTypeName>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other printerWithName:)]
        pub unsafe fn printerWithName(name: &NSString) -> Option<Id<NSPrinter>>;

        #[method_id(@__retain_semantics Other printerWithType:)]
        pub unsafe fn printerWithType(r#type: &NSPrinterTypeName) -> Option<Id<NSPrinter>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other name)]
        pub unsafe fn name(&self) -> Id<NSString>;

        #[method_id(@__retain_semantics Other type)]
        pub unsafe fn r#type(&self) -> Id<NSPrinterTypeName>;

        #[method(languageLevel)]
        pub unsafe fn languageLevel(&self) -> NSInteger;

        #[method(pageSizeForPaper:)]
        pub unsafe fn pageSizeForPaper(&self, paper_name: &NSPrinterPaperName) -> NSSize;

        #[cfg(feature = "Foundation_NSDictionary")]
        #[method_id(@__retain_semantics Other deviceDescription)]
        pub unsafe fn deviceDescription(
            &self,
        ) -> Id<NSDictionary<NSDeviceDescriptionKey, AnyObject>>;
    }
);

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

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_methods!(
    /// NSDeprecated
    #[cfg(feature = "AppKit_NSPrinter")]
    unsafe impl NSPrinter {
        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method(statusForTable:)]
        pub unsafe fn statusForTable(&self, table_name: &NSString) -> NSPrinterTableStatus;

        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method(isKey:inTable:)]
        pub unsafe fn isKey_inTable(&self, key: Option<&NSString>, table: &NSString) -> bool;

        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method(booleanForKey:inTable:)]
        pub unsafe fn booleanForKey_inTable(
            &self,
            key: Option<&NSString>,
            table: &NSString,
        ) -> bool;

        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method(floatForKey:inTable:)]
        pub unsafe fn floatForKey_inTable(
            &self,
            key: Option<&NSString>,
            table: &NSString,
        ) -> c_float;

        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method(intForKey:inTable:)]
        pub unsafe fn intForKey_inTable(&self, key: Option<&NSString>, table: &NSString) -> c_int;

        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method(rectForKey:inTable:)]
        pub unsafe fn rectForKey_inTable(&self, key: Option<&NSString>, table: &NSString)
            -> NSRect;

        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method(sizeForKey:inTable:)]
        pub unsafe fn sizeForKey_inTable(&self, key: Option<&NSString>, table: &NSString)
            -> NSSize;

        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method_id(@__retain_semantics Other stringForKey:inTable:)]
        pub unsafe fn stringForKey_inTable(
            &self,
            key: Option<&NSString>,
            table: &NSString,
        ) -> Option<Id<NSString>>;

        #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSString"))]
        #[deprecated]
        #[method_id(@__retain_semantics Other stringListForKey:inTable:)]
        pub unsafe fn stringListForKey_inTable(
            &self,
            key: Option<&NSString>,
            table: &NSString,
        ) -> Option<Id<NSArray>>;

        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method(imageRectForPaper:)]
        pub unsafe fn imageRectForPaper(&self, paper_name: Option<&NSString>) -> NSRect;

        #[deprecated]
        #[method(acceptsBinary)]
        pub unsafe fn acceptsBinary(&self) -> bool;

        #[deprecated]
        #[method(isColor)]
        pub unsafe fn isColor(&self) -> bool;

        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method(isFontAvailable:)]
        pub unsafe fn isFontAvailable(&self, face_name: Option<&NSString>) -> bool;

        #[deprecated]
        #[method(isOutputStackInReverseOrder)]
        pub unsafe fn isOutputStackInReverseOrder(&self) -> bool;

        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method_id(@__retain_semantics Other printerWithName:domain:includeUnavailable:)]
        pub unsafe fn printerWithName_domain_includeUnavailable(
            name: &NSString,
            domain: Option<&NSString>,
            flag: bool,
        ) -> Option<Id<NSPrinter>>;

        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method_id(@__retain_semantics Other domain)]
        pub unsafe fn domain(&self) -> Id<NSString>;

        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method_id(@__retain_semantics Other host)]
        pub unsafe fn host(&self) -> Id<NSString>;

        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method_id(@__retain_semantics Other note)]
        pub unsafe fn note(&self) -> Id<NSString>;
    }
);