objc2-virtualization 0.3.2

Bindings to the Virtualization 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-app-kit")]
use objc2_app_kit::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// A view that allows user interaction with a virtual machine.
    ///
    /// The VZVirtualMachineView shows the contents of the virtual machine framebuffer. If the virtual machine configuration includes a keyboard and a pointing device,
    /// the view forwards keyboard and mouse events to the virtual machine via those devices.
    ///
    /// See also: VZVirtualMachine
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzvirtualmachineview?language=objc)
    #[unsafe(super(NSView, NSResponder, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "objc2-app-kit")]
    pub struct VZVirtualMachineView;
);

#[cfg(feature = "objc2-app-kit")]
extern_conformance!(
    unsafe impl NSAccessibility for VZVirtualMachineView {}
);

#[cfg(feature = "objc2-app-kit")]
extern_conformance!(
    unsafe impl NSAccessibilityElementProtocol for VZVirtualMachineView {}
);

#[cfg(feature = "objc2-app-kit")]
extern_conformance!(
    unsafe impl NSAnimatablePropertyContainer for VZVirtualMachineView {}
);

#[cfg(feature = "objc2-app-kit")]
extern_conformance!(
    unsafe impl NSAppearanceCustomization for VZVirtualMachineView {}
);

#[cfg(feature = "objc2-app-kit")]
extern_conformance!(
    unsafe impl NSCoding for VZVirtualMachineView {}
);

#[cfg(feature = "objc2-app-kit")]
extern_conformance!(
    unsafe impl NSDraggingDestination for VZVirtualMachineView {}
);

#[cfg(feature = "objc2-app-kit")]
extern_conformance!(
    unsafe impl NSObjectProtocol for VZVirtualMachineView {}
);

#[cfg(feature = "objc2-app-kit")]
extern_conformance!(
    unsafe impl NSUserInterfaceItemIdentification for VZVirtualMachineView {}
);

#[cfg(feature = "objc2-app-kit")]
impl VZVirtualMachineView {
    extern_methods!(
        #[cfg(feature = "VZVirtualMachine")]
        /// The virtual machine to display in the view.
        #[unsafe(method(virtualMachine))]
        #[unsafe(method_family = none)]
        pub unsafe fn virtualMachine(&self) -> Option<Retained<VZVirtualMachine>>;

        #[cfg(feature = "VZVirtualMachine")]
        /// Setter for [`virtualMachine`][Self::virtualMachine].
        #[unsafe(method(setVirtualMachine:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setVirtualMachine(&self, virtual_machine: Option<&VZVirtualMachine>);

        /// Whether certain system hot keys should be sent to the guest instead of the host. Defaults to NO.
        #[unsafe(method(capturesSystemKeys))]
        #[unsafe(method_family = none)]
        pub unsafe fn capturesSystemKeys(&self) -> bool;

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

        /// Automatically reconfigures the graphics display associated with this view with respect to view changes. Defaults to NO.
        ///
        /// Automatically resize or reconfigure this graphics display when the view properties update.
        /// For example, resizing the display when the view has a live resize operation. When enabled,
        /// the graphics display will automatically be reconfigured to match the host display environment.
        ///
        /// This property can only be set on a single VZVirtualMachineView targeting a particular VZGraphicsDisplay
        /// at a time. If multiple VZVirtualMachineViews targeting the same VZGraphicsDisplay enable this property,
        /// only one view will respect the property, and the other view will have had the property disabled.
        #[unsafe(method(automaticallyReconfiguresDisplay))]
        #[unsafe(method_family = none)]
        pub unsafe fn automaticallyReconfiguresDisplay(&self) -> bool;

        /// Setter for [`automaticallyReconfiguresDisplay`][Self::automaticallyReconfiguresDisplay].
        #[unsafe(method(setAutomaticallyReconfiguresDisplay:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAutomaticallyReconfiguresDisplay(
            &self,
            automatically_reconfigures_display: bool,
        );
    );
}

/// Methods declared on superclass `NSView`.
#[cfg(feature = "objc2-app-kit")]
impl VZVirtualMachineView {
    extern_methods!(
        #[unsafe(method(initWithFrame:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;

        /// # 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 `NSResponder`.
#[cfg(feature = "objc2-app-kit")]
impl VZVirtualMachineView {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "objc2-app-kit")]
impl VZVirtualMachineView {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}