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

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscollectionviewtransitionlayoutanimatedkey?language=objc)
pub type NSCollectionViewTransitionLayoutAnimatedKey = NSString;

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

#[cfg(feature = "NSCollectionViewLayout")]
extern_conformance!(
    unsafe impl NSCoding for NSCollectionViewTransitionLayout {}
);

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

#[cfg(feature = "NSCollectionViewLayout")]
impl NSCollectionViewTransitionLayout {
    extern_methods!(
        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(transitionProgress))]
        #[unsafe(method_family = none)]
        pub fn transitionProgress(&self) -> CGFloat;

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

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

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

        #[unsafe(method(initWithCurrentLayout:nextLayout:))]
        #[unsafe(method_family = init)]
        pub fn initWithCurrentLayout_nextLayout(
            this: Allocated<Self>,
            current_layout: &NSCollectionViewLayout,
            new_layout: &NSCollectionViewLayout,
        ) -> Retained<Self>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(updateValue:forAnimatedKey:))]
        #[unsafe(method_family = none)]
        pub fn updateValue_forAnimatedKey(
            &self,
            value: CGFloat,
            key: &NSCollectionViewTransitionLayoutAnimatedKey,
        );

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(valueForAnimatedKey:))]
        #[unsafe(method_family = none)]
        pub fn valueForAnimatedKey(
            &self,
            key: &NSCollectionViewTransitionLayoutAnimatedKey,
        ) -> CGFloat;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "NSCollectionViewLayout")]
impl NSCollectionViewTransitionLayout {
    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>;
    );
}