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

use crate::*;

extern_class!(
    /// Use this class to express iOS-specific geometry preferences when calling `-[UIWindowScene requestGeometryUpdateWithPreferences:errorHandler:]`
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwindowscenegeometrypreferencesios?language=objc)
    #[unsafe(super(UIWindowSceneGeometryPreferences, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "UIWindowSceneGeometryPreferences")]
    pub struct UIWindowSceneGeometryPreferencesIOS;
);

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

#[cfg(feature = "UIWindowSceneGeometryPreferences")]
impl UIWindowSceneGeometryPreferencesIOS {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "UIOrientation")]
        #[unsafe(method(initWithInterfaceOrientations:))]
        #[unsafe(method_family = init)]
        pub fn initWithInterfaceOrientations(
            this: Allocated<Self>,
            interface_orientations: UIInterfaceOrientationMask,
        ) -> Retained<Self>;

        #[cfg(feature = "UIOrientation")]
        /// The preferred interface orientations. The system will choose the best orientation from the intersection of these
        /// orientations and the current supported orientations. Defaults to an empty mask to indicate no preference.
        #[unsafe(method(interfaceOrientations))]
        #[unsafe(method_family = none)]
        pub fn interfaceOrientations(&self) -> UIInterfaceOrientationMask;

        #[cfg(feature = "UIOrientation")]
        /// Setter for [`interfaceOrientations`][Self::interfaceOrientations].
        #[unsafe(method(setInterfaceOrientations:))]
        #[unsafe(method_family = none)]
        pub fn setInterfaceOrientations(&self, interface_orientations: UIInterfaceOrientationMask);
    );
}

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