use crate::common::*;
use crate::AppKit::*;
use crate::CoreData::*;
use crate::Foundation::*;
ns_options!(
#[underlying(NSUInteger)]
pub enum NSPrintPanelOptions {
NSPrintPanelShowsCopies = 1 << 0,
NSPrintPanelShowsPageRange = 1 << 1,
NSPrintPanelShowsPaperSize = 1 << 2,
NSPrintPanelShowsOrientation = 1 << 3,
NSPrintPanelShowsScaling = 1 << 4,
NSPrintPanelShowsPrintSelection = 1 << 5,
NSPrintPanelShowsPageSetupAccessory = 1 << 8,
NSPrintPanelShowsPreview = 1 << 17,
}
);
typed_enum!(
pub type NSPrintPanelJobStyleHint = NSString;
);
extern_static!(NSPrintPhotoJobStyleHint: &'static NSPrintPanelJobStyleHint);
extern_static!(NSPrintAllPresetsJobStyleHint: &'static NSPrintPanelJobStyleHint);
extern_static!(NSPrintNoPresetsJobStyleHint: &'static NSPrintPanelJobStyleHint);
typed_enum!(
pub type NSPrintPanelAccessorySummaryKey = NSString;
);
extern_static!(NSPrintPanelAccessorySummaryItemNameKey: &'static NSPrintPanelAccessorySummaryKey);
extern_static!(
NSPrintPanelAccessorySummaryItemDescriptionKey: &'static NSPrintPanelAccessorySummaryKey
);
extern_protocol!(
pub struct NSPrintPanelAccessorizing;
unsafe impl ProtocolType for NSPrintPanelAccessorizing {
#[method_id(@__retain_semantics Other localizedSummaryItems)]
pub unsafe fn localizedSummaryItems(
&self,
) -> Id<NSArray<NSDictionary<NSPrintPanelAccessorySummaryKey, NSString>>, Shared>;
#[optional]
#[method_id(@__retain_semantics Other keyPathsForValuesAffectingPreview)]
pub unsafe fn keyPathsForValuesAffectingPreview(&self) -> Id<NSSet<NSString>, Shared>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSPrintPanel;
unsafe impl ClassType for NSPrintPanel {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSPrintPanel {
#[method_id(@__retain_semantics Other printPanel)]
pub unsafe fn printPanel() -> Id<NSPrintPanel, Shared>;
#[method(addAccessoryController:)]
pub unsafe fn addAccessoryController(&self, accessoryController: &TodoProtocols);
#[method(removeAccessoryController:)]
pub unsafe fn removeAccessoryController(&self, accessoryController: &TodoProtocols);
#[method_id(@__retain_semantics Other accessoryControllers)]
pub unsafe fn accessoryControllers(&self) -> Id<NSArray<NSViewController>, Shared>;
#[method(options)]
pub unsafe fn options(&self) -> NSPrintPanelOptions;
#[method(setOptions:)]
pub unsafe fn setOptions(&self, options: NSPrintPanelOptions);
#[method(setDefaultButtonTitle:)]
pub unsafe fn setDefaultButtonTitle(&self, defaultButtonTitle: Option<&NSString>);
#[method_id(@__retain_semantics Other defaultButtonTitle)]
pub unsafe fn defaultButtonTitle(&self) -> Option<Id<NSString, Shared>>;
#[method_id(@__retain_semantics Other helpAnchor)]
pub unsafe fn helpAnchor(&self) -> Option<Id<NSHelpAnchorName, Shared>>;
#[method(setHelpAnchor:)]
pub unsafe fn setHelpAnchor(&self, helpAnchor: Option<&NSHelpAnchorName>);
#[method_id(@__retain_semantics Other jobStyleHint)]
pub unsafe fn jobStyleHint(&self) -> Option<Id<NSPrintPanelJobStyleHint, Shared>>;
#[method(setJobStyleHint:)]
pub unsafe fn setJobStyleHint(&self, jobStyleHint: Option<&NSPrintPanelJobStyleHint>);
#[method(beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo:)]
pub unsafe fn beginSheetWithPrintInfo_modalForWindow_delegate_didEndSelector_contextInfo(
&self,
printInfo: &NSPrintInfo,
docWindow: &NSWindow,
delegate: Option<&Object>,
didEndSelector: Option<Sel>,
contextInfo: *mut c_void,
);
#[method(runModalWithPrintInfo:)]
pub unsafe fn runModalWithPrintInfo(&self, printInfo: &NSPrintInfo) -> NSInteger;
#[method(runModal)]
pub unsafe fn runModal(&self) -> NSInteger;
#[method_id(@__retain_semantics Other printInfo)]
pub unsafe fn printInfo(&self) -> Id<NSPrintInfo, Shared>;
}
);
extern_methods!(
unsafe impl NSPrintPanel {
#[method(setAccessoryView:)]
pub unsafe fn setAccessoryView(&self, accessoryView: Option<&NSView>);
#[method_id(@__retain_semantics Other accessoryView)]
pub unsafe fn accessoryView(&self) -> Option<Id<NSView, Shared>>;
#[method(updateFromPrintInfo)]
pub unsafe fn updateFromPrintInfo(&self);
#[method(finalWritePrintInfo)]
pub unsafe fn finalWritePrintInfo(&self);
}
);