//! 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::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowlevel?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
#[cfg(feature = "objc2-core-foundation")]
pub type UIWindowLevel = CGFloat;

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

#[cfg(all(
    feature = "UIResponder",
    feature = "UIView",
    feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
extern_conformance!(
    unsafe impl CALayerDelegate for UIWindow {}
);

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

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

#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIAppearance for UIWindow {}
);

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

#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UICoordinateSpace for UIWindow {}
);

#[cfg(all(
    feature = "UIDynamicBehavior",
    feature = "UIResponder",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UIDynamicItem for UIWindow {}
);

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

#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIFocusItem for UIWindow {}
);

#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIFocusItemContainer for UIWindow {}
);

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

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

#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UIWindow {
    extern_methods!(
        #[cfg(all(feature = "UIScene", feature = "UIWindowScene"))]
        #[unsafe(method(initWithWindowScene:))]
        #[unsafe(method_family = init)]
        pub fn initWithWindowScene(
            this: Allocated<Self>,
            window_scene: &UIWindowScene,
        ) -> Retained<Self>;

        #[cfg(feature = "objc2-core-foundation")]
        #[deprecated = "Use init(windowScene:) instead."]
        #[unsafe(method(initWithFrame:))]
        #[unsafe(method_family = init)]
        pub fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;

        #[deprecated = "Use init(windowScene:) instead."]
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(all(feature = "UIScene", feature = "UIWindowScene"))]
        #[unsafe(method(windowScene))]
        #[unsafe(method_family = none)]
        pub fn windowScene(&self) -> Option<Retained<UIWindowScene>>;

        #[cfg(all(feature = "UIScene", feature = "UIWindowScene"))]
        /// Setter for [`windowScene`][Self::windowScene].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[unsafe(method(setWindowScene:))]
        #[unsafe(method_family = none)]
        pub fn setWindowScene(&self, window_scene: Option<&UIWindowScene>);

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

        /// Setter for [`canResizeToFitContent`][Self::canResizeToFitContent].
        #[unsafe(method(setCanResizeToFitContent:))]
        #[unsafe(method_family = none)]
        pub fn setCanResizeToFitContent(&self, can_resize_to_fit_content: bool);

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

        #[cfg(feature = "UIScreen")]
        /// Setter for [`screen`][Self::screen].
        #[unsafe(method(setScreen:))]
        #[unsafe(method_family = none)]
        pub fn setScreen(&self, screen: &UIScreen);

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

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`windowLevel`][Self::windowLevel].
        #[unsafe(method(setWindowLevel:))]
        #[unsafe(method_family = none)]
        pub fn setWindowLevel(&self, window_level: UIWindowLevel);

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

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

        #[unsafe(method(becomeKeyWindow))]
        #[unsafe(method_family = none)]
        pub fn becomeKeyWindow(&self);

        #[unsafe(method(resignKeyWindow))]
        #[unsafe(method_family = none)]
        pub fn resignKeyWindow(&self);

        #[unsafe(method(makeKeyWindow))]
        #[unsafe(method_family = none)]
        pub fn makeKeyWindow(&self);

        #[unsafe(method(makeKeyAndVisible))]
        #[unsafe(method_family = none)]
        pub fn makeKeyAndVisible(&self);

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

        #[cfg(feature = "UIViewController")]
        /// Setter for [`rootViewController`][Self::rootViewController].
        #[unsafe(method(setRootViewController:))]
        #[unsafe(method_family = none)]
        pub fn setRootViewController(&self, root_view_controller: Option<&UIViewController>);

        #[cfg(feature = "UIEvent")]
        #[unsafe(method(sendEvent:))]
        #[unsafe(method_family = none)]
        pub fn sendEvent(&self, event: &UIEvent);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(convertPoint:toWindow:))]
        #[unsafe(method_family = none)]
        pub fn convertPoint_toWindow(&self, point: CGPoint, window: Option<&UIWindow>) -> CGPoint;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(convertPoint:fromWindow:))]
        #[unsafe(method_family = none)]
        pub fn convertPoint_fromWindow(&self, point: CGPoint, window: Option<&UIWindow>)
            -> CGPoint;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(convertRect:toWindow:))]
        #[unsafe(method_family = none)]
        pub fn convertRect_toWindow(&self, rect: CGRect, window: Option<&UIWindow>) -> CGRect;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(convertRect:fromWindow:))]
        #[unsafe(method_family = none)]
        pub fn convertRect_fromWindow(&self, rect: CGRect, window: Option<&UIWindow>) -> CGRect;
    );
}

/// Methods declared on superclass `UIView`.
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UIWindow {
    extern_methods!(
        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UIWindow {
    extern_methods!(
        #[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/uilayoutguideaspectfitting?language=objc)
    pub unsafe trait UILayoutGuideAspectFitting: NSObjectProtocol {
        #[cfg(feature = "objc2-core-foundation")]
        /// Update the aspect ratio (width / height) for the given content
        /// Defaults to 1.0. Must be > 0.0 and values may be clamped within a reasonable range of approximately 1:100 to 100:1.
        #[unsafe(method(aspectRatio))]
        #[unsafe(method_family = none)]
        fn aspectRatio(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`aspectRatio`][Self::aspectRatio].
        #[unsafe(method(setAspectRatio:))]
        #[unsafe(method_family = none)]
        fn setAspectRatio(&self, aspect_ratio: CGFloat);
    }
);

/// UIWindowLayout.
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UIWindow {
    extern_methods!(
        #[cfg(feature = "UILayoutGuide")]
        /// This layout guide is designed specifically for full-screen media content, and attaching constraints from deep in the window's view hierarchy will raise an exception.
        ///
        /// This guide provides a layout area for placing media content of a given aspect ratio (width over height) such that the content will be completely visible within the window.
        /// Compared to the standard `safeAreaLayoutGuide` on a view, this guide takes into account the aspect ratio of the content, allowing it the maximum size within the window's
        /// true safe area, including the actual shape of the screen when that is the only factor contributing to the safe area. The rect defined by this guide will be centered within the
        /// window.
        ///
        /// This layout guide should only be used for fixed aspect ratio content that is intended to fill the window (such as image or video content) and is not a replacement for the
        /// standard `safeAreaLayoutGuide` on each UIView which should be used for most content layout. The `safeAreaAspectFitLayoutGuide` should only be used with views
        /// that are direct subviews of, or very close descendants of, the guide's window. Creating constraints from this layout guide to views deeper in the view hierarchy or across
        /// views owned by child view controllers can significantly degrade performance and possibly raise an exception. Additionally, the safe area insets added by child view
        /// controllers will not be reflected in these cases. For anything other than full-screen/window media content, the standard `safeAreaLayoutGuide` on UIView should be used.
        #[unsafe(method(safeAreaAspectFitLayoutGuide))]
        #[unsafe(method_family = none)]
        pub fn safeAreaAspectFitLayoutGuide(&self) -> Retained<UILayoutGuide>;
    );
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowlevelnormal?language=objc)
    #[cfg(feature = "objc2-core-foundation")]
    pub static UIWindowLevelNormal: UIWindowLevel;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowlevelalert?language=objc)
    #[cfg(feature = "objc2-core-foundation")]
    pub static UIWindowLevelAlert: UIWindowLevel;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowlevelstatusbar?language=objc)
    #[cfg(feature = "objc2-core-foundation")]
    pub static UIWindowLevelStatusBar: UIWindowLevel;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowdidbecomevisiblenotification?language=objc)
    pub static UIWindowDidBecomeVisibleNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowdidbecomehiddennotification?language=objc)
    pub static UIWindowDidBecomeHiddenNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowdidbecomekeynotification?language=objc)
    pub static UIWindowDidBecomeKeyNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowdidresignkeynotification?language=objc)
    pub static UIWindowDidResignKeyNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyboardwillshownotification?language=objc)
    pub static UIKeyboardWillShowNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyboarddidshownotification?language=objc)
    pub static UIKeyboardDidShowNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyboardwillhidenotification?language=objc)
    pub static UIKeyboardWillHideNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyboarddidhidenotification?language=objc)
    pub static UIKeyboardDidHideNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyboardframebeginuserinfokey?language=objc)
    pub static UIKeyboardFrameBeginUserInfoKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyboardframeenduserinfokey?language=objc)
    pub static UIKeyboardFrameEndUserInfoKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyboardanimationdurationuserinfokey?language=objc)
    pub static UIKeyboardAnimationDurationUserInfoKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyboardanimationcurveuserinfokey?language=objc)
    pub static UIKeyboardAnimationCurveUserInfoKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyboardislocaluserinfokey?language=objc)
    pub static UIKeyboardIsLocalUserInfoKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyboardwillchangeframenotification?language=objc)
    pub static UIKeyboardWillChangeFrameNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyboarddidchangeframenotification?language=objc)
    pub static UIKeyboardDidChangeFrameNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyboardcenterbeginuserinfokey?language=objc)
    #[deprecated]
    pub static UIKeyboardCenterBeginUserInfoKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyboardcenterenduserinfokey?language=objc)
    #[deprecated]
    pub static UIKeyboardCenterEndUserInfoKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyboardboundsuserinfokey?language=objc)
    #[deprecated]
    pub static UIKeyboardBoundsUserInfoKey: &'static NSString;
}
