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

use crate::*;

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

#[cfg(all(
    feature = "UINavigationController",
    feature = "UIResponder",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl NSCoding for UIVideoEditorController {}
);

#[cfg(all(
    feature = "UINavigationController",
    feature = "UIResponder",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl NSObjectProtocol for UIVideoEditorController {}
);

#[cfg(all(
    feature = "UIAppearance",
    feature = "UINavigationController",
    feature = "UIResponder",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl UIAppearanceContainer for UIVideoEditorController {}
);

#[cfg(all(
    feature = "UINavigationController",
    feature = "UIResponder",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl UIContentContainer for UIVideoEditorController {}
);

#[cfg(all(
    feature = "UIFocus",
    feature = "UINavigationController",
    feature = "UIResponder",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl UIFocusEnvironment for UIVideoEditorController {}
);

#[cfg(all(
    feature = "UINavigationController",
    feature = "UIResponder",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl UIResponderStandardEditActions for UIVideoEditorController {}
);

#[cfg(all(
    feature = "UINavigationController",
    feature = "UIResponder",
    feature = "UITraitCollection",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl UITraitEnvironment for UIVideoEditorController {}
);

#[cfg(all(
    feature = "UINavigationController",
    feature = "UIResponder",
    feature = "UIViewController"
))]
impl UIVideoEditorController {
    extern_methods!(
        #[unsafe(method(canEditVideoAtPath:))]
        #[unsafe(method_family = none)]
        pub fn canEditVideoAtPath(video_path: &NSString, mtm: MainThreadMarker) -> bool;

        /// # Safety
        ///
        /// This is not retained internally, you must ensure the object is still alive.
        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<
            Retained<
                AnyObject, /* UINavigationControllerDelegate+ UIVideoEditorControllerDelegate */
            >,
        >;

        /// Setter for [`delegate`][Self::delegate].
        ///
        /// # Safety
        ///
        /// - `delegate` should be of the correct type.
        /// - This is unretained, you must ensure the object is kept alive while in use.
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<
                &AnyObject, /* UINavigationControllerDelegate+ UIVideoEditorControllerDelegate */
            >,
        );

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

        /// Setter for [`videoPath`][Self::videoPath].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setVideoPath:))]
        #[unsafe(method_family = none)]
        pub fn setVideoPath(&self, video_path: &NSString);

        #[unsafe(method(videoMaximumDuration))]
        #[unsafe(method_family = none)]
        pub fn videoMaximumDuration(&self) -> NSTimeInterval;

        /// Setter for [`videoMaximumDuration`][Self::videoMaximumDuration].
        #[unsafe(method(setVideoMaximumDuration:))]
        #[unsafe(method_family = none)]
        pub fn setVideoMaximumDuration(&self, video_maximum_duration: NSTimeInterval);

        #[cfg(feature = "UIImagePickerController")]
        #[unsafe(method(videoQuality))]
        #[unsafe(method_family = none)]
        pub fn videoQuality(&self) -> UIImagePickerControllerQualityType;

        #[cfg(feature = "UIImagePickerController")]
        /// Setter for [`videoQuality`][Self::videoQuality].
        #[unsafe(method(setVideoQuality:))]
        #[unsafe(method_family = none)]
        pub fn setVideoQuality(&self, video_quality: UIImagePickerControllerQualityType);
    );
}

/// Methods declared on superclass `UINavigationController`.
#[cfg(all(
    feature = "UINavigationController",
    feature = "UIResponder",
    feature = "UIViewController"
))]
impl UIVideoEditorController {
    extern_methods!(
        /// # Safety
        ///
        /// - `navigation_bar_class` probably has further requirements.
        /// - `toolbar_class` probably has further requirements.
        #[unsafe(method(initWithNavigationBarClass:toolbarClass:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithNavigationBarClass_toolbarClass(
            this: Allocated<Self>,
            navigation_bar_class: Option<&AnyClass>,
            toolbar_class: Option<&AnyClass>,
        ) -> Retained<Self>;

        #[unsafe(method(initWithRootViewController:))]
        #[unsafe(method_family = init)]
        pub fn initWithRootViewController(
            this: Allocated<Self>,
            root_view_controller: &UIViewController,
        ) -> Retained<Self>;

        #[unsafe(method(initWithNibName:bundle:))]
        #[unsafe(method_family = init)]
        pub fn initWithNibName_bundle(
            this: Allocated<Self>,
            nib_name_or_nil: Option<&NSString>,
            nib_bundle_or_nil: Option<&NSBundle>,
        ) -> Retained<Self>;

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

/// Methods declared on superclass `NSObject`.
#[cfg(all(
    feature = "UINavigationController",
    feature = "UIResponder",
    feature = "UIViewController"
))]
impl UIVideoEditorController {
    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_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uivideoeditorcontrollerdelegate?language=objc)
    pub unsafe trait UIVideoEditorControllerDelegate:
        NSObjectProtocol + MainThreadOnly
    {
        #[cfg(all(
            feature = "UINavigationController",
            feature = "UIResponder",
            feature = "UIViewController"
        ))]
        #[optional]
        #[unsafe(method(videoEditorController:didSaveEditedVideoToPath:))]
        #[unsafe(method_family = none)]
        fn videoEditorController_didSaveEditedVideoToPath(
            &self,
            editor: &UIVideoEditorController,
            edited_video_path: &NSString,
        );

        #[cfg(all(
            feature = "UINavigationController",
            feature = "UIResponder",
            feature = "UIViewController"
        ))]
        #[optional]
        #[unsafe(method(videoEditorController:didFailWithError:))]
        #[unsafe(method_family = none)]
        fn videoEditorController_didFailWithError(
            &self,
            editor: &UIVideoEditorController,
            error: &NSError,
        );

        #[cfg(all(
            feature = "UINavigationController",
            feature = "UIResponder",
            feature = "UIViewController"
        ))]
        #[optional]
        #[unsafe(method(videoEditorControllerDidCancel:))]
        #[unsafe(method_family = none)]
        fn videoEditorControllerDidCancel(&self, editor: &UIVideoEditorController);
    }
);
