aboutsummaryrefslogtreecommitdiff
path: root/Src/Plugins/Library/ml_devices/deviceManagerHandler.h
blob: 568627fa941900ae5b23c0b8b8a8c7be70c2c3a3 (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
#ifndef _NULLSOFT_WINAMP_ML_DEVICES_DEVICE_MANAGER_HANDLER_HEADER
#define _NULLSOFT_WINAMP_ML_DEVICES_DEVICE_MANAGER_HANDLER_HEADER

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

#include <wtypes.h>
#include "../devices/api_devicemanager.h"
//#include <ifc_devicemanagerevent.h>

class DeviceManagerHandler: public ifc_devicemanagerevent
{
protected:
	DeviceManagerHandler();
	~DeviceManagerHandler();

public:
	static HRESULT CreateInstance(DeviceManagerHandler **instance);

public:
	/* Dispatchable */
	size_t AddRef();
	size_t Release();
	int QueryInterface(GUID interface_guid, void **object);

	/* ifc_devicemanagerevent */
	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:
	HRESULT SetRelayWindow(HWND hwnd);
	HRESULT Advise(api_devicemanager *manager);
	HRESULT Unadvise(api_devicemanager *manager);


protected:
	size_t ref;
	HWND relayWindow;

protected:
	RECVS_DISPATCH;
};


#endif //_NULLSOFT_WINAMP_ML_DEVICES_DEVICE_MANAGER_HANDLER_HEADER