objc2_app_kit/generated/
NSPageLayout.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspagelayoutresult?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct NSPageLayoutResult(pub NSInteger);
15impl NSPageLayoutResult {
16    #[doc(alias = "NSPageLayoutResultCancelled")]
17    pub const Cancelled: Self = Self(0);
18    #[doc(alias = "NSPageLayoutResultChanged")]
19    pub const Changed: Self = Self(1);
20}
21
22unsafe impl Encode for NSPageLayoutResult {
23    const ENCODING: Encoding = NSInteger::ENCODING;
24}
25
26unsafe impl RefEncode for NSPageLayoutResult {
27    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
28}
29
30extern_class!(
31    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspagelayout?language=objc)
32    #[unsafe(super(NSObject))]
33    #[thread_kind = MainThreadOnly]
34    #[derive(Debug, PartialEq, Eq, Hash)]
35    pub struct NSPageLayout;
36);
37
38unsafe impl NSObjectProtocol for NSPageLayout {}
39
40impl NSPageLayout {
41    extern_methods!(
42        #[unsafe(method(pageLayout))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn pageLayout(mtm: MainThreadMarker) -> Retained<NSPageLayout>;
45
46        #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
47        #[unsafe(method(addAccessoryController:))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn addAccessoryController(&self, accessory_controller: &NSViewController);
50
51        #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
52        #[unsafe(method(removeAccessoryController:))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn removeAccessoryController(&self, accessory_controller: &NSViewController);
55
56        #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
57        #[unsafe(method(accessoryControllers))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn accessoryControllers(&self) -> Retained<NSArray<NSViewController>>;
60
61        #[cfg(all(
62            feature = "NSPrintInfo",
63            feature = "NSResponder",
64            feature = "NSWindow",
65            feature = "block2"
66        ))]
67        #[unsafe(method(beginSheetUsingPrintInfo:onWindow:completionHandler:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn beginSheetUsingPrintInfo_onWindow_completionHandler(
70            &self,
71            print_info: &NSPrintInfo,
72            parent_window: &NSWindow,
73            handler: Option<&block2::Block<dyn Fn(NSPageLayoutResult)>>,
74        );
75
76        #[cfg(all(feature = "NSPrintInfo", feature = "NSResponder", feature = "NSWindow"))]
77        #[deprecated]
78        #[unsafe(method(beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo:))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn beginSheetWithPrintInfo_modalForWindow_delegate_didEndSelector_contextInfo(
81            &self,
82            print_info: &NSPrintInfo,
83            doc_window: &NSWindow,
84            delegate: Option<&AnyObject>,
85            did_end_selector: Option<Sel>,
86            context_info: *mut c_void,
87        );
88
89        #[cfg(feature = "NSPrintInfo")]
90        #[unsafe(method(runModalWithPrintInfo:))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn runModalWithPrintInfo(&self, print_info: &NSPrintInfo) -> NSInteger;
93
94        #[unsafe(method(runModal))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn runModal(&self) -> NSInteger;
97
98        #[cfg(feature = "NSPrintInfo")]
99        #[unsafe(method(printInfo))]
100        #[unsafe(method_family = none)]
101        pub unsafe fn printInfo(&self) -> Option<Retained<NSPrintInfo>>;
102    );
103}
104
105/// Methods declared on superclass `NSObject`.
106impl NSPageLayout {
107    extern_methods!(
108        #[unsafe(method(init))]
109        #[unsafe(method_family = init)]
110        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
111
112        #[unsafe(method(new))]
113        #[unsafe(method_family = new)]
114        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
115    );
116}
117
118/// NSDeprecated.
119impl NSPageLayout {
120    extern_methods!(
121        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
122        #[deprecated]
123        #[unsafe(method(setAccessoryView:))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn setAccessoryView(&self, accessory_view: Option<&NSView>);
126
127        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
128        #[deprecated]
129        #[unsafe(method(accessoryView))]
130        #[unsafe(method_family = none)]
131        pub unsafe fn accessoryView(&self) -> Option<Retained<NSView>>;
132
133        #[deprecated]
134        #[unsafe(method(readPrintInfo))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn readPrintInfo(&self);
137
138        #[deprecated]
139        #[unsafe(method(writePrintInfo))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn writePrintInfo(&self);
142    );
143}
144
145/// NSPageLayoutPanel.
146#[cfg(all(feature = "NSApplication", feature = "NSResponder"))]
147impl NSApplication {
148    extern_methods!(
149        #[unsafe(method(runPageLayout:))]
150        #[unsafe(method_family = none)]
151        pub unsafe fn runPageLayout(&self, sender: Option<&AnyObject>);
152    );
153}