objc2-pdf-kit 0.3.2

Bindings to the PDFKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
use objc2_foundation::*;

use crate::*;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/pdfkit/pdfthumbnailviewdocumenteditednotification?language=objc)
    pub static PDFThumbnailViewDocumentEditedNotification: &'static NSString;
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/pdfkit/pdfthumbnailview?language=objc)
    #[unsafe(super(NSView, NSResponder, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "objc2-app-kit")]
    #[cfg(target_os = "macos")]
    pub struct PDFThumbnailView;
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSAccessibility for PDFThumbnailView {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSAccessibilityElementProtocol for PDFThumbnailView {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSAnimatablePropertyContainer for PDFThumbnailView {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSAppearanceCustomization for PDFThumbnailView {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSCoding for PDFThumbnailView {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSDraggingDestination for PDFThumbnailView {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSObjectProtocol for PDFThumbnailView {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSUserInterfaceItemIdentification for PDFThumbnailView {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl PDFThumbnailView {
    extern_methods!(
        #[cfg(feature = "PDFView")]
        #[unsafe(method(PDFView))]
        #[unsafe(method_family = none)]
        pub unsafe fn PDFView(&self) -> Option<Retained<PDFView>>;

        #[cfg(feature = "PDFView")]
        /// Setter for [`PDFView`][Self::PDFView].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[unsafe(method(setPDFView:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPDFView(&self, pdf_view: Option<&PDFView>);

        #[unsafe(method(backgroundColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn backgroundColor(&self) -> Option<Retained<NSColor>>;

        /// Setter for [`backgroundColor`][Self::backgroundColor].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setBackgroundColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setBackgroundColor(&self, background_color: Option<&NSColor>);

        #[cfg(feature = "PDFPage")]
        #[unsafe(method(selectedPages))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectedPages(&self) -> Option<Retained<NSArray<PDFPage>>>;

        #[unsafe(method(thumbnailSize))]
        #[unsafe(method_family = none)]
        pub unsafe fn thumbnailSize(&self) -> NSSize;

        /// Setter for [`thumbnailSize`][Self::thumbnailSize].
        #[unsafe(method(setThumbnailSize:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setThumbnailSize(&self, thumbnail_size: NSSize);

        #[unsafe(method(maximumNumberOfColumns))]
        #[unsafe(method_family = none)]
        pub unsafe fn maximumNumberOfColumns(&self) -> NSUInteger;

        /// Setter for [`maximumNumberOfColumns`][Self::maximumNumberOfColumns].
        #[unsafe(method(setMaximumNumberOfColumns:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMaximumNumberOfColumns(&self, maximum_number_of_columns: NSUInteger);

        #[unsafe(method(labelFont))]
        #[unsafe(method_family = none)]
        pub unsafe fn labelFont(&self) -> Option<Retained<NSFont>>;

        /// Setter for [`labelFont`][Self::labelFont].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setLabelFont:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLabelFont(&self, label_font: Option<&NSFont>);

        #[unsafe(method(allowsDragging))]
        #[unsafe(method_family = none)]
        pub unsafe fn allowsDragging(&self) -> bool;

        /// Setter for [`allowsDragging`][Self::allowsDragging].
        #[unsafe(method(setAllowsDragging:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAllowsDragging(&self, allows_dragging: bool);

        #[unsafe(method(allowsMultipleSelection))]
        #[unsafe(method_family = none)]
        pub unsafe fn allowsMultipleSelection(&self) -> bool;

        /// Setter for [`allowsMultipleSelection`][Self::allowsMultipleSelection].
        #[unsafe(method(setAllowsMultipleSelection:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAllowsMultipleSelection(&self, allows_multiple_selection: bool);
    );
}

/// Methods declared on superclass `NSView`.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl PDFThumbnailView {
    extern_methods!(
        #[unsafe(method(initWithFrame:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;
    );
}

/// Methods declared on superclass `NSResponder`.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl PDFThumbnailView {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl PDFThumbnailView {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}