objc2_app_kit/generated/
NSPDFImageRep.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
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspdfimagerep?language=objc)
12    #[unsafe(super(NSImageRep, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "NSImageRep")]
15    pub struct NSPDFImageRep;
16);
17
18#[cfg(feature = "NSImageRep")]
19extern_conformance!(
20    unsafe impl NSCoding for NSPDFImageRep {}
21);
22
23#[cfg(feature = "NSImageRep")]
24extern_conformance!(
25    unsafe impl NSCopying for NSPDFImageRep {}
26);
27
28#[cfg(feature = "NSImageRep")]
29unsafe impl CopyingHelper for NSPDFImageRep {
30    type Result = Self;
31}
32
33#[cfg(feature = "NSImageRep")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for NSPDFImageRep {}
36);
37
38#[cfg(feature = "NSImageRep")]
39impl NSPDFImageRep {
40    extern_methods!(
41        #[unsafe(method(imageRepWithData:))]
42        #[unsafe(method_family = none)]
43        pub fn imageRepWithData(pdf_data: &NSData) -> Option<Retained<Self>>;
44
45        #[unsafe(method(initWithData:))]
46        #[unsafe(method_family = init)]
47        pub fn initWithData(this: Allocated<Self>, pdf_data: &NSData) -> Option<Retained<Self>>;
48
49        #[unsafe(method(PDFRepresentation))]
50        #[unsafe(method_family = none)]
51        pub fn PDFRepresentation(&self) -> Retained<NSData>;
52
53        #[unsafe(method(bounds))]
54        #[unsafe(method_family = none)]
55        pub fn bounds(&self) -> NSRect;
56
57        #[unsafe(method(currentPage))]
58        #[unsafe(method_family = none)]
59        pub fn currentPage(&self) -> NSInteger;
60
61        /// Setter for [`currentPage`][Self::currentPage].
62        #[unsafe(method(setCurrentPage:))]
63        #[unsafe(method_family = none)]
64        pub fn setCurrentPage(&self, current_page: NSInteger);
65
66        #[unsafe(method(pageCount))]
67        #[unsafe(method_family = none)]
68        pub fn pageCount(&self) -> NSInteger;
69    );
70}
71
72/// Methods declared on superclass `NSImageRep`.
73#[cfg(feature = "NSImageRep")]
74impl NSPDFImageRep {
75    extern_methods!(
76        #[unsafe(method(init))]
77        #[unsafe(method_family = init)]
78        pub fn init(this: Allocated<Self>) -> Retained<Self>;
79
80        /// # Safety
81        ///
82        /// `coder` possibly has further requirements.
83        #[unsafe(method(initWithCoder:))]
84        #[unsafe(method_family = init)]
85        pub unsafe fn initWithCoder(
86            this: Allocated<Self>,
87            coder: &NSCoder,
88        ) -> Option<Retained<Self>>;
89    );
90}
91
92/// Methods declared on superclass `NSObject`.
93#[cfg(feature = "NSImageRep")]
94impl NSPDFImageRep {
95    extern_methods!(
96        #[unsafe(method(new))]
97        #[unsafe(method_family = new)]
98        pub fn new() -> Retained<Self>;
99    );
100}
101
102#[cfg(feature = "NSImageRep")]
103impl DefaultRetained for NSPDFImageRep {
104    #[inline]
105    fn default_retained() -> Retained<Self> {
106        Self::new()
107    }
108}