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

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

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

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

extern_conformance!(
    unsafe impl NSSecureCoding for UIPrinterDestination {}
);

impl UIPrinterDestination {
    extern_methods!(
        #[unsafe(method(initWithURL:))]
        #[unsafe(method_family = init)]
        pub fn initWithURL(this: Allocated<Self>, url: &NSURL) -> Retained<Self>;

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

        /// Setter for [`URL`][Self::URL].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setURL:))]
        #[unsafe(method_family = none)]
        pub fn setURL(&self, url: &NSURL);

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

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

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

        /// Setter for [`txtRecord`][Self::txtRecord].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setTxtRecord:))]
        #[unsafe(method_family = none)]
        pub fn setTxtRecord(&self, txt_record: Option<&NSData>);
    );
}

/// Methods declared on superclass `NSObject`.
impl UIPrinterDestination {
    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>;
    );
}

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

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

impl UIPrintServiceExtension {
    extern_methods!(
        #[cfg(feature = "UIPrintInfo")]
        #[unsafe(method(printerDestinationsForPrintInfo:))]
        #[unsafe(method_family = none)]
        pub fn printerDestinationsForPrintInfo(
            &self,
            print_info: &UIPrintInfo,
        ) -> Retained<NSArray<UIPrinterDestination>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl UIPrintServiceExtension {
    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>;
    );
}
