use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct PDFBorderStyle(pub NSInteger);
impl PDFBorderStyle {
#[doc(alias = "kPDFBorderStyleSolid")]
pub const Solid: Self = Self(0);
#[doc(alias = "kPDFBorderStyleDashed")]
pub const Dashed: Self = Self(1);
#[doc(alias = "kPDFBorderStyleBeveled")]
pub const Beveled: Self = Self(2);
#[doc(alias = "kPDFBorderStyleInset")]
pub const Inset: Self = Self(3);
#[doc(alias = "kPDFBorderStyleUnderline")]
pub const Underline: Self = Self(4);
}
unsafe impl Encode for PDFBorderStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for PDFBorderStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type PDFBorderKey = NSString;
extern "C" {
pub static PDFBorderKeyLineWidth: &'static PDFBorderKey;
}
extern "C" {
pub static PDFBorderKeyStyle: &'static PDFBorderKey;
}
extern "C" {
pub static PDFBorderKeyDashPattern: &'static PDFBorderKey;
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct PDFBorder;
);
extern_conformance!(
unsafe impl NSCoding for PDFBorder {}
);
extern_conformance!(
unsafe impl NSCopying for PDFBorder {}
);
unsafe impl CopyingHelper for PDFBorder {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for PDFBorder {}
);
impl PDFBorder {
extern_methods!(
#[unsafe(method(style))]
#[unsafe(method_family = none)]
pub unsafe fn style(&self) -> PDFBorderStyle;
#[unsafe(method(setStyle:))]
#[unsafe(method_family = none)]
pub unsafe fn setStyle(&self, style: PDFBorderStyle);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(lineWidth))]
#[unsafe(method_family = none)]
pub unsafe fn lineWidth(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setLineWidth:))]
#[unsafe(method_family = none)]
pub unsafe fn setLineWidth(&self, line_width: CGFloat);
#[unsafe(method(dashPattern))]
#[unsafe(method_family = none)]
pub unsafe fn dashPattern(&self) -> Option<Retained<NSArray>>;
#[unsafe(method(setDashPattern:))]
#[unsafe(method_family = none)]
pub unsafe fn setDashPattern(&self, dash_pattern: Option<&NSArray>);
#[unsafe(method(borderKeyValues))]
#[unsafe(method_family = none)]
pub unsafe fn borderKeyValues(&self) -> Retained<NSDictionary>;
#[unsafe(method(drawInRect:))]
#[unsafe(method_family = none)]
pub unsafe fn drawInRect(&self, rect: NSRect);
);
}
impl PDFBorder {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}