1
0

ifc_omcacherecord.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #ifndef NULLSOFT_WINAMP_OMCACHE_RECORD_INTERFACE_HEADER
  2. #define NULLSOFT_WINAMP_OMCACHE_RECORD_INTERFACE_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <bfc/dispatch.h>
  7. // {50C4A9E1-0F31-4692-8084-3A7835647EAE}
  8. static const GUID IFC_OmCacheRecord =
  9. { 0x50c4a9e1, 0xf31, 0x4692, { 0x80, 0x84, 0x3a, 0x78, 0x35, 0x64, 0x7e, 0xae } };
  10. class ifc_omcachecallback;
  11. class __declspec(novtable) ifc_omcacherecord : public Dispatchable
  12. {
  13. public:
  14. typedef enum
  15. {
  16. flagNoStore = 0x00000001,
  17. } Flags;
  18. protected:
  19. ifc_omcacherecord() {}
  20. ~ifc_omcacherecord() {}
  21. public:
  22. HRESULT GetName(wchar_t *buffer, unsigned int bufferMax);
  23. HRESULT GetPath(wchar_t *buffer, unsigned int bufferMax);
  24. HRESULT SetPath(const wchar_t *path);
  25. HRESULT SetFlags(unsigned int flags, unsigned int mask);
  26. HRESULT GetFlags(unsigned int *flags);
  27. HRESULT Download();
  28. HRESULT RegisterCallback(ifc_omcachecallback *callback);
  29. HRESULT UnregisterCallback(ifc_omcachecallback *callback);
  30. public:
  31. DISPATCH_CODES
  32. {
  33. API_GETNAME = 10,
  34. API_GETPATH = 20,
  35. API_SETPATH = 30,
  36. API_SETFLAGS = 40,
  37. API_GETFLAGS = 50,
  38. API_DOWNLOAD = 60,
  39. API_REGISTERCALLBACK = 70,
  40. API_UNREGISTERCALLBACK = 80,
  41. };
  42. };
  43. inline HRESULT ifc_omcacherecord::GetName(wchar_t *buffer, unsigned int bufferMax)
  44. {
  45. return _call(API_GETNAME, (HRESULT)E_NOTIMPL, buffer, bufferMax);
  46. }
  47. inline HRESULT ifc_omcacherecord::GetPath(wchar_t *buffer, unsigned int bufferMax)
  48. {
  49. return _call(API_GETPATH, (HRESULT)E_NOTIMPL, buffer, bufferMax);
  50. }
  51. inline HRESULT ifc_omcacherecord::SetPath(const wchar_t *path)
  52. {
  53. return _call(API_SETPATH, (HRESULT)E_NOTIMPL, path);
  54. }
  55. inline HRESULT ifc_omcacherecord::SetFlags(unsigned int flags, unsigned int mask)
  56. {
  57. return _call(API_SETFLAGS, (HRESULT)E_NOTIMPL, flags, mask);
  58. }
  59. inline HRESULT ifc_omcacherecord::GetFlags(unsigned int *flags)
  60. {
  61. return _call(API_GETFLAGS, (HRESULT)E_NOTIMPL, flags);
  62. }
  63. inline HRESULT ifc_omcacherecord::Download()
  64. {
  65. return _call(API_DOWNLOAD, (HRESULT)E_NOTIMPL);
  66. }
  67. inline HRESULT ifc_omcacherecord::RegisterCallback(ifc_omcachecallback *callback)
  68. {
  69. return _call(API_REGISTERCALLBACK, (HRESULT)E_NOTIMPL, callback);
  70. }
  71. inline HRESULT ifc_omcacherecord::UnregisterCallback(ifc_omcachecallback *callback)
  72. {
  73. return _call(API_UNREGISTERCALLBACK, (HRESULT)E_NOTIMPL, callback);
  74. }
  75. #endif //NULLSOFT_WINAMP_OMCACHE_RECORD_INTERFACE_HEADER