1
0

ifc_deviceactivity.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef _NULLSOFT_WINAMP_DEVICES_DEVICE_ACTIVITY_INTERFACE_HEADER
  2. #define _NULLSOFT_WINAMP_DEVICES_DEVICE_ACTIVITY_INTERFACE_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <bfc/platform/guid.h>
  7. // {6FE2E838-6C56-4b14-8CE0-FA9B19113DA5}
  8. static const GUID IFC_DeviceActivity =
  9. { 0x6fe2e838, 0x6c56, 0x4b14, { 0x8c, 0xe0, 0xfa, 0x9b, 0x19, 0x11, 0x3d, 0xa5 } };
  10. #include <bfc/dispatch.h>
  11. // supports AddRef(), Release(), QueryInterface()
  12. class __declspec(novtable) ifc_deviceactivity: public Dispatchable
  13. {
  14. protected:
  15. ifc_deviceactivity() {}
  16. ~ifc_deviceactivity() {}
  17. public:
  18. BOOL GetActive();
  19. BOOL GetCancelable();
  20. HRESULT GetProgress(unsigned int *percentCompleted);
  21. HRESULT GetDisplayName(wchar_t *buffer, size_t bufferMax);
  22. HRESULT GetStatus(wchar_t *buffer, size_t bufferMax);
  23. HRESULT Cancel(HWND hostWindow);
  24. public:
  25. DISPATCH_CODES
  26. {
  27. API_GETACTIVE = 10,
  28. API_GETCANCELABLE = 20,
  29. API_GETPROGRESS = 30,
  30. API_GETDISPLAYNAME = 40,
  31. API_GETSTATUS = 50,
  32. API_CANCEL = 60,
  33. };
  34. };
  35. inline BOOL ifc_deviceactivity::GetActive()
  36. {
  37. return _call(API_GETACTIVE, (BOOL)FALSE);
  38. }
  39. inline BOOL ifc_deviceactivity::GetCancelable()
  40. {
  41. return _call(API_GETCANCELABLE, (BOOL)FALSE);
  42. }
  43. inline HRESULT ifc_deviceactivity::GetProgress(unsigned int *percentCompleted)
  44. {
  45. return _call(API_GETPROGRESS, (HRESULT)E_NOTIMPL, percentCompleted);
  46. }
  47. inline HRESULT ifc_deviceactivity::GetDisplayName(wchar_t *buffer, size_t bufferMax)
  48. {
  49. return _call(API_GETDISPLAYNAME, (HRESULT)E_NOTIMPL, buffer, bufferMax);
  50. }
  51. inline HRESULT ifc_deviceactivity::GetStatus(wchar_t *buffer, size_t bufferMax)
  52. {
  53. return _call(API_GETSTATUS, (HRESULT)E_NOTIMPL, buffer, bufferMax);
  54. }
  55. inline HRESULT ifc_deviceactivity::Cancel(HWND hostWindow)
  56. {
  57. return _call(API_CANCEL, (HRESULT)E_NOTIMPL, hostWindow);
  58. }
  59. #endif //_NULLSOFT_WINAMP_DEVICES_DEVICE_ACTIVITY_INTERFACE_HEADER