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::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

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

extern_conformance!(
    unsafe impl NSCopying for UIPreviewTarget {}
);

unsafe impl CopyingHelper for UIPreviewTarget {
    type Result = Self;
}

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

impl UIPreviewTarget {
    extern_methods!(
        #[cfg(all(
            feature = "UIResponder",
            feature = "UIView",
            feature = "objc2-core-foundation"
        ))]
        #[unsafe(method(initWithContainer:center:transform:))]
        #[unsafe(method_family = init)]
        pub fn initWithContainer_center_transform(
            this: Allocated<Self>,
            container: &UIView,
            center: CGPoint,
            transform: CGAffineTransform,
        ) -> Retained<Self>;

        #[cfg(all(
            feature = "UIResponder",
            feature = "UIView",
            feature = "objc2-core-foundation"
        ))]
        #[unsafe(method(initWithContainer:center:))]
        #[unsafe(method_family = init)]
        pub fn initWithContainer_center(
            this: Allocated<Self>,
            container: &UIView,
            center: CGPoint,
        ) -> Retained<Self>;

        #[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(mtm: MainThreadMarker) -> Retained<Self>;

        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
        #[unsafe(method(container))]
        #[unsafe(method_family = none)]
        pub fn container(&self) -> Retained<UIView>;

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

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

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

extern_conformance!(
    unsafe impl NSCopying for UITargetedPreview {}
);

unsafe impl CopyingHelper for UITargetedPreview {
    type Result = Self;
}

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

impl UITargetedPreview {
    extern_methods!(
        #[cfg(all(
            feature = "UIPreviewParameters",
            feature = "UIResponder",
            feature = "UIView"
        ))]
        #[unsafe(method(initWithView:parameters:target:))]
        #[unsafe(method_family = init)]
        pub fn initWithView_parameters_target(
            this: Allocated<Self>,
            view: &UIView,
            parameters: &UIPreviewParameters,
            target: &UIPreviewTarget,
        ) -> Retained<Self>;

        #[cfg(all(
            feature = "UIPreviewParameters",
            feature = "UIResponder",
            feature = "UIView"
        ))]
        #[unsafe(method(initWithView:parameters:))]
        #[unsafe(method_family = init)]
        pub fn initWithView_parameters(
            this: Allocated<Self>,
            view: &UIView,
            parameters: &UIPreviewParameters,
        ) -> Retained<Self>;

        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
        #[unsafe(method(initWithView:))]
        #[unsafe(method_family = init)]
        pub fn initWithView(this: Allocated<Self>, view: &UIView) -> Retained<Self>;

        #[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(mtm: MainThreadMarker) -> Retained<Self>;

        #[unsafe(method(target))]
        #[unsafe(method_family = none)]
        pub fn target(&self) -> Retained<UIPreviewTarget>;

        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
        #[unsafe(method(view))]
        #[unsafe(method_family = none)]
        pub fn view(&self) -> Retained<UIView>;

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

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

        #[unsafe(method(retargetedPreviewWithTarget:))]
        #[unsafe(method_family = none)]
        pub unsafe fn retargetedPreviewWithTarget(
            &self,
            new_target: &UIPreviewTarget,
        ) -> Retained<UITargetedPreview>;
    );
}