-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIBroker.cs
More file actions
186 lines (155 loc) · 7.12 KB
/
Copy pathIBroker.cs
File metadata and controls
186 lines (155 loc) · 7.12 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
using System;
using Vatsim.Xpilot.PluginSdk.Events;
using Vatsim.Xpilot.PluginSdk.Exceptions;
namespace Vatsim.Xpilot.PluginSdk;
/// <summary>
/// The xPilot plugin broker interface. Provides events and methods for interacting with xPilot.
/// </summary>
public interface IBroker
{
/// <summary>
/// Raised when the xPilot window is about to close.
/// </summary>
public event EventHandler? SessionEnded;
/// <summary>
/// Raised when a connection to the VATSIM network has been established.
/// </summary>
public event EventHandler<NetworkConnectedEventArgs>? NetworkConnected;
/// <summary>
/// Raised when the VATSIM network connection has been closed.
/// </summary>
public event EventHandler? NetworkDisconnected;
/// <summary>
/// Raised when a private message arrives.
/// </summary>
public event EventHandler<PrivateMessageReceivedEventArgs>? PrivateMessageReceived;
/// <summary>
/// Raised when a text radio message arrives.
/// </summary>
public event EventHandler<RadioMessageReceivedEventArgs>? RadioMessageReceived;
/// <summary>
/// Raised when a broadcast message arrives.
/// </summary>
public event EventHandler<BroadcastMessageReceivedEventArgs>? BroadcastMessageReceived;
/// <summary>
/// Raised when a text radio message is sent by the user.
/// </summary>
public event EventHandler<RadioMessageSentEventArgs>? RadioMessageSent;
/// <summary>
/// Raised when a private message is sent by the user.
/// </summary>
public event EventHandler<PrivateMessageSentEventArgs>? PrivateMessageSent;
/// <summary>
/// Raised when a METAR is received.
/// </summary>
public event EventHandler<MetarReceivedEventArgs>? MetarReceived;
/// <summary>
/// Raised when a text ATIS (a.k.a. 'controller info') is received.
/// </summary>
public event EventHandler<AtisReceivedEventArgs>? AtisReceived;
/// <summary>
/// Raised when a new controller is encountered.
/// </summary>
public event EventHandler<ControllerAddedEventArgs>? ControllerAdded;
/// <summary>
/// Raised when a controller is deleted.
/// </summary>
public event EventHandler<ControllerDeletedEventArgs>? ControllerDeleted;
/// <summary>
/// Raised when a controller changes to a new primary frequency.
/// </summary>
public event EventHandler<ControllerFrequencyChangedEventArgs>? ControllerFrequencyChanged;
/// <summary>
/// Raised when a controller moves to a new location.
/// </summary>
public event EventHandler<ControllerLocationChangedEventArgs>? ControllerLocationChanged;
/// <summary>
/// Raised when a SELCAL alert is received.
/// </summary>
public event EventHandler<SelcalAlertReceivedEventArgs>? SelcalAlertReceived;
/// <summary>
/// Raised when an aircraft is added to the simulator session.
/// </summary>
public event EventHandler<AircraftAddedEventArgs>? AircraftAdded;
/// <summary>
/// Raised when an aircraft position is updated.
/// </summary>
public event EventHandler<AircraftUpdatedEventArgs>? AircraftUpdated;
/// <summary>
/// Raised when an aircraft is deleted from the simulator session.
/// </summary>
public event EventHandler<AircraftDeletedEventArgs>? AircraftDeleted;
/// <summary>
/// Request connection to the network as a pilot.
/// </summary>
/// <param name="callsign">The callsign to use for the session. (Required)</param>
/// <param name="typeCode">The ICAO aircraft type code. (Required)</param>
/// <param name="selcalCode">The SELCAL code. (Optional; leave empty or null for none.)</param>
/// <exception cref="AlreadyConnectedException">Thrown when already connected to the network.</exception>
/// <exception cref="SimNotReadyException">Thrown when the simulator is not connected.</exception>
public void RequestConnect(string callsign, string typeCode, string selcalCode);
/// <summary>
/// Request connection to the network as an observer.
/// </summary>
/// <param name="callsign">The callsign to use for the session. (Required)</param>
/// <exception cref="AlreadyConnectedException">Thrown when already connected to the network.</exception>
/// <exception cref="SimNotReadyException">Thrown when the simulator is not connected.</exception>
public void RequestConnectAsObserver(string callsign);
/// <summary>
/// Request connection to the network as a tower view observer.
/// </summary>
/// <exception cref="AlreadyConnectedException">Thrown when already connected to the network.</exception>
/// <exception cref="SimNotReadyException">Thrown when the simulator is not connected.</exception>
public void RequestConnectAsTowerView();
/// <summary>
/// Request disconnection from the network.
/// </summary>
public void RequestDisconnect();
/// <summary>
/// Request retrieval of METAR for a station.
/// </summary>
/// <param name="station">The station (airport) for which to request the METAR.</param>
/// <exception cref="NotConnectedException">Thrown when not connected to the network.</exception>
public void RequestMetar(string station);
/// <summary>
/// Request controller ATIS information.
/// </summary>
/// <param name="callsign">The callsign of the controller.</param>
/// <exception cref="NotConnectedException">Thrown when not connected to the network.</exception>
public void RequestAtis(string callsign);
/// <summary>
/// Send a private message.
/// </summary>
/// <param name="to">The recipient of the private message.</param>
/// <param name="message">The message contents.</param>
/// <exception cref="NotConnectedException">Thrown when not connected to the network.</exception>
public void SendPrivateMessage(string to, string message);
/// <summary>
/// Send a textual radio message on the current transmit frequency or frequencies.
/// </summary>
/// <param name="message">The message contents.</param>
/// <exception cref="NotConnectedException">Thrown when not connected to the network.</exception>
public void SendRadioMessage(string message);
/// <summary>
/// Post a debug message to the xPilot message area.
/// </summary>
/// <param name="message">The message contents.</param>
public void PostDebugMessage(string message);
/// <summary>
/// Set mode C on or off.
/// </summary>
/// <param name="modeC">Whether or not to squawk mode C.</param>
/// <exception cref="SimNotReadyException">Thrown when the simulator is not connected.</exception>
public void SetModeC(bool modeC);
/// <summary>
/// Squawk ident.
/// </summary>
/// <exception cref="SimNotReadyException">Thrown when the simulator is not connected.</exception>
public void SquawkIdent();
/// <summary>
/// Set Push-To-Talk on or off.
/// </summary>
/// <param name="pressed">Whether or not Push-To-Talk is pressed.</param>
/// <exception cref="NotConnectedException">Thrown when not connected to the network.</exception>
public void SetPtt(bool pressed);
}