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
38extern_conformance!(
39    unsafe impl NSObjectProtocol for NSPageLayout {}
40);
41
42impl NSPageLayout {
43    extern_methods!(
44        #[unsafe(method(pageLayout))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn pageLayout(mtm: MainThreadMarker) -> Retained<NSPageLayout>;
47
48        #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
49        #[unsafe(method(addAccessoryController:))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn addAccessoryController(&self, accessory_controller: &NSViewController);
52
53        #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
54        #[unsafe(method(removeAccessoryController:))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn removeAccessoryController(&self, accessory_controller: &NSViewController);
57
58        #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
59        #[unsafe(method(accessoryControllers))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn accessoryControllers(&self) -> Retained<NSArray<NSViewController>>;
62
63        #[cfg(all(
64            feature = "NSPrintInfo",
65            feature = "NSResponder",
66            feature = "NSWindow",
67            feature = "block2"
68        ))]
69        #[unsafe(method(beginSheetUsingPrintInfo:onWindow:completionHandler:))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn beginSheetUsingPrintInfo_onWindow_completionHandler(
72            &self,
73            print_info: &NSPrintInfo,
74            parent_window: &NSWindow,
75            handler: Option<&block2::DynBlock<dyn Fn(NSPageLayoutResult)>>,
76        );
77
78        #[cfg(all(feature = "NSPrintInfo", feature = "NSResponder", feature = "NSWindow"))]
79        #[deprecated]
80        #[unsafe(method(beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo:))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn beginSheetWithPrintInfo_modalForWindow_delegate_didEndSelector_contextInfo(
83            &self,
84            print_info: &NSPrintInfo,
85            doc_window: &NSWindow,
86            delegate: Option<&AnyObject>,
87            did_end_selector: Option<Sel>,
88            context_info: *mut c_void,
89        );
90
91        #[cfg(feature = "NSPrintInfo")]
92        #[unsafe(method(runModalWithPrintInfo:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn runModalWithPrintInfo(&self, print_info: &NSPrintInfo) -> NSInteger;
95
96        #[unsafe(method(runModal))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn runModal(&self) -> NSInteger;
99
100        #[cfg(feature = "NSPrintInfo")]
101        #[unsafe(method(printInfo))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn printInfo(&self) -> Option<Retained<NSPrintInfo>>;
104    );
105}
106
107/// Methods declared on superclass `NSObject`.
108impl NSPageLayout {
109    extern_methods!(
110        #[unsafe(method(init))]
111        #[unsafe(method_family = init)]
112        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
113
114        #[unsafe(method(new))]
115        #[unsafe(method_family = new)]
116        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
117    );
118}
119
120/// NSDeprecated.
121impl NSPageLayout {
122    extern_methods!(
123        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
124        #[deprecated]
125        #[unsafe(method(setAccessoryView:))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn setAccessoryView(&self, accessory_view: Option<&NSView>);
128
129        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
130        #[deprecated]
131        #[unsafe(method(accessoryView))]
132        #[unsafe(method_family = none)]
133        pub unsafe fn accessoryView(&self) -> Option<Retained<NSView>>;
134
135        #[deprecated]
136        #[unsafe(method(readPrintInfo))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn readPrintInfo(&self);
139
140        #[deprecated]
141        #[unsafe(method(writePrintInfo))]
142        #[unsafe(method_family = none)]
143        pub unsafe fn writePrintInfo(&self);
144    );
145}
146
147/// NSPageLayoutPanel.
148#[cfg(all(feature = "NSApplication", feature = "NSResponder"))]
149impl NSApplication {
150    extern_methods!(
151        #[unsafe(method(runPageLayout:))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn runPageLayout(&self, sender: Option<&AnyObject>);
154    );
155}