objc2-pencil-kit 0.3.2

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

use crate::*;

extern_class!(
    /// A user interface for an eraser tool item in PKToolPicker.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/pencilkit/pktoolpickereraseritem?language=objc)
    #[unsafe(super(PKToolPickerItem, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "PKToolPickerItem")]
    pub struct PKToolPickerEraserItem;
);

#[cfg(feature = "PKToolPickerItem")]
extern_conformance!(
    unsafe impl NSCopying for PKToolPickerEraserItem {}
);

#[cfg(feature = "PKToolPickerItem")]
unsafe impl CopyingHelper for PKToolPickerEraserItem {
    type Result = Self;
}

#[cfg(feature = "PKToolPickerItem")]
extern_conformance!(
    unsafe impl NSObjectProtocol for PKToolPickerEraserItem {}
);

#[cfg(feature = "PKToolPickerItem")]
impl PKToolPickerEraserItem {
    extern_methods!(
        #[cfg(feature = "PKEraserTool")]
        /// Create a new eraser tool item.
        #[unsafe(method(initWithEraserType:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithEraserType(
            this: Allocated<Self>,
            eraser_type: PKEraserType,
        ) -> Retained<Self>;

        #[cfg(all(feature = "PKEraserTool", feature = "objc2-core-foundation"))]
        /// Create a new eraser tool item with a width.
        ///
        /// Parameter `eraserType`: The type of eraser.
        ///
        /// Parameter `width`: The width of the eraser.
        #[unsafe(method(initWithEraserType:width:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithEraserType_width(
            this: Allocated<Self>,
            eraser_type: PKEraserType,
            width: CGFloat,
        ) -> Retained<Self>;

        #[cfg(all(feature = "PKEraserTool", feature = "PKTool"))]
        /// An eraser tool for erasing parts of a drawing.
        #[unsafe(method(eraserTool))]
        #[unsafe(method_family = none)]
        pub unsafe fn eraserTool(&self) -> Retained<PKEraserTool>;
    );
}

/// Methods declared on superclass `PKToolPickerItem`.
#[cfg(feature = "PKToolPickerItem")]
impl PKToolPickerEraserItem {
    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 = "PKToolPickerItem")]
impl PKToolPickerEraserItem {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}