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::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/pdfkit/pdfoutline?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct PDFOutline;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for PDFOutline {}
);

impl PDFOutline {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

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

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

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

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

        #[unsafe(method(childAtIndex:))]
        #[unsafe(method_family = none)]
        pub unsafe fn childAtIndex(&self, index: NSUInteger) -> Option<Retained<PDFOutline>>;

        #[unsafe(method(insertChild:atIndex:))]
        #[unsafe(method_family = none)]
        pub unsafe fn insertChild_atIndex(&self, child: &PDFOutline, index: NSUInteger);

        #[unsafe(method(removeFromParent))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeFromParent(&self);

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

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

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

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

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

        #[cfg(feature = "PDFDestination")]
        /// Setter for [`destination`][Self::destination].
        #[unsafe(method(setDestination:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDestination(&self, destination: Option<&PDFDestination>);

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

        #[cfg(feature = "PDFAction")]
        /// Setter for [`action`][Self::action].
        #[unsafe(method(setAction:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAction(&self, action: Option<&PDFAction>);
    );
}

/// Methods declared on superclass `NSObject`.
impl PDFOutline {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}