1
0

ifc_deviceevent.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #ifndef _NULLSOFT_WINAMP_DEVICES_DEVICE_EVENT_INTERFACE_HEADER
  2. #define _NULLSOFT_WINAMP_DEVICES_DEVICE_EVENT_INTERFACE_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <bfc/platform/guid.h>
  7. // {4D0B21E9-B3D0-4f51-8264-575CBF6A2CFA}
  8. static const GUID IFC_DeviceEvent =
  9. { 0x4d0b21e9, 0xb3d0, 0x4f51, { 0x82, 0x64, 0x57, 0x5c, 0xbf, 0x6a, 0x2c, 0xfa } };
  10. #include <bfc/dispatch.h>
  11. class ifc_device;
  12. class ifc_deviceactivity;
  13. // supports AddRef(), Release(), QueryInterface()
  14. class __declspec(novtable) ifc_deviceevent : public Dispatchable
  15. {
  16. protected:
  17. ifc_deviceevent() {}
  18. ~ifc_deviceevent() {}
  19. public:
  20. void IconChanged(ifc_device *device);
  21. void DisplayNameChanged(ifc_device *device, const wchar_t *displayName);
  22. void AttachmentChanged(ifc_device *device, BOOL attached);
  23. void VisibilityChanged(ifc_device *device, BOOL visible);
  24. void TotalSpaceChanged(ifc_device *device, uint64_t space);
  25. void UsedSpaceChanged(ifc_device *device, uint64_t space);
  26. void CommandChanged(ifc_device *device);
  27. void ActivityStarted(ifc_device *device, ifc_deviceactivity *activity);
  28. void ActivityFinished(ifc_device *device, ifc_deviceactivity *activity);
  29. void ActivityChanged(ifc_device *device, ifc_deviceactivity *activity);
  30. void ModelChanged(ifc_device *device, const wchar_t *model);
  31. void StatusChanged(ifc_device *device, const wchar_t *status);
  32. public:
  33. DISPATCH_CODES
  34. {
  35. API_ICONCHANGED = 10,
  36. API_DISPLAYNAMECHANGED = 20,
  37. API_ATTACHMENTCHANGED = 30,
  38. API_VISIBILITYCHANGED = 40,
  39. API_TOTALSPACECHANGED = 50,
  40. API_USEDSPACECHANGED = 60,
  41. API_COMMANDCHANGED = 70,
  42. API_ACTIVITYSTARTED = 80,
  43. API_ACTIVITYFINISHED = 90,
  44. API_ACTIVITYCHANGED = 100,
  45. API_MODELCHANGED = 110,
  46. API_STATUSCHANGED = 120,
  47. };
  48. };
  49. inline void ifc_deviceevent::IconChanged(ifc_device *device)
  50. {
  51. _voidcall(API_ICONCHANGED, device);
  52. }
  53. inline void ifc_deviceevent::DisplayNameChanged(ifc_device *device, const wchar_t *displayName)
  54. {
  55. _voidcall(API_DISPLAYNAMECHANGED, device, displayName);
  56. }
  57. inline void ifc_deviceevent::AttachmentChanged(ifc_device *device, BOOL attached)
  58. {
  59. _voidcall(API_ATTACHMENTCHANGED, device, attached);
  60. }
  61. inline void ifc_deviceevent::VisibilityChanged(ifc_device *device, BOOL visible)
  62. {
  63. _voidcall(API_VISIBILITYCHANGED, device, visible);
  64. }
  65. inline void ifc_deviceevent::TotalSpaceChanged(ifc_device *device, uint64_t space)
  66. {
  67. _voidcall(API_TOTALSPACECHANGED, device, space);
  68. }
  69. inline void ifc_deviceevent::UsedSpaceChanged(ifc_device *device, uint64_t space)
  70. {
  71. _voidcall(API_USEDSPACECHANGED, device, space);
  72. }
  73. inline void ifc_deviceevent::CommandChanged(ifc_device *device)
  74. {
  75. _voidcall(API_COMMANDCHANGED, device);
  76. }
  77. inline void ifc_deviceevent::ActivityStarted(ifc_device *device, ifc_deviceactivity *activity)
  78. {
  79. _voidcall(API_ACTIVITYSTARTED, device, activity);
  80. }
  81. inline void ifc_deviceevent::ActivityFinished(ifc_device *device, ifc_deviceactivity *activity)
  82. {
  83. _voidcall(API_ACTIVITYFINISHED, device, activity);
  84. }
  85. inline void ifc_deviceevent::ActivityChanged(ifc_device *device, ifc_deviceactivity *activity)
  86. {
  87. _voidcall(API_ACTIVITYCHANGED, device, activity);
  88. }
  89. inline void ifc_deviceevent::ModelChanged(ifc_device *device, const wchar_t *model)
  90. {
  91. _voidcall(API_MODELCHANGED, device, model);
  92. }
  93. inline void ifc_deviceevent::StatusChanged(ifc_device *device, const wchar_t *status)
  94. {
  95. _voidcall(API_STATUSCHANGED, device, status);
  96. }
  97. #endif //_NULLSOFT_WINAMP_DEVICES_DEVICE_EVENT_INTERFACE_HEADER