//! 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 crate::*;

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

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

#[cfg(feature = "UIFeedbackGenerator")]
impl UICanvasFeedbackGenerator {
    extern_methods!(
        #[cfg(feature = "objc2-core-foundation")]
        /// Provide user feedback that an alignment occured, such as snapping to a guide or ruler.
        /// - Parameter location: The location in the feedback's view where the alignment occured.
        #[unsafe(method(alignmentOccurredAtLocation:))]
        #[unsafe(method_family = none)]
        pub fn alignmentOccurredAtLocation(&self, location: CGPoint);

        #[cfg(feature = "objc2-core-foundation")]
        /// Provide user feedback that a path has been completed and/or recognized.
        /// Can be used for things like path drawing and shape recognition.
        /// - Parameter location: The location in the feedback's view where the completion occured.
        #[unsafe(method(pathCompletedAtLocation:))]
        #[unsafe(method_family = none)]
        pub fn pathCompletedAtLocation(&self, location: CGPoint);
    );
}

/// Methods declared on superclass `UIFeedbackGenerator`.
#[cfg(feature = "UIFeedbackGenerator")]
impl UICanvasFeedbackGenerator {
    extern_methods!(
        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
        /// initalize the generator with a view to attach it to the provided view as an interaction.
        #[unsafe(method(feedbackGeneratorForView:))]
        #[unsafe(method_family = none)]
        pub fn feedbackGeneratorForView(view: &UIView) -> Retained<Self>;

        #[deprecated]
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

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