objc2_pencil_kit/generated/
PKToolPickerInkingItem.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::*;
6#[cfg(feature = "objc2-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9#[cfg(feature = "objc2-core-foundation")]
10use objc2_core_foundation::*;
11use objc2_foundation::*;
12
13use crate::*;
14
15extern_class!(
16    /// A user interface for an inking tool item in PKToolPicker.
17    ///
18    /// See also [Apple's documentation](https://developer.apple.com/documentation/pencilkit/pktoolpickerinkingitem?language=objc)
19    #[unsafe(super(PKToolPickerItem, NSObject))]
20    #[derive(Debug, PartialEq, Eq, Hash)]
21    #[cfg(feature = "PKToolPickerItem")]
22    pub struct PKToolPickerInkingItem;
23);
24
25#[cfg(feature = "PKToolPickerItem")]
26extern_conformance!(
27    unsafe impl NSCopying for PKToolPickerInkingItem {}
28);
29
30#[cfg(feature = "PKToolPickerItem")]
31unsafe impl CopyingHelper for PKToolPickerInkingItem {
32    type Result = Self;
33}
34
35#[cfg(feature = "PKToolPickerItem")]
36extern_conformance!(
37    unsafe impl NSObjectProtocol for PKToolPickerInkingItem {}
38);
39
40#[cfg(feature = "PKToolPickerItem")]
41impl PKToolPickerInkingItem {
42    extern_methods!(
43        #[cfg(feature = "PKInkType")]
44        /// Create a new tool picker item with a `PKInkType`.
45        ///
46        /// Parameter `inkType`: The ink type for the tool.
47        #[unsafe(method(initWithInkType:))]
48        #[unsafe(method_family = init)]
49        pub unsafe fn initWithInkType(
50            this: Allocated<Self>,
51            ink_type: &PKInkType,
52        ) -> Retained<Self>;
53
54        #[cfg(all(feature = "PKInkType", feature = "objc2-app-kit"))]
55        #[cfg(target_os = "macos")]
56        #[unsafe(method(initWithInkType:color:))]
57        #[unsafe(method_family = init)]
58        pub unsafe fn initWithInkType_color(
59            this: Allocated<Self>,
60            ink_type: &PKInkType,
61            color: &NSColor,
62        ) -> Retained<Self>;
63
64        #[cfg(all(feature = "PKInkType", feature = "objc2-core-foundation"))]
65        /// Create a new tool picker item with a `PKInkType`.
66        ///
67        /// Parameter `inkType`: The ink type for the tool.
68        ///
69        /// Parameter `width`: The width for the tool.
70        #[unsafe(method(initWithInkType:width:))]
71        #[unsafe(method_family = init)]
72        pub unsafe fn initWithInkType_width(
73            this: Allocated<Self>,
74            ink_type: &PKInkType,
75            width: CGFloat,
76        ) -> Retained<Self>;
77
78        #[cfg(all(
79            feature = "PKInkType",
80            feature = "objc2-app-kit",
81            feature = "objc2-core-foundation"
82        ))]
83        #[cfg(target_os = "macos")]
84        #[unsafe(method(initWithInkType:color:width:))]
85        #[unsafe(method_family = init)]
86        pub unsafe fn initWithInkType_color_width(
87            this: Allocated<Self>,
88            ink_type: &PKInkType,
89            color: &NSColor,
90            width: CGFloat,
91        ) -> Retained<Self>;
92
93        #[cfg(all(
94            feature = "PKInkType",
95            feature = "objc2-app-kit",
96            feature = "objc2-core-foundation"
97        ))]
98        #[cfg(target_os = "macos")]
99        #[unsafe(method(initWithInkType:color:width:identifier:))]
100        #[unsafe(method_family = init)]
101        pub unsafe fn initWithInkType_color_width_identifier(
102            this: Allocated<Self>,
103            ink_type: &PKInkType,
104            color: &NSColor,
105            width: CGFloat,
106            identifier: Option<&NSString>,
107        ) -> Retained<Self>;
108
109        #[cfg(all(
110            feature = "PKInkType",
111            feature = "objc2-app-kit",
112            feature = "objc2-core-foundation"
113        ))]
114        #[cfg(target_os = "macos")]
115        #[unsafe(method(initWithInkType:color:width:azimuth:identifier:))]
116        #[unsafe(method_family = init)]
117        pub unsafe fn initWithInkType_color_width_azimuth_identifier(
118            this: Allocated<Self>,
119            ink_type: &PKInkType,
120            color: &NSColor,
121            width: CGFloat,
122            azimuth: CGFloat,
123            identifier: Option<&NSString>,
124        ) -> Retained<Self>;
125
126        #[cfg(all(feature = "PKInkingTool", feature = "PKTool"))]
127        /// A tool for drawing on a `PKCanvasView`.
128        #[unsafe(method(inkingTool))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn inkingTool(&self) -> Retained<PKInkingTool>;
131
132        /// Present color selection UI to the user.
133        /// Default value is YES.
134        #[unsafe(method(allowsColorSelection))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn allowsColorSelection(&self) -> bool;
137
138        /// Setter for [`allowsColorSelection`][Self::allowsColorSelection].
139        #[unsafe(method(setAllowsColorSelection:))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn setAllowsColorSelection(&self, allows_color_selection: bool);
142    );
143}
144
145/// Methods declared on superclass `PKToolPickerItem`.
146#[cfg(feature = "PKToolPickerItem")]
147impl PKToolPickerInkingItem {
148    extern_methods!(
149        #[unsafe(method(init))]
150        #[unsafe(method_family = init)]
151        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
152    );
153}
154
155/// Methods declared on superclass `NSObject`.
156#[cfg(feature = "PKToolPickerItem")]
157impl PKToolPickerInkingItem {
158    extern_methods!(
159        #[unsafe(method(new))]
160        #[unsafe(method_family = new)]
161        pub unsafe fn new() -> Retained<Self>;
162    );
163}