1
0

deviceHandler.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef _NULLSOFT_WINAMP_ML_DEVICES_DEVICE_HANDLER_HEADER
  2. #define _NULLSOFT_WINAMP_ML_DEVICES_DEVICE_HANDLER_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <wtypes.h>
  7. #include "../devices/ifc_deviceevent.h"
  8. class DeviceHandler: public ifc_deviceevent
  9. {
  10. protected:
  11. DeviceHandler();
  12. ~DeviceHandler();
  13. public:
  14. static HRESULT CreateInstance(DeviceHandler **instance);
  15. public:
  16. /* Dispatchable */
  17. size_t AddRef();
  18. size_t Release();
  19. int QueryInterface(GUID interface_guid, void **object);
  20. /* ifc_deviceevent */
  21. void IconChanged(ifc_device *device);
  22. void DisplayNameChanged(ifc_device *device, const wchar_t *displayName);
  23. void AttachmentChanged(ifc_device *device, BOOL attached);
  24. void VisibilityChanged(ifc_device *device, BOOL visible);
  25. void TotalSpaceChanged(ifc_device *device, size_t space);
  26. void UsedSpaceChanged(ifc_device *device, size_t space);
  27. void CommandChanged(ifc_device *device);
  28. void ActivityStarted(ifc_device *device, ifc_deviceactivity *activity);
  29. void ActivityFinished(ifc_device *device, ifc_deviceactivity *activity);
  30. void ActivityChanged(ifc_device *device, ifc_deviceactivity *activity);
  31. void ModelChanged(ifc_device *device, const wchar_t *model);
  32. void StatusChanged(ifc_device *device, const wchar_t *status);
  33. public:
  34. HRESULT SetRelayWindow(HWND hwnd);
  35. HRESULT Advise(ifc_device *device);
  36. HRESULT Unadvise(ifc_device *device);
  37. protected:
  38. size_t ref;
  39. HWND relayWindow;
  40. protected:
  41. RECVS_DISPATCH;
  42. };
  43. #endif //_NULLSOFT_WINAMP_ML_DEVICES_DEVICE_HANDLER_HEADER