use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSPrintingPageOrder(pub NSInteger);
impl NSPrintingPageOrder {
#[doc(alias = "NSDescendingPageOrder")]
pub const DescendingPageOrder: Self = Self(-1);
#[doc(alias = "NSSpecialPageOrder")]
pub const SpecialPageOrder: Self = Self(0);
#[doc(alias = "NSAscendingPageOrder")]
pub const AscendingPageOrder: Self = Self(1);
#[doc(alias = "NSUnknownPageOrder")]
pub const UnknownPageOrder: Self = Self(2);
}
unsafe impl Encode for NSPrintingPageOrder {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSPrintingPageOrder {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSPrintRenderingQuality(pub NSInteger);
impl NSPrintRenderingQuality {
#[doc(alias = "NSPrintRenderingQualityBest")]
pub const Best: Self = Self(0);
#[doc(alias = "NSPrintRenderingQualityResponsive")]
pub const Responsive: Self = Self(1);
}
unsafe impl Encode for NSPrintRenderingQuality {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSPrintRenderingQuality {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern "C" {
pub static NSPrintOperationExistsException: &'static NSExceptionName;
}
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSPrintOperation;
);
extern_conformance!(
unsafe impl NSObjectProtocol for NSPrintOperation {}
);
impl NSPrintOperation {
extern_methods!(
#[cfg(all(feature = "NSPrintInfo", feature = "NSResponder", feature = "NSView"))]
#[unsafe(method(printOperationWithView:printInfo:))]
#[unsafe(method_family = none)]
pub fn printOperationWithView_printInfo(
view: &NSView,
print_info: &NSPrintInfo,
) -> Retained<NSPrintOperation>;
#[cfg(all(feature = "NSPrintInfo", feature = "NSResponder", feature = "NSView"))]
#[unsafe(method(PDFOperationWithView:insideRect:toData:printInfo:))]
#[unsafe(method_family = none)]
pub fn PDFOperationWithView_insideRect_toData_printInfo(
view: &NSView,
rect: NSRect,
data: &NSMutableData,
print_info: &NSPrintInfo,
) -> Retained<NSPrintOperation>;
#[cfg(all(feature = "NSPrintInfo", feature = "NSResponder", feature = "NSView"))]
#[unsafe(method(PDFOperationWithView:insideRect:toPath:printInfo:))]
#[unsafe(method_family = none)]
pub fn PDFOperationWithView_insideRect_toPath_printInfo(
view: &NSView,
rect: NSRect,
path: &NSString,
print_info: &NSPrintInfo,
) -> Retained<NSPrintOperation>;
#[cfg(all(feature = "NSPrintInfo", feature = "NSResponder", feature = "NSView"))]
#[unsafe(method(EPSOperationWithView:insideRect:toData:printInfo:))]
#[unsafe(method_family = none)]
pub fn EPSOperationWithView_insideRect_toData_printInfo(
view: &NSView,
rect: NSRect,
data: &NSMutableData,
print_info: &NSPrintInfo,
) -> Retained<NSPrintOperation>;
#[cfg(all(feature = "NSPrintInfo", feature = "NSResponder", feature = "NSView"))]
#[unsafe(method(EPSOperationWithView:insideRect:toPath:printInfo:))]
#[unsafe(method_family = none)]
pub fn EPSOperationWithView_insideRect_toPath_printInfo(
view: &NSView,
rect: NSRect,
path: &NSString,
print_info: &NSPrintInfo,
) -> Retained<NSPrintOperation>;
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
#[unsafe(method(printOperationWithView:))]
#[unsafe(method_family = none)]
pub fn printOperationWithView(view: &NSView) -> Retained<NSPrintOperation>;
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
#[unsafe(method(PDFOperationWithView:insideRect:toData:))]
#[unsafe(method_family = none)]
pub fn PDFOperationWithView_insideRect_toData(
view: &NSView,
rect: NSRect,
data: &NSMutableData,
) -> Retained<NSPrintOperation>;
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
#[unsafe(method(EPSOperationWithView:insideRect:toData:))]
#[unsafe(method_family = none)]
pub fn EPSOperationWithView_insideRect_toData(
view: &NSView,
rect: NSRect,
data: Option<&NSMutableData>,
) -> Retained<NSPrintOperation>;
#[unsafe(method(currentOperation))]
#[unsafe(method_family = none)]
pub fn currentOperation(mtm: MainThreadMarker) -> Option<Retained<NSPrintOperation>>;
#[unsafe(method(setCurrentOperation:))]
#[unsafe(method_family = none)]
pub fn setCurrentOperation(
current_operation: Option<&NSPrintOperation>,
mtm: MainThreadMarker,
);
#[unsafe(method(isCopyingOperation))]
#[unsafe(method_family = none)]
pub fn isCopyingOperation(&self) -> bool;
#[unsafe(method(preferredRenderingQuality))]
#[unsafe(method_family = none)]
pub fn preferredRenderingQuality(&self) -> NSPrintRenderingQuality;
#[unsafe(method(jobTitle))]
#[unsafe(method_family = none)]
pub fn jobTitle(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setJobTitle:))]
#[unsafe(method_family = none)]
pub fn setJobTitle(&self, job_title: Option<&NSString>);
#[unsafe(method(showsPrintPanel))]
#[unsafe(method_family = none)]
pub fn showsPrintPanel(&self) -> bool;
#[unsafe(method(setShowsPrintPanel:))]
#[unsafe(method_family = none)]
pub fn setShowsPrintPanel(&self, shows_print_panel: bool);
#[unsafe(method(showsProgressPanel))]
#[unsafe(method_family = none)]
pub fn showsProgressPanel(&self) -> bool;
#[unsafe(method(setShowsProgressPanel:))]
#[unsafe(method_family = none)]
pub fn setShowsProgressPanel(&self, shows_progress_panel: bool);
#[cfg(feature = "NSPrintPanel")]
#[unsafe(method(printPanel))]
#[unsafe(method_family = none)]
pub fn printPanel(&self) -> Retained<NSPrintPanel>;
#[cfg(feature = "NSPrintPanel")]
#[unsafe(method(setPrintPanel:))]
#[unsafe(method_family = none)]
pub fn setPrintPanel(&self, print_panel: &NSPrintPanel);
#[cfg(feature = "NSPDFPanel")]
#[unsafe(method(PDFPanel))]
#[unsafe(method_family = none)]
pub fn PDFPanel(&self) -> Retained<NSPDFPanel>;
#[cfg(feature = "NSPDFPanel")]
#[unsafe(method(setPDFPanel:))]
#[unsafe(method_family = none)]
pub fn setPDFPanel(&self, pdf_panel: &NSPDFPanel);
#[unsafe(method(canSpawnSeparateThread))]
#[unsafe(method_family = none)]
pub fn canSpawnSeparateThread(&self) -> bool;
#[unsafe(method(setCanSpawnSeparateThread:))]
#[unsafe(method_family = none)]
pub fn setCanSpawnSeparateThread(&self, can_spawn_separate_thread: bool);
#[unsafe(method(pageOrder))]
#[unsafe(method_family = none)]
pub fn pageOrder(&self) -> NSPrintingPageOrder;
#[unsafe(method(setPageOrder:))]
#[unsafe(method_family = none)]
pub fn setPageOrder(&self, page_order: NSPrintingPageOrder);
#[cfg(all(feature = "NSResponder", feature = "NSWindow"))]
#[unsafe(method(runOperationModalForWindow:delegate:didRunSelector:contextInfo:))]
#[unsafe(method_family = none)]
pub unsafe fn runOperationModalForWindow_delegate_didRunSelector_contextInfo(
&self,
doc_window: &NSWindow,
delegate: Option<&AnyObject>,
did_run_selector: Option<Sel>,
context_info: *mut c_void,
);
#[unsafe(method(runOperation))]
#[unsafe(method_family = none)]
pub fn runOperation(&self) -> bool;
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
#[unsafe(method(view))]
#[unsafe(method_family = none)]
pub fn view(&self) -> Option<Retained<NSView>>;
#[cfg(feature = "NSPrintInfo")]
#[unsafe(method(printInfo))]
#[unsafe(method_family = none)]
pub fn printInfo(&self) -> Retained<NSPrintInfo>;
#[cfg(feature = "NSPrintInfo")]
#[unsafe(method(setPrintInfo:))]
#[unsafe(method_family = none)]
pub fn setPrintInfo(&self, print_info: &NSPrintInfo);
#[cfg(feature = "NSGraphicsContext")]
#[unsafe(method(context))]
#[unsafe(method_family = none)]
pub fn context(&self) -> Option<Retained<NSGraphicsContext>>;
#[unsafe(method(pageRange))]
#[unsafe(method_family = none)]
pub fn pageRange(&self) -> NSRange;
#[unsafe(method(currentPage))]
#[unsafe(method_family = none)]
pub fn currentPage(&self) -> NSInteger;
#[cfg(feature = "NSGraphicsContext")]
#[unsafe(method(createContext))]
#[unsafe(method_family = none)]
pub fn createContext(&self) -> Option<Retained<NSGraphicsContext>>;
#[unsafe(method(destroyContext))]
#[unsafe(method_family = none)]
pub fn destroyContext(&self);
#[unsafe(method(deliverResult))]
#[unsafe(method_family = none)]
pub fn deliverResult(&self) -> bool;
#[unsafe(method(cleanUpOperation))]
#[unsafe(method_family = none)]
pub fn cleanUpOperation(&self);
);
}
impl NSPrintOperation {
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>;
);
}
impl NSPrintOperation {
extern_methods!(
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
#[deprecated = "Use -[NSPrintPanel addAccessoryController:] and -[NSPrintPanel removeAccessoryController:] instead"]
#[unsafe(method(setAccessoryView:))]
#[unsafe(method_family = none)]
pub fn setAccessoryView(&self, view: Option<&NSView>);
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
#[deprecated = "Use -[NSPrintPanel accessoryControllers] instead"]
#[unsafe(method(accessoryView))]
#[unsafe(method_family = none)]
pub fn accessoryView(&self) -> Option<Retained<NSView>>;
#[deprecated]
#[unsafe(method(setJobStyleHint:))]
#[unsafe(method_family = none)]
pub fn setJobStyleHint(&self, hint: Option<&NSString>);
#[deprecated]
#[unsafe(method(jobStyleHint))]
#[unsafe(method_family = none)]
pub fn jobStyleHint(&self) -> Option<Retained<NSString>>;
#[deprecated = "Use -setShowsPrintPanel: and -setShowsProgressPanel: instead"]
#[unsafe(method(setShowPanels:))]
#[unsafe(method_family = none)]
pub fn setShowPanels(&self, flag: bool);
#[deprecated = "Use -showsPrintPanel and -showsProgressPanel instead"]
#[unsafe(method(showPanels))]
#[unsafe(method_family = none)]
pub fn showPanels(&self) -> bool;
);
}