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::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

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

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

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

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

#[cfg(feature = "PKToolPickerItem")]
impl PKToolPickerInkingItem {
    extern_methods!(
        #[cfg(feature = "PKInkType")]
        /// Create a new tool picker item with a `PKInkType`.
        ///
        /// Parameter `inkType`: The ink type for the tool.
        #[unsafe(method(initWithInkType:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithInkType(
            this: Allocated<Self>,
            ink_type: &PKInkType,
        ) -> Retained<Self>;

        #[cfg(all(feature = "PKInkType", feature = "objc2-app-kit"))]
        #[cfg(target_os = "macos")]
        #[unsafe(method(initWithInkType:color:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithInkType_color(
            this: Allocated<Self>,
            ink_type: &PKInkType,
            color: &NSColor,
        ) -> Retained<Self>;

        #[cfg(all(feature = "PKInkType", feature = "objc2-core-foundation"))]
        /// Create a new tool picker item with a `PKInkType`.
        ///
        /// Parameter `inkType`: The ink type for the tool.
        ///
        /// Parameter `width`: The width for the tool.
        #[unsafe(method(initWithInkType:width:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithInkType_width(
            this: Allocated<Self>,
            ink_type: &PKInkType,
            width: CGFloat,
        ) -> Retained<Self>;

        #[cfg(all(
            feature = "PKInkType",
            feature = "objc2-app-kit",
            feature = "objc2-core-foundation"
        ))]
        #[cfg(target_os = "macos")]
        #[unsafe(method(initWithInkType:color:width:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithInkType_color_width(
            this: Allocated<Self>,
            ink_type: &PKInkType,
            color: &NSColor,
            width: CGFloat,
        ) -> Retained<Self>;

        #[cfg(all(
            feature = "PKInkType",
            feature = "objc2-app-kit",
            feature = "objc2-core-foundation"
        ))]
        #[cfg(target_os = "macos")]
        #[unsafe(method(initWithInkType:color:width:identifier:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithInkType_color_width_identifier(
            this: Allocated<Self>,
            ink_type: &PKInkType,
            color: &NSColor,
            width: CGFloat,
            identifier: Option<&NSString>,
        ) -> Retained<Self>;

        #[cfg(all(
            feature = "PKInkType",
            feature = "objc2-app-kit",
            feature = "objc2-core-foundation"
        ))]
        #[cfg(target_os = "macos")]
        #[unsafe(method(initWithInkType:color:width:azimuth:identifier:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithInkType_color_width_azimuth_identifier(
            this: Allocated<Self>,
            ink_type: &PKInkType,
            color: &NSColor,
            width: CGFloat,
            azimuth: CGFloat,
            identifier: Option<&NSString>,
        ) -> Retained<Self>;

        #[cfg(all(feature = "PKInkingTool", feature = "PKTool"))]
        /// A tool for drawing on a `PKCanvasView`.
        #[unsafe(method(inkingTool))]
        #[unsafe(method_family = none)]
        pub unsafe fn inkingTool(&self) -> Retained<PKInkingTool>;

        /// Present color selection UI to the user.
        /// Default value is YES.
        #[unsafe(method(allowsColorSelection))]
        #[unsafe(method_family = none)]
        pub unsafe fn allowsColorSelection(&self) -> bool;

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

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