1
0

ifc_deviceiconstore.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #ifndef _NULLSOFT_WINAMP_DEVICES_DEVICE_ICON_STORE_INTERFACE_HEADER
  2. #define _NULLSOFT_WINAMP_DEVICES_DEVICE_ICON_STORE_INTERFACE_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <bfc/platform/guid.h>
  7. // {0CEFAC39-DCA5-4c6f-89E3-1C7573B98664}
  8. static const GUID IFC_DeviceIconStore =
  9. { 0xcefac39, 0xdca5, 0x4c6f, { 0x89, 0xe3, 0x1c, 0x75, 0x73, 0xb9, 0x86, 0x64 } };
  10. #include <bfc/dispatch.h>
  11. // supports AddRef(), Release(), QueryInterface()
  12. class __declspec(novtable) ifc_deviceiconstore : public Dispatchable
  13. {
  14. public:
  15. typedef BOOL (*EnumeratorCallback)(const wchar_t *path, unsigned int width, unsigned int height, void *user);
  16. protected:
  17. ifc_deviceiconstore() {}
  18. ~ifc_deviceiconstore() {}
  19. public:
  20. HRESULT Add(const wchar_t *path, unsigned int width, unsigned int height, BOOL replaceExisting);
  21. HRESULT Remove(unsigned int width, unsigned int height);
  22. HRESULT RemovePath(const wchar_t *path);
  23. HRESULT RemoveAll();
  24. HRESULT Get(wchar_t *buffer, size_t bufferMax, unsigned int width, unsigned int height);
  25. HRESULT GetExact(wchar_t *buffer, size_t bufferMax, unsigned int width, unsigned int height);
  26. HRESULT SetBasePath(const wchar_t *path);
  27. HRESULT GetBasePath(wchar_t *buffer, size_t bufferMax);
  28. HRESULT Clone(ifc_deviceiconstore **instance);
  29. HRESULT Enumerate(EnumeratorCallback callback, void *user);
  30. public:
  31. DISPATCH_CODES
  32. {
  33. API_ADD = 10,
  34. API_REMOVE = 20,
  35. API_REMOVEPATH = 30,
  36. API_REMOVEALL = 40,
  37. API_GET = 50,
  38. API_GETEXACT = 60,
  39. API_GETBASEPATH = 70,
  40. API_SETBASEPATH = 80,
  41. API_CLONE = 90,
  42. API_ENUMERATE = 100,
  43. };
  44. };
  45. inline HRESULT ifc_deviceiconstore::Add(const wchar_t *path, unsigned int width, unsigned int height, BOOL replaceExisting)
  46. {
  47. return _call(API_ADD, (HRESULT)E_NOTIMPL, path, width, height, replaceExisting);
  48. }
  49. inline HRESULT ifc_deviceiconstore::Remove(unsigned int width, unsigned int height)
  50. {
  51. return _call(API_REMOVE, (HRESULT)E_NOTIMPL, width, height);
  52. }
  53. inline HRESULT ifc_deviceiconstore::RemovePath(const wchar_t *path)
  54. {
  55. return _call(API_REMOVEPATH, (HRESULT)E_NOTIMPL, path);
  56. }
  57. inline HRESULT ifc_deviceiconstore::RemoveAll()
  58. {
  59. return _call(API_REMOVEALL, (HRESULT)E_NOTIMPL);
  60. }
  61. inline HRESULT ifc_deviceiconstore::Get(wchar_t *buffer, size_t bufferMax, unsigned int width, unsigned int height)
  62. {
  63. return _call(API_GET, (HRESULT)E_NOTIMPL, buffer, bufferMax, width, height);
  64. }
  65. inline HRESULT ifc_deviceiconstore::GetExact(wchar_t *buffer, size_t bufferMax, unsigned int width, unsigned int height)
  66. {
  67. return _call(API_GETEXACT, (HRESULT)E_NOTIMPL, buffer, bufferMax, width, height);
  68. }
  69. inline HRESULT ifc_deviceiconstore::SetBasePath(const wchar_t *path)
  70. {
  71. return _call(API_SETBASEPATH, (HRESULT)E_NOTIMPL, path);
  72. }
  73. inline HRESULT ifc_deviceiconstore::GetBasePath(wchar_t *buffer, size_t bufferMax)
  74. {
  75. return _call(API_GETBASEPATH, (HRESULT)E_NOTIMPL, buffer, bufferMax);
  76. }
  77. inline HRESULT ifc_deviceiconstore::Clone(ifc_deviceiconstore **instance)
  78. {
  79. return _call(API_CLONE, (HRESULT)E_NOTIMPL, instance);
  80. }
  81. inline HRESULT ifc_deviceiconstore::Enumerate(EnumeratorCallback callback, void *user)
  82. {
  83. return _call(API_ENUMERATE, (HRESULT)E_NOTIMPL, callback, user);
  84. }
  85. #endif //_NULLSOFT_WINAMP_DEVICES_DEVICE_ICON_STORE_INTERFACE_HEADER