objc2_app_kit/generated/
NSPDFPanel.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct NSPDFPanelOptions(pub NSInteger);
15bitflags::bitflags! {
16 impl NSPDFPanelOptions: NSInteger {
17 #[doc(alias = "NSPDFPanelShowsPaperSize")]
18 const ShowsPaperSize = 1<<2;
19 #[doc(alias = "NSPDFPanelShowsOrientation")]
20 const ShowsOrientation = 1<<3;
21 #[doc(alias = "NSPDFPanelRequestsParentDirectory")]
22 const RequestsParentDirectory = 1<<24;
23 }
24}
25
26unsafe impl Encode for NSPDFPanelOptions {
27 const ENCODING: Encoding = NSInteger::ENCODING;
28}
29
30unsafe impl RefEncode for NSPDFPanelOptions {
31 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
32}
33
34extern_class!(
35 #[unsafe(super(NSObject))]
37 #[thread_kind = MainThreadOnly]
38 #[derive(Debug, PartialEq, Eq, Hash)]
39 pub struct NSPDFPanel;
40);
41
42extern_conformance!(
43 unsafe impl NSObjectProtocol for NSPDFPanel {}
44);
45
46impl NSPDFPanel {
47 extern_methods!(
48 #[unsafe(method(panel))]
49 #[unsafe(method_family = none)]
50 pub fn panel(mtm: MainThreadMarker) -> Retained<NSPDFPanel>;
51
52 #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
53 #[unsafe(method(accessoryController))]
54 #[unsafe(method_family = none)]
55 pub fn accessoryController(&self) -> Option<Retained<NSViewController>>;
56
57 #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
58 #[unsafe(method(setAccessoryController:))]
60 #[unsafe(method_family = none)]
61 pub fn setAccessoryController(&self, accessory_controller: Option<&NSViewController>);
62
63 #[unsafe(method(options))]
64 #[unsafe(method_family = none)]
65 pub fn options(&self) -> NSPDFPanelOptions;
66
67 #[unsafe(method(setOptions:))]
69 #[unsafe(method_family = none)]
70 pub fn setOptions(&self, options: NSPDFPanelOptions);
71
72 #[unsafe(method(defaultFileName))]
73 #[unsafe(method_family = none)]
74 pub fn defaultFileName(&self) -> Retained<NSString>;
75
76 #[unsafe(method(setDefaultFileName:))]
80 #[unsafe(method_family = none)]
81 pub fn setDefaultFileName(&self, default_file_name: &NSString);
82
83 #[cfg(all(
84 feature = "NSPDFInfo",
85 feature = "NSResponder",
86 feature = "NSWindow",
87 feature = "block2"
88 ))]
89 #[unsafe(method(beginSheetWithPDFInfo:modalForWindow:completionHandler:))]
90 #[unsafe(method_family = none)]
91 pub fn beginSheetWithPDFInfo_modalForWindow_completionHandler(
92 &self,
93 pdf_info: &NSPDFInfo,
94 doc_window: Option<&NSWindow>,
95 completion_handler: &block2::DynBlock<dyn Fn(NSInteger)>,
96 );
97 );
98}
99
100impl NSPDFPanel {
102 extern_methods!(
103 #[unsafe(method(init))]
104 #[unsafe(method_family = init)]
105 pub fn init(this: Allocated<Self>) -> Retained<Self>;
106
107 #[unsafe(method(new))]
108 #[unsafe(method_family = new)]
109 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
110 );
111}