use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSImageRep, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "NSImageRep")]
pub struct NSPDFImageRep;
);
#[cfg(feature = "NSImageRep")]
extern_conformance!(
unsafe impl NSCoding for NSPDFImageRep {}
);
#[cfg(feature = "NSImageRep")]
extern_conformance!(
unsafe impl NSCopying for NSPDFImageRep {}
);
#[cfg(feature = "NSImageRep")]
unsafe impl CopyingHelper for NSPDFImageRep {
type Result = Self;
}
#[cfg(feature = "NSImageRep")]
extern_conformance!(
unsafe impl NSObjectProtocol for NSPDFImageRep {}
);
#[cfg(feature = "NSImageRep")]
impl NSPDFImageRep {
extern_methods!(
#[unsafe(method(imageRepWithData:))]
#[unsafe(method_family = none)]
pub fn imageRepWithData(pdf_data: &NSData) -> Option<Retained<Self>>;
#[unsafe(method(initWithData:))]
#[unsafe(method_family = init)]
pub fn initWithData(this: Allocated<Self>, pdf_data: &NSData) -> Option<Retained<Self>>;
#[unsafe(method(PDFRepresentation))]
#[unsafe(method_family = none)]
pub fn PDFRepresentation(&self) -> Retained<NSData>;
#[unsafe(method(bounds))]
#[unsafe(method_family = none)]
pub fn bounds(&self) -> NSRect;
#[unsafe(method(currentPage))]
#[unsafe(method_family = none)]
pub fn currentPage(&self) -> NSInteger;
#[unsafe(method(setCurrentPage:))]
#[unsafe(method_family = none)]
pub fn setCurrentPage(&self, current_page: NSInteger);
#[unsafe(method(pageCount))]
#[unsafe(method_family = none)]
pub fn pageCount(&self) -> NSInteger;
);
}
#[cfg(feature = "NSImageRep")]
impl NSPDFImageRep {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
);
}
#[cfg(feature = "NSImageRep")]
impl NSPDFImageRep {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}
#[cfg(feature = "NSImageRep")]
impl DefaultRetained for NSPDFImageRep {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}