-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ITouchPortalEventHandler.cs
69 lines (58 loc) · 2.92 KB
/
ITouchPortalEventHandler.cs
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
using TouchPortalSDK.Messages.Events;
namespace TouchPortalSDK
{
/// <summary>
/// Interface used to register a plugin that can handle events from Touch Portal.
/// Implementation of all methods is optional.
/// </summary>
public interface ITouchPortalEventHandler
{
/// <summary>
/// EventHandler must define a pluginId to receive plugin events.
/// </summary>
public string PluginId { get; }
/// <summary>
/// Method to call when Touch Portal is connected.
/// </summary>
void OnInfoEvent(InfoEvent message) { /* empty default implementation */ }
/// <summary>
/// Method to call when an item is selected from dropdown in Action Creation of a button.
/// </summary>
void OnListChangedEvent(ListChangeEvent message) { /* empty default implementation */ }
/// <summary>
/// Method is called when an broadcast message is sent.
/// </summary>
void OnBroadcastEvent(BroadcastEvent message) { /* empty default implementation */ }
/// <summary>
/// Settings are first received as a part of the OnInfoEvent.
/// Then updated through this event if either user changes a setting in Touch Portal, or the SettingUpdate is successfully triggered.
/// </summary>
void OnSettingsEvent(SettingsEvent message) { /* empty default implementation */ }
/// <summary>
/// Method to call when a user presses a button on their device.
/// </summary>
void OnActionEvent(ActionEvent message) { /* empty default implementation */ }
/// <summary>
/// Called when a user clicks on a notification option.
/// </summary>
void OnNotificationOptionClickedEvent(NotificationOptionClickedEvent message) { /* empty default implementation */ }
/// <summary>
/// Method to call when a user moves a slider on their device.
/// </summary>
void OnConnecterChangeEvent(ConnectorChangeEvent message) { /* empty default implementation */ }
/// <summary>
/// Called when TP reports a new instance of your connector, either at startup or if user adds/modifies one.
/// </summary>
void OnShortConnectorIdNotificationEvent(ShortConnectorIdNotificationEvent message) { /* empty default implementation */ }
/// <summary>
/// Method to call when we loose connection to Touch Portal.
/// </summary>
/// <param name="message">A reason for Touch Portal sending the close event.</param>
void OnClosedEvent(string message) { /* empty default implementation */ }
/// <summary>
/// Messages that are unknown, and therefor we cannot deserialize to a known type.
/// </summary>
/// <param name="jsonMessage">The unknown message in JSON format.</param>
void OnUnhandledEvent(string jsonMessage) { /* empty default implementation */ }
}
}