use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
use objc2_app_kit::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct QLPreviewViewStyle(pub NSUInteger);
impl QLPreviewViewStyle {
#[doc(alias = "QLPreviewViewStyleNormal")]
pub const Normal: Self = Self(0);
#[doc(alias = "QLPreviewViewStyleCompact")]
pub const Compact: Self = Self(1);
}
unsafe impl Encode for QLPreviewViewStyle {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for QLPreviewViewStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSView, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "objc2-app-kit")]
pub struct QLPreviewView;
);
#[cfg(feature = "objc2-app-kit")]
extern_conformance!(
unsafe impl NSAccessibility for QLPreviewView {}
);
#[cfg(feature = "objc2-app-kit")]
extern_conformance!(
unsafe impl NSAccessibilityElementProtocol for QLPreviewView {}
);
#[cfg(feature = "objc2-app-kit")]
extern_conformance!(
unsafe impl NSAnimatablePropertyContainer for QLPreviewView {}
);
#[cfg(feature = "objc2-app-kit")]
extern_conformance!(
unsafe impl NSAppearanceCustomization for QLPreviewView {}
);
#[cfg(feature = "objc2-app-kit")]
extern_conformance!(
unsafe impl NSCoding for QLPreviewView {}
);
#[cfg(feature = "objc2-app-kit")]
extern_conformance!(
unsafe impl NSDraggingDestination for QLPreviewView {}
);
#[cfg(feature = "objc2-app-kit")]
extern_conformance!(
unsafe impl NSObjectProtocol for QLPreviewView {}
);
#[cfg(feature = "objc2-app-kit")]
extern_conformance!(
unsafe impl NSUserInterfaceItemIdentification for QLPreviewView {}
);
#[cfg(feature = "objc2-app-kit")]
impl QLPreviewView {
extern_methods!(
#[unsafe(method(initWithFrame:style:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithFrame_style(
this: Allocated<Self>,
frame: NSRect,
style: QLPreviewViewStyle,
) -> Option<Retained<Self>>;
#[unsafe(method(initWithFrame:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithFrame(this: Allocated<Self>, frame: NSRect)
-> Option<Retained<Self>>;
#[cfg(feature = "QLPreviewItem")]
#[unsafe(method(previewItem))]
#[unsafe(method_family = none)]
pub unsafe fn previewItem(&self) -> Option<Retained<ProtocolObject<dyn QLPreviewItem>>>;
#[cfg(feature = "QLPreviewItem")]
#[unsafe(method(setPreviewItem:))]
#[unsafe(method_family = none)]
pub unsafe fn setPreviewItem(
&self,
preview_item: Option<&ProtocolObject<dyn QLPreviewItem>>,
);
#[unsafe(method(refreshPreviewItem))]
#[unsafe(method_family = none)]
pub unsafe fn refreshPreviewItem(&self);
#[unsafe(method(displayState))]
#[unsafe(method_family = none)]
pub unsafe fn displayState(&self) -> Option<Retained<AnyObject>>;
#[unsafe(method(setDisplayState:))]
#[unsafe(method_family = none)]
pub unsafe fn setDisplayState(&self, display_state: Option<&AnyObject>);
#[unsafe(method(close))]
#[unsafe(method_family = none)]
pub unsafe fn close(&self);
#[unsafe(method(shouldCloseWithWindow))]
#[unsafe(method_family = none)]
pub unsafe fn shouldCloseWithWindow(&self) -> bool;
#[unsafe(method(setShouldCloseWithWindow:))]
#[unsafe(method_family = none)]
pub unsafe fn setShouldCloseWithWindow(&self, should_close_with_window: bool);
#[unsafe(method(autostarts))]
#[unsafe(method_family = none)]
pub unsafe fn autostarts(&self) -> bool;
#[unsafe(method(setAutostarts:))]
#[unsafe(method_family = none)]
pub unsafe fn setAutostarts(&self, autostarts: bool);
);
}
#[cfg(feature = "objc2-app-kit")]
impl QLPreviewView {
extern_methods!(
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
);
}
#[cfg(feature = "objc2-app-kit")]
impl QLPreviewView {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(feature = "objc2-app-kit")]
impl QLPreviewView {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}