objc2-ui-kit 0.3.2

Bindings to the UIKit 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-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uipastecontroldisplaymode?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIPasteControlDisplayMode(pub NSUInteger);
impl UIPasteControlDisplayMode {
    #[doc(alias = "UIPasteControlDisplayModeIconAndLabel")]
    pub const IconAndLabel: Self = Self(0);
    #[doc(alias = "UIPasteControlDisplayModeIconOnly")]
    pub const IconOnly: Self = Self(1);
    #[doc(alias = "UIPasteControlDisplayModeLabelOnly")]
    pub const LabelOnly: Self = Self(2);
    #[doc(alias = "UIPasteControlDisplayModeArrowAndLabel")]
    pub const ArrowAndLabel: Self = Self(3);
}

unsafe impl Encode for UIPasteControlDisplayMode {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for UIPasteControlDisplayMode {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

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

extern_conformance!(
    unsafe impl NSCoding for UIPasteControlConfiguration {}
);

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

extern_conformance!(
    unsafe impl NSSecureCoding for UIPasteControlConfiguration {}
);

impl UIPasteControlConfiguration {
    extern_methods!(
        #[unsafe(method(displayMode))]
        #[unsafe(method_family = none)]
        pub fn displayMode(&self) -> UIPasteControlDisplayMode;

        /// Setter for [`displayMode`][Self::displayMode].
        #[unsafe(method(setDisplayMode:))]
        #[unsafe(method_family = none)]
        pub fn setDisplayMode(&self, display_mode: UIPasteControlDisplayMode);

        #[cfg(feature = "UIButtonConfiguration")]
        #[unsafe(method(cornerStyle))]
        #[unsafe(method_family = none)]
        pub fn cornerStyle(&self) -> UIButtonConfigurationCornerStyle;

        #[cfg(feature = "UIButtonConfiguration")]
        /// Setter for [`cornerStyle`][Self::cornerStyle].
        #[unsafe(method(setCornerStyle:))]
        #[unsafe(method_family = none)]
        pub fn setCornerStyle(&self, corner_style: UIButtonConfigurationCornerStyle);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(cornerRadius))]
        #[unsafe(method_family = none)]
        pub fn cornerRadius(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`cornerRadius`][Self::cornerRadius].
        #[unsafe(method(setCornerRadius:))]
        #[unsafe(method_family = none)]
        pub fn setCornerRadius(&self, corner_radius: CGFloat);

        #[cfg(feature = "UIGeometry")]
        #[unsafe(method(imagePlacement))]
        #[unsafe(method_family = none)]
        pub fn imagePlacement(&self) -> NSDirectionalRectEdge;

        #[cfg(feature = "UIGeometry")]
        /// Setter for [`imagePlacement`][Self::imagePlacement].
        #[unsafe(method(setImagePlacement:))]
        #[unsafe(method_family = none)]
        pub fn setImagePlacement(&self, image_placement: NSDirectionalRectEdge);

        #[cfg(feature = "UIColor")]
        #[unsafe(method(baseForegroundColor))]
        #[unsafe(method_family = none)]
        pub fn baseForegroundColor(&self) -> Option<Retained<UIColor>>;

        #[cfg(feature = "UIColor")]
        /// Setter for [`baseForegroundColor`][Self::baseForegroundColor].
        #[unsafe(method(setBaseForegroundColor:))]
        #[unsafe(method_family = none)]
        pub fn setBaseForegroundColor(&self, base_foreground_color: Option<&UIColor>);

        #[cfg(feature = "UIColor")]
        #[unsafe(method(baseBackgroundColor))]
        #[unsafe(method_family = none)]
        pub fn baseBackgroundColor(&self) -> Option<Retained<UIColor>>;

        #[cfg(feature = "UIColor")]
        /// Setter for [`baseBackgroundColor`][Self::baseBackgroundColor].
        #[unsafe(method(setBaseBackgroundColor:))]
        #[unsafe(method_family = none)]
        pub fn setBaseBackgroundColor(&self, base_background_color: Option<&UIColor>);
    );
}

/// Methods declared on superclass `NSObject`.
impl UIPasteControlConfiguration {
    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(mtm: MainThreadMarker) -> Retained<Self>;
    );
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uipastecontrol?language=objc)
    #[unsafe(super(UIControl, UIView, UIResponder, NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
    pub struct UIPasteControl;
);

#[cfg(all(
    feature = "UIControl",
    feature = "UIResponder",
    feature = "UIView",
    feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
extern_conformance!(
    unsafe impl CALayerDelegate for UIPasteControl {}
);

#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl NSCoding for UIPasteControl {}
);

#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl NSObjectProtocol for UIPasteControl {}
);

#[cfg(all(
    feature = "UIAppearance",
    feature = "UIControl",
    feature = "UIResponder",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UIAppearance for UIPasteControl {}
);

#[cfg(all(
    feature = "UIAppearance",
    feature = "UIControl",
    feature = "UIResponder",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UIAppearanceContainer for UIPasteControl {}
);

#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UICoordinateSpace for UIPasteControl {}
);

#[cfg(all(
    feature = "UIControl",
    feature = "UIDynamicBehavior",
    feature = "UIResponder",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UIDynamicItem for UIPasteControl {}
);

#[cfg(all(
    feature = "UIControl",
    feature = "UIFocus",
    feature = "UIResponder",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UIFocusEnvironment for UIPasteControl {}
);

#[cfg(all(
    feature = "UIControl",
    feature = "UIFocus",
    feature = "UIResponder",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UIFocusItem for UIPasteControl {}
);

#[cfg(all(
    feature = "UIControl",
    feature = "UIFocus",
    feature = "UIResponder",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UIFocusItemContainer for UIPasteControl {}
);

#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIResponderStandardEditActions for UIPasteControl {}
);

#[cfg(all(
    feature = "UIControl",
    feature = "UIResponder",
    feature = "UITraitCollection",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UITraitEnvironment for UIPasteControl {}
);

#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
impl UIPasteControl {
    extern_methods!(
        #[unsafe(method(configuration))]
        #[unsafe(method_family = none)]
        pub fn configuration(&self) -> Retained<UIPasteControlConfiguration>;

        #[cfg(feature = "UIPasteConfigurationSupporting")]
        #[unsafe(method(target))]
        #[unsafe(method_family = none)]
        pub fn target(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn UIPasteConfigurationSupporting>>>;

        #[cfg(feature = "UIPasteConfigurationSupporting")]
        /// Setter for [`target`][Self::target].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[unsafe(method(setTarget:))]
        #[unsafe(method_family = none)]
        pub fn setTarget(
            &self,
            target: Option<&ProtocolObject<dyn UIPasteConfigurationSupporting>>,
        );

        #[unsafe(method(initWithConfiguration:))]
        #[unsafe(method_family = init)]
        pub fn initWithConfiguration(
            this: Allocated<Self>,
            configuration: &UIPasteControlConfiguration,
        ) -> Retained<Self>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(initWithFrame:))]
        #[unsafe(method_family = init)]
        pub fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
    );
}

/// Methods declared on superclass `UIControl`.
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
impl UIPasteControl {
    extern_methods!(
        #[cfg(all(
            feature = "UIAction",
            feature = "UIMenuElement",
            feature = "objc2-core-foundation"
        ))]
        /// Initializes the control and adds primaryAction for the UIControlEventPrimaryActionTriggered control event. Subclasses of UIControl may alter or add behaviors around the usage of primaryAction, see subclass documentation of this initializer for additional information.
        #[unsafe(method(initWithFrame:primaryAction:))]
        #[unsafe(method_family = init)]
        pub fn initWithFrame_primaryAction(
            this: Allocated<Self>,
            frame: CGRect,
            primary_action: Option<&UIAction>,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `UIView`.
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
impl UIPasteControl {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
impl UIPasteControl {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}