use crate::common::*;
use crate::AppKit::*;
use crate::CoreData::*;
use crate::Foundation::*;
ns_enum!(
#[underlying(NSInteger)]
pub enum NSPageLayoutResult {
NSPageLayoutResultCancelled = 0,
NSPageLayoutResultChanged = 1,
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "AppKit_NSPageLayout")]
pub struct NSPageLayout;
#[cfg(feature = "AppKit_NSPageLayout")]
unsafe impl ClassType for NSPageLayout {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
#[cfg(feature = "AppKit_NSPageLayout")]
unsafe impl NSObjectProtocol for NSPageLayout {}
extern_methods!(
#[cfg(feature = "AppKit_NSPageLayout")]
unsafe impl NSPageLayout {
#[method_id(@__retain_semantics Other pageLayout)]
pub unsafe fn pageLayout(mtm: MainThreadMarker) -> Id<NSPageLayout>;
#[cfg(feature = "AppKit_NSViewController")]
#[method(addAccessoryController:)]
pub unsafe fn addAccessoryController(&self, accessory_controller: &NSViewController);
#[cfg(feature = "AppKit_NSViewController")]
#[method(removeAccessoryController:)]
pub unsafe fn removeAccessoryController(&self, accessory_controller: &NSViewController);
#[cfg(all(feature = "AppKit_NSViewController", feature = "Foundation_NSArray"))]
#[method_id(@__retain_semantics Other accessoryControllers)]
pub unsafe fn accessoryControllers(&self) -> Id<NSArray<NSViewController>>;
#[cfg(all(feature = "AppKit_NSPrintInfo", feature = "AppKit_NSWindow"))]
#[method(beginSheetUsingPrintInfo:onWindow:completionHandler:)]
pub unsafe fn beginSheetUsingPrintInfo_onWindow_completionHandler(
&self,
print_info: &NSPrintInfo,
parent_window: &NSWindow,
handler: Option<&Block<(NSPageLayoutResult,), ()>>,
);
#[cfg(all(feature = "AppKit_NSPrintInfo", feature = "AppKit_NSWindow"))]
#[deprecated]
#[method(beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo:)]
pub unsafe fn beginSheetWithPrintInfo_modalForWindow_delegate_didEndSelector_contextInfo(
&self,
print_info: &NSPrintInfo,
doc_window: &NSWindow,
delegate: Option<&AnyObject>,
did_end_selector: Option<Sel>,
context_info: *mut c_void,
);
#[cfg(feature = "AppKit_NSPrintInfo")]
#[method(runModalWithPrintInfo:)]
pub unsafe fn runModalWithPrintInfo(&self, print_info: &NSPrintInfo) -> NSInteger;
#[method(runModal)]
pub unsafe fn runModal(&self) -> NSInteger;
#[cfg(feature = "AppKit_NSPrintInfo")]
#[method_id(@__retain_semantics Other printInfo)]
pub unsafe fn printInfo(&self) -> Option<Id<NSPrintInfo>>;
}
);
extern_methods!(
#[cfg(feature = "AppKit_NSPageLayout")]
unsafe impl NSPageLayout {
#[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(mtm: MainThreadMarker) -> Id<Self>;
}
);
extern_methods!(
#[cfg(feature = "AppKit_NSPageLayout")]
unsafe impl NSPageLayout {
#[cfg(feature = "AppKit_NSView")]
#[deprecated]
#[method(setAccessoryView:)]
pub unsafe fn setAccessoryView(&self, accessory_view: Option<&NSView>);
#[cfg(feature = "AppKit_NSView")]
#[deprecated]
#[method_id(@__retain_semantics Other accessoryView)]
pub unsafe fn accessoryView(&self) -> Option<Id<NSView>>;
#[deprecated]
#[method(readPrintInfo)]
pub unsafe fn readPrintInfo(&self);
#[deprecated]
#[method(writePrintInfo)]
pub unsafe fn writePrintInfo(&self);
}
);
extern_methods!(
#[cfg(feature = "AppKit_NSApplication")]
unsafe impl NSApplication {
#[method(runPageLayout:)]
pub unsafe fn runPageLayout(&self, sender: Option<&AnyObject>);
}
);