objc2-ui-kit 0.3.2

Bindings to the UIKit framework
Documentation
//! 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::*;

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiprintinfooutputtype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIPrintInfoOutputType(pub NSInteger);
impl UIPrintInfoOutputType {
    #[doc(alias = "UIPrintInfoOutputGeneral")]
    pub const General: Self = Self(0);
    #[doc(alias = "UIPrintInfoOutputPhoto")]
    pub const Photo: Self = Self(1);
    #[doc(alias = "UIPrintInfoOutputGrayscale")]
    pub const Grayscale: Self = Self(2);
    #[doc(alias = "UIPrintInfoOutputPhotoGrayscale")]
    pub const PhotoGrayscale: Self = Self(3);
}

unsafe impl Encode for UIPrintInfoOutputType {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UIPrintInfoOutputType {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiprintinfoorientation?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIPrintInfoOrientation(pub NSInteger);
impl UIPrintInfoOrientation {
    #[doc(alias = "UIPrintInfoOrientationPortrait")]
    pub const Portrait: Self = Self(0);
    #[doc(alias = "UIPrintInfoOrientationLandscape")]
    pub const Landscape: Self = Self(1);
}

unsafe impl Encode for UIPrintInfoOrientation {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UIPrintInfoOrientation {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiprintinfoduplex?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIPrintInfoDuplex(pub NSInteger);
impl UIPrintInfoDuplex {
    #[doc(alias = "UIPrintInfoDuplexNone")]
    pub const None: Self = Self(0);
    #[doc(alias = "UIPrintInfoDuplexLongEdge")]
    pub const LongEdge: Self = Self(1);
    #[doc(alias = "UIPrintInfoDuplexShortEdge")]
    pub const ShortEdge: Self = Self(2);
}

unsafe impl Encode for UIPrintInfoDuplex {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UIPrintInfoDuplex {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiprintinfo?language=objc)
    #[unsafe(super(NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UIPrintInfo;
);

extern_conformance!(
    unsafe impl NSCoding for UIPrintInfo {}
);

extern_conformance!(
    unsafe impl NSCopying for UIPrintInfo {}
);

unsafe impl CopyingHelper for UIPrintInfo {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for UIPrintInfo {}
);

impl UIPrintInfo {
    extern_methods!(
        /// # 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>>;

        #[unsafe(method(printInfo))]
        #[unsafe(method_family = none)]
        pub fn printInfo(mtm: MainThreadMarker) -> Retained<UIPrintInfo>;

        /// # Safety
        ///
        /// `dictionary` generic should be of the correct type.
        #[unsafe(method(printInfoWithDictionary:))]
        #[unsafe(method_family = none)]
        pub unsafe fn printInfoWithDictionary(
            dictionary: Option<&NSDictionary>,
            mtm: MainThreadMarker,
        ) -> Retained<UIPrintInfo>;

        #[unsafe(method(printerID))]
        #[unsafe(method_family = none)]
        pub fn printerID(&self) -> Option<Retained<NSString>>;

        /// Setter for [`printerID`][Self::printerID].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setPrinterID:))]
        #[unsafe(method_family = none)]
        pub fn setPrinterID(&self, printer_id: Option<&NSString>);

        #[unsafe(method(jobName))]
        #[unsafe(method_family = none)]
        pub fn jobName(&self) -> Retained<NSString>;

        /// Setter for [`jobName`][Self::jobName].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setJobName:))]
        #[unsafe(method_family = none)]
        pub fn setJobName(&self, job_name: &NSString);

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

        /// Setter for [`outputType`][Self::outputType].
        #[unsafe(method(setOutputType:))]
        #[unsafe(method_family = none)]
        pub fn setOutputType(&self, output_type: UIPrintInfoOutputType);

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

        /// Setter for [`orientation`][Self::orientation].
        #[unsafe(method(setOrientation:))]
        #[unsafe(method_family = none)]
        pub fn setOrientation(&self, orientation: UIPrintInfoOrientation);

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

        /// Setter for [`duplex`][Self::duplex].
        #[unsafe(method(setDuplex:))]
        #[unsafe(method_family = none)]
        pub fn setDuplex(&self, duplex: UIPrintInfoDuplex);

        #[unsafe(method(dictionaryRepresentation))]
        #[unsafe(method_family = none)]
        pub fn dictionaryRepresentation(&self) -> Retained<NSDictionary>;
    );
}

/// Methods declared on superclass `NSObject`.
impl UIPrintInfo {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}