objc2_pdf_kit/generated/
PDFBorder.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-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12/// [Apple's documentation](https://developer.apple.com/documentation/pdfkit/pdfborderstyle?language=objc)
13// NS_ENUM
14#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct PDFBorderStyle(pub NSInteger);
17impl PDFBorderStyle {
18    #[doc(alias = "kPDFBorderStyleSolid")]
19    pub const Solid: Self = Self(0);
20    #[doc(alias = "kPDFBorderStyleDashed")]
21    pub const Dashed: Self = Self(1);
22    #[doc(alias = "kPDFBorderStyleBeveled")]
23    pub const Beveled: Self = Self(2);
24    #[doc(alias = "kPDFBorderStyleInset")]
25    pub const Inset: Self = Self(3);
26    #[doc(alias = "kPDFBorderStyleUnderline")]
27    pub const Underline: Self = Self(4);
28}
29
30unsafe impl Encode for PDFBorderStyle {
31    const ENCODING: Encoding = NSInteger::ENCODING;
32}
33
34unsafe impl RefEncode for PDFBorderStyle {
35    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
36}
37
38/// [Apple's documentation](https://developer.apple.com/documentation/pdfkit/pdfborderkey?language=objc)
39// NS_TYPED_ENUM
40pub type PDFBorderKey = NSString;
41
42extern "C" {
43    /// [Apple's documentation](https://developer.apple.com/documentation/pdfkit/pdfborderkeylinewidth?language=objc)
44    pub static PDFBorderKeyLineWidth: &'static PDFBorderKey;
45}
46
47extern "C" {
48    /// [Apple's documentation](https://developer.apple.com/documentation/pdfkit/pdfborderkeystyle?language=objc)
49    pub static PDFBorderKeyStyle: &'static PDFBorderKey;
50}
51
52extern "C" {
53    /// [Apple's documentation](https://developer.apple.com/documentation/pdfkit/pdfborderkeydashpattern?language=objc)
54    pub static PDFBorderKeyDashPattern: &'static PDFBorderKey;
55}
56
57extern_class!(
58    /// [Apple's documentation](https://developer.apple.com/documentation/pdfkit/pdfborder?language=objc)
59    #[unsafe(super(NSObject))]
60    #[derive(Debug, PartialEq, Eq, Hash)]
61    pub struct PDFBorder;
62);
63
64extern_conformance!(
65    unsafe impl NSCoding for PDFBorder {}
66);
67
68extern_conformance!(
69    unsafe impl NSCopying for PDFBorder {}
70);
71
72unsafe impl CopyingHelper for PDFBorder {
73    type Result = Self;
74}
75
76extern_conformance!(
77    unsafe impl NSObjectProtocol for PDFBorder {}
78);
79
80impl PDFBorder {
81    extern_methods!(
82        #[unsafe(method(style))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn style(&self) -> PDFBorderStyle;
85
86        /// Setter for [`style`][Self::style].
87        #[unsafe(method(setStyle:))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn setStyle(&self, style: PDFBorderStyle);
90
91        #[cfg(feature = "objc2-core-foundation")]
92        #[unsafe(method(lineWidth))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn lineWidth(&self) -> CGFloat;
95
96        #[cfg(feature = "objc2-core-foundation")]
97        /// Setter for [`lineWidth`][Self::lineWidth].
98        #[unsafe(method(setLineWidth:))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn setLineWidth(&self, line_width: CGFloat);
101
102        #[unsafe(method(dashPattern))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn dashPattern(&self) -> Option<Retained<NSArray>>;
105
106        /// Setter for [`dashPattern`][Self::dashPattern].
107        ///
108        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
109        ///
110        /// # Safety
111        ///
112        /// `dash_pattern` generic should be of the correct type.
113        #[unsafe(method(setDashPattern:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn setDashPattern(&self, dash_pattern: Option<&NSArray>);
116
117        #[unsafe(method(borderKeyValues))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn borderKeyValues(&self) -> Retained<NSDictionary>;
120
121        #[unsafe(method(drawInRect:))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn drawInRect(&self, rect: NSRect);
124    );
125}
126
127/// Methods declared on superclass `NSObject`.
128impl PDFBorder {
129    extern_methods!(
130        #[unsafe(method(init))]
131        #[unsafe(method_family = init)]
132        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
133
134        #[unsafe(method(new))]
135        #[unsafe(method_family = new)]
136        pub unsafe fn new() -> Retained<Self>;
137    );
138}