objc2-pdf-kit 0.3.2

Bindings to the PDFKit 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::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/pdfkit/pdfannotationtextwidget?language=objc)
    #[unsafe(super(PDFAnnotation, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "PDFAnnotation")]
    #[deprecated]
    pub struct PDFAnnotationTextWidget;
);

#[cfg(feature = "PDFAnnotation")]
extern_conformance!(
    unsafe impl NSCoding for PDFAnnotationTextWidget {}
);

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

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

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

#[cfg(feature = "PDFAnnotation")]
impl PDFAnnotationTextWidget {
    extern_methods!(
        #[deprecated]
        #[unsafe(method(stringValue))]
        #[unsafe(method_family = none)]
        pub unsafe fn stringValue(&self) -> Option<Retained<NSString>>;

        /// # Safety
        ///
        /// `value` might not allow `None`.
        #[deprecated]
        #[unsafe(method(setStringValue:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setStringValue(&self, value: Option<&NSString>);

        #[deprecated]
        #[unsafe(method(attributedStringValue))]
        #[unsafe(method_family = none)]
        pub unsafe fn attributedStringValue(&self) -> Option<Retained<NSAttributedString>>;

        /// # Safety
        ///
        /// `value` might not allow `None`.
        #[deprecated]
        #[unsafe(method(setAttributedStringValue:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAttributedStringValue(&self, value: Option<&NSAttributedString>);

        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        #[deprecated]
        #[unsafe(method(backgroundColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn backgroundColor(&self) -> Option<Retained<NSColor>>;

        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        /// # Safety
        ///
        /// `color` might not allow `None`.
        #[deprecated]
        #[unsafe(method(setBackgroundColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setBackgroundColor(&self, color: Option<&NSColor>);

        #[deprecated]
        #[unsafe(method(rotation))]
        #[unsafe(method_family = none)]
        pub unsafe fn rotation(&self) -> NSInteger;

        #[deprecated]
        #[unsafe(method(setRotation:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRotation(&self, rotation: c_int);

        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        #[deprecated]
        #[unsafe(method(font))]
        #[unsafe(method_family = none)]
        pub unsafe fn font(&self) -> Option<Retained<NSFont>>;

        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        /// # Safety
        ///
        /// `font` might not allow `None`.
        #[deprecated]
        #[unsafe(method(setFont:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setFont(&self, font: Option<&NSFont>);

        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        #[deprecated]
        #[unsafe(method(fontColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn fontColor(&self) -> Option<Retained<NSColor>>;

        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        /// # Safety
        ///
        /// `color` might not allow `None`.
        #[deprecated]
        #[unsafe(method(setFontColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setFontColor(&self, color: Option<&NSColor>);

        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        #[deprecated]
        #[unsafe(method(alignment))]
        #[unsafe(method_family = none)]
        pub unsafe fn alignment(&self) -> NSTextAlignment;

        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        #[deprecated]
        #[unsafe(method(setAlignment:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAlignment(&self, alignment: NSTextAlignment);

        #[deprecated]
        #[unsafe(method(maximumLength))]
        #[unsafe(method_family = none)]
        pub unsafe fn maximumLength(&self) -> NSUInteger;

        #[deprecated]
        #[unsafe(method(setMaximumLength:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMaximumLength(&self, max_len: NSUInteger);

        #[deprecated]
        #[unsafe(method(fieldName))]
        #[unsafe(method_family = none)]
        pub unsafe fn fieldName(&self) -> Option<Retained<NSString>>;

        /// # Safety
        ///
        /// `name` might not allow `None`.
        #[deprecated]
        #[unsafe(method(setFieldName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setFieldName(&self, name: Option<&NSString>);

        #[deprecated]
        #[unsafe(method(isMultiline))]
        #[unsafe(method_family = none)]
        pub unsafe fn isMultiline(&self) -> bool;

        #[deprecated]
        #[unsafe(method(setIsMultiline:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setIsMultiline(&self, multiline: bool);
    );
}

/// Methods declared on superclass `PDFAnnotation`.
#[cfg(feature = "PDFAnnotation")]
impl PDFAnnotationTextWidget {
    extern_methods!(
        /// # Safety
        ///
        /// `properties` generic should be of the correct type.
        #[unsafe(method(initWithBounds:forType:withProperties:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithBounds_forType_withProperties(
            this: Allocated<Self>,
            bounds: NSRect,
            annotation_type: &PDFAnnotationSubtype,
            properties: Option<&NSDictionary>,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "PDFAnnotation")]
impl PDFAnnotationTextWidget {
    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>;
    );
}