aboutsummaryrefslogtreecommitdiff
path: root/Src/devices/ifc_devicemanagerevent.h
blob: 68cc1c14abaa3006b11bfd92534d615b7f48e3e2 (plain) (blame)
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
#ifndef _NULLSOFT_WINAMP_DEVICES_DEVICE_MANAGER_EVENT_INTERFACE_HEADER
#define _NULLSOFT_WINAMP_DEVICES_DEVICE_MANAGER_EVENT_INTERFACE_HEADER

#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif

#include <bfc/platform/guid.h>

// {3D58B8B4-74C8-4fa2-B28D-86E96ABC7200}
static const GUID IFC_DeviceManagerEvent = 
{ 0x3d58b8b4, 0x74c8, 0x4fa2, { 0xb2, 0x8d, 0x86, 0xe9, 0x6a, 0xbc, 0x72, 0x0 } };


#include <bfc/dispatch.h>

class api_devicemanager;

// supports AddRef(), Release(), QueryInterface()
class __declspec(novtable) ifc_devicemanagerevent : public Dispatchable
{
protected:
	ifc_devicemanagerevent() {}
	~ifc_devicemanagerevent() {}

public:
	void TypeAdded(api_devicemanager *manager, ifc_devicetype *type);
	void TypeRemoved(api_devicemanager *manager, ifc_devicetype *type);
	void ConnectionAdded(api_devicemanager *manager, ifc_deviceconnection *connection);
	void ConnectionRemoved(api_devicemanager *manager, ifc_deviceconnection *connection);
	void CommandAdded(api_devicemanager *manager, ifc_devicecommand *command);
	void CommandRemoved(api_devicemanager *manager, ifc_devicecommand *command);
	void DeviceAdded(api_devicemanager *manager, ifc_device *device);
	void DeviceRemoved(api_devicemanager *manager, ifc_device *device);
	void DiscoveryStarted(api_devicemanager *manager);
	void DiscoveryFinished(api_devicemanager *manager);

public:
	DISPATCH_CODES
	{
		API_TYPEADDED		= 10,
		API_TYPEREMOVED		= 20,
		API_CONNECTIONADDED = 30,
		API_CONNECTIONREMOVED = 40,
		API_COMMANDADDED	= 50,
		API_COMMANDREMOVED	= 60,
		API_DEVICEADDED		= 70,
		API_DEVICEREMOVED	= 80,
		API_DISCOVERYSTARTED = 90,
		API_DISCOVERYFINISHED = 100,
	};
};

inline void ifc_devicemanagerevent::TypeAdded(api_devicemanager *manager, ifc_devicetype *type)
{
	_voidcall(API_TYPEADDED, manager, type);
}

inline void ifc_devicemanagerevent::TypeRemoved(api_devicemanager *manager, ifc_devicetype *type)
{
	_voidcall(API_TYPEREMOVED, manager, type);
}

inline void ifc_devicemanagerevent::ConnectionAdded(api_devicemanager *manager, ifc_deviceconnection *connection)
{
	_voidcall(API_CONNECTIONADDED, manager, connection);
}

inline void ifc_devicemanagerevent::ConnectionRemoved(api_devicemanager *manager, ifc_deviceconnection *connection)
{
	_voidcall(API_CONNECTIONREMOVED, manager, connection);
}

inline void ifc_devicemanagerevent::CommandAdded(api_devicemanager *manager, ifc_devicecommand *command)
{
	_voidcall(API_COMMANDADDED, manager, command);
}

inline void ifc_devicemanagerevent::CommandRemoved(api_devicemanager *manager, ifc_devicecommand *command)
{
	_voidcall(API_COMMANDREMOVED, manager, command);
}

inline void ifc_devicemanagerevent::DeviceAdded(api_devicemanager *manager, ifc_device *device)
{
	_voidcall(API_DEVICEADDED, manager, device);
}

inline void ifc_devicemanagerevent::DeviceRemoved(api_devicemanager *manager, ifc_device *device)
{
	_voidcall(API_DEVICEREMOVED, manager, device);
}

inline void ifc_devicemanagerevent::DiscoveryStarted(api_devicemanager *manager)
{
	_voidcall(API_DISCOVERYSTARTED, manager);
}

inline void ifc_devicemanagerevent::DiscoveryFinished(api_devicemanager *manager)
{
	_voidcall(API_DISCOVERYFINISHED, manager);
}

#endif //_NULLSOFT_WINAMP_DEVICES_DEVICE_MANAGER_EVENT_INTERFACE_HEADER