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

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

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

#[cfg(feature = "UIFeedbackGenerator")]
impl UISelectionFeedbackGenerator {
    extern_methods!(
        /// call when the selection changes (not on initial selection)
        #[unsafe(method(selectionChanged))]
        #[unsafe(method_family = none)]
        pub fn selectionChanged(&self);

        #[cfg(feature = "objc2-core-foundation")]
        /// call when the selection changes (not on initial selection)
        /// provide the location in the `view` the change occured at
        #[unsafe(method(selectionChangedAtLocation:))]
        #[unsafe(method_family = none)]
        pub fn selectionChangedAtLocation(&self, location: CGPoint);
    );
}

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