objc2-app-kit 0.3.2

Bindings to the AppKit 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::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspressureconfiguration?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSPressureConfiguration;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for NSPressureConfiguration {}
);

impl NSPressureConfiguration {
    extern_methods!(
        #[cfg(feature = "NSEvent")]
        #[unsafe(method(pressureBehavior))]
        #[unsafe(method_family = none)]
        pub fn pressureBehavior(&self) -> NSPressureBehavior;

        #[cfg(feature = "NSEvent")]
        #[unsafe(method(initWithPressureBehavior:))]
        #[unsafe(method_family = init)]
        pub fn initWithPressureBehavior(
            this: Allocated<Self>,
            pressure_behavior: NSPressureBehavior,
        ) -> Retained<Self>;

        #[unsafe(method(set))]
        #[unsafe(method_family = none)]
        pub fn set(&self);
    );
}

/// Methods declared on superclass `NSObject`.
impl NSPressureConfiguration {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for NSPressureConfiguration {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

/// NSPressureConfiguration.
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSView {
    extern_methods!(
        #[unsafe(method(pressureConfiguration))]
        #[unsafe(method_family = none)]
        pub fn pressureConfiguration(&self) -> Option<Retained<NSPressureConfiguration>>;

        /// Setter for [`pressureConfiguration`][Self::pressureConfiguration].
        #[unsafe(method(setPressureConfiguration:))]
        #[unsafe(method_family = none)]
        pub fn setPressureConfiguration(
            &self,
            pressure_configuration: Option<&NSPressureConfiguration>,
        );
    );
}