use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSPDFPanelOptions(pub NSInteger);
bitflags::bitflags! {
impl NSPDFPanelOptions: NSInteger {
#[doc(alias = "NSPDFPanelShowsPaperSize")]
const ShowsPaperSize = 1<<2;
#[doc(alias = "NSPDFPanelShowsOrientation")]
const ShowsOrientation = 1<<3;
#[doc(alias = "NSPDFPanelRequestsParentDirectory")]
const RequestsParentDirectory = 1<<24;
}
}
unsafe impl Encode for NSPDFPanelOptions {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSPDFPanelOptions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSPDFPanel;
);
extern_conformance!(
unsafe impl NSObjectProtocol for NSPDFPanel {}
);
impl NSPDFPanel {
extern_methods!(
#[unsafe(method(panel))]
#[unsafe(method_family = none)]
pub fn panel(mtm: MainThreadMarker) -> Retained<NSPDFPanel>;
#[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
#[unsafe(method(accessoryController))]
#[unsafe(method_family = none)]
pub fn accessoryController(&self) -> Option<Retained<NSViewController>>;
#[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
#[unsafe(method(setAccessoryController:))]
#[unsafe(method_family = none)]
pub fn setAccessoryController(&self, accessory_controller: Option<&NSViewController>);
#[unsafe(method(options))]
#[unsafe(method_family = none)]
pub fn options(&self) -> NSPDFPanelOptions;
#[unsafe(method(setOptions:))]
#[unsafe(method_family = none)]
pub fn setOptions(&self, options: NSPDFPanelOptions);
#[unsafe(method(defaultFileName))]
#[unsafe(method_family = none)]
pub fn defaultFileName(&self) -> Retained<NSString>;
#[unsafe(method(setDefaultFileName:))]
#[unsafe(method_family = none)]
pub fn setDefaultFileName(&self, default_file_name: &NSString);
#[cfg(all(
feature = "NSPDFInfo",
feature = "NSResponder",
feature = "NSWindow",
feature = "block2"
))]
#[unsafe(method(beginSheetWithPDFInfo:modalForWindow:completionHandler:))]
#[unsafe(method_family = none)]
pub fn beginSheetWithPDFInfo_modalForWindow_completionHandler(
&self,
pdf_info: &NSPDFInfo,
doc_window: Option<&NSWindow>,
completion_handler: &block2::DynBlock<dyn Fn(NSInteger)>,
);
);
}
impl NSPDFPanel {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}