1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//! 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_protocol!(
/// Delegate object for VZVirtioConsoleDevice.
///
/// A class conforming to the VZVirtioConsoleDeviceDelegate protocol can provide methods that notify when a console port is opened or closed in the virtual machine.
///
/// See: VZVirtioConsoleDevice
///
/// See: VZVirtioConsolePort
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzvirtioconsoledevicedelegate?language=objc)
pub unsafe trait VZVirtioConsoleDeviceDelegate: NSObjectProtocol {
#[cfg(all(feature = "VZConsoleDevice", feature = "VZVirtioConsolePort"))]
/// Invoked when a guest process has opened a Virtio console port.
///
/// Parameter `consoleDevice`: The console port's console device.
///
/// Parameter `consolePort`: The console port that has been opened.
///
/// Extra care should be taken to ensure that any pending data from the VZVirtioConsolePort attachment has been processed or flushed before communicating with a new virtual machine process.
#[optional]
#[unsafe(method(consoleDevice:didOpenPort:))]
#[unsafe(method_family = none)]
unsafe fn consoleDevice_didOpenPort(
&self,
console_device: &VZVirtioConsoleDevice,
console_port: &VZVirtioConsolePort,
);
#[cfg(all(feature = "VZConsoleDevice", feature = "VZVirtioConsolePort"))]
/// Invoked when a guest process has closed a Virtio console port.
///
/// Parameter `consoleDevice`: The console port's console device.
///
/// Parameter `consolePort`: The console port that has been closed.
///
/// It is recommended to finish processing or flushing any remaining data from the VZVirtioConsolePort attachment after a port has been closed.
#[optional]
#[unsafe(method(consoleDevice:didClosePort:))]
#[unsafe(method_family = none)]
unsafe fn consoleDevice_didClosePort(
&self,
console_device: &VZVirtioConsoleDevice,
console_port: &VZVirtioConsolePort,
);
}
);
extern_class!(
/// Class representing a Virtio console device in a virtual machine.
///
/// VZVirtioConsoleDevice should not be instantiated directly.
///
/// See: VZConsoleDeviceConfiguration
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzvirtioconsoledevice?language=objc)
#[unsafe(super(VZConsoleDevice, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "VZConsoleDevice")]
pub struct VZVirtioConsoleDevice;
);
#[cfg(feature = "VZConsoleDevice")]
extern_conformance!(
unsafe impl NSObjectProtocol for VZVirtioConsoleDevice {}
);
#[cfg(feature = "VZConsoleDevice")]
impl VZVirtioConsoleDevice {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
/// Pointer to a delegate object for the console device.
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn VZVirtioConsoleDeviceDelegate>>>;
/// Setter for [`delegate`][Self::delegate].
///
/// This is a [weak property][objc2::topics::weak_property].
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn VZVirtioConsoleDeviceDelegate>>,
);
#[cfg(feature = "VZVirtioConsolePortArray")]
/// The console ports currently being used by this console device.
#[unsafe(method(ports))]
#[unsafe(method_family = none)]
pub unsafe fn ports(&self) -> Retained<VZVirtioConsolePortArray>;
);
}