objc2_virtualization/generated/
VZVirtualMachineView.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-app-kit")]
7use objc2_app_kit::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// A view that allows user interaction with a virtual machine.
14    ///
15    /// The VZVirtualMachineView shows the contents of the virtual machine framebuffer. If the virtual machine configuration includes a keyboard and a pointing device,
16    /// the view forwards keyboard and mouse events to the virtual machine via those devices.
17    ///
18    /// See also: VZVirtualMachine
19    ///
20    /// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzvirtualmachineview?language=objc)
21    #[unsafe(super(NSView, NSResponder, NSObject))]
22    #[derive(Debug, PartialEq, Eq, Hash)]
23    #[cfg(feature = "objc2-app-kit")]
24    pub struct VZVirtualMachineView;
25);
26
27#[cfg(feature = "objc2-app-kit")]
28unsafe impl NSAccessibility for VZVirtualMachineView {}
29
30#[cfg(feature = "objc2-app-kit")]
31unsafe impl NSAccessibilityElementProtocol for VZVirtualMachineView {}
32
33#[cfg(feature = "objc2-app-kit")]
34unsafe impl NSAnimatablePropertyContainer for VZVirtualMachineView {}
35
36#[cfg(feature = "objc2-app-kit")]
37unsafe impl NSAppearanceCustomization for VZVirtualMachineView {}
38
39#[cfg(feature = "objc2-app-kit")]
40unsafe impl NSCoding for VZVirtualMachineView {}
41
42#[cfg(feature = "objc2-app-kit")]
43unsafe impl NSDraggingDestination for VZVirtualMachineView {}
44
45#[cfg(feature = "objc2-app-kit")]
46unsafe impl NSObjectProtocol for VZVirtualMachineView {}
47
48#[cfg(feature = "objc2-app-kit")]
49unsafe impl NSUserInterfaceItemIdentification for VZVirtualMachineView {}
50
51#[cfg(feature = "objc2-app-kit")]
52impl VZVirtualMachineView {
53    extern_methods!(
54        #[cfg(feature = "VZVirtualMachine")]
55        /// The virtual machine to display in the view.
56        #[unsafe(method(virtualMachine))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn virtualMachine(&self) -> Option<Retained<VZVirtualMachine>>;
59
60        #[cfg(feature = "VZVirtualMachine")]
61        /// Setter for [`virtualMachine`][Self::virtualMachine].
62        #[unsafe(method(setVirtualMachine:))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn setVirtualMachine(&self, virtual_machine: Option<&VZVirtualMachine>);
65
66        /// Whether certain system hot keys should be sent to the guest instead of the host. Defaults to NO.
67        #[unsafe(method(capturesSystemKeys))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn capturesSystemKeys(&self) -> bool;
70
71        /// Setter for [`capturesSystemKeys`][Self::capturesSystemKeys].
72        #[unsafe(method(setCapturesSystemKeys:))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn setCapturesSystemKeys(&self, captures_system_keys: bool);
75
76        /// Automatically reconfigures the graphics display associated with this view with respect to view changes. Defaults to NO.
77        ///
78        /// Automatically resize or reconfigure this graphics display when the view properties update.
79        /// For example, resizing the display when the view has a live resize operation. When enabled,
80        /// the graphics display will automatically be reconfigured to match the host display environment.
81        ///
82        /// This property can only be set on a single VZVirtualMachineView targeting a particular VZGraphicsDisplay
83        /// at a time. If multiple VZVirtualMachineViews targeting the same VZGraphicsDisplay enable this property,
84        /// only one view will respect the property, and the other view will have had the property disabled.
85        #[unsafe(method(automaticallyReconfiguresDisplay))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn automaticallyReconfiguresDisplay(&self) -> bool;
88
89        /// Setter for [`automaticallyReconfiguresDisplay`][Self::automaticallyReconfiguresDisplay].
90        #[unsafe(method(setAutomaticallyReconfiguresDisplay:))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn setAutomaticallyReconfiguresDisplay(
93            &self,
94            automatically_reconfigures_display: bool,
95        );
96    );
97}
98
99/// Methods declared on superclass `NSView`.
100#[cfg(feature = "objc2-app-kit")]
101impl VZVirtualMachineView {
102    extern_methods!(
103        #[unsafe(method(initWithFrame:))]
104        #[unsafe(method_family = init)]
105        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
106
107        #[unsafe(method(initWithCoder:))]
108        #[unsafe(method_family = init)]
109        pub unsafe fn initWithCoder(
110            this: Allocated<Self>,
111            coder: &NSCoder,
112        ) -> Option<Retained<Self>>;
113    );
114}
115
116/// Methods declared on superclass `NSResponder`.
117#[cfg(feature = "objc2-app-kit")]
118impl VZVirtualMachineView {
119    extern_methods!(
120        #[unsafe(method(init))]
121        #[unsafe(method_family = init)]
122        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
123    );
124}
125
126/// Methods declared on superclass `NSObject`.
127#[cfg(feature = "objc2-app-kit")]
128impl VZVirtualMachineView {
129    extern_methods!(
130        #[unsafe(method(new))]
131        #[unsafe(method_family = new)]
132        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
133    );
134}