ifc_mlnavigationhelper.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef NULLSOFT_WINAMP_ML_NAVIGATION_HELPER_INTERFACE_HEADER
  2. #define NULLSOFT_WINAMP_ML_NAVIGATION_HELPER_INTERFACE_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <bfc/dispatch.h>
  7. // {816290AB-A249-4b64-A192-C643D0AD68CA}
  8. static const GUID IFC_MlNavigationHelper =
  9. { 0x816290ab, 0xa249, 0x4b64, { 0xa1, 0x92, 0xc6, 0x43, 0xd0, 0xad, 0x68, 0xca } };
  10. class ifc_mlnavigationcallback;
  11. class __declspec(novtable) ifc_mlnavigationhelper : public Dispatchable
  12. {
  13. protected:
  14. ifc_mlnavigationhelper() {}
  15. ~ifc_mlnavigationhelper() {}
  16. public:
  17. HRESULT GetDefaultIndex(int *index);
  18. HRESULT QueryIndex(const wchar_t *name, int *index, BOOL *defaultUsed);
  19. HRESULT ReleaseIndex(const wchar_t *name);
  20. HRESULT RegisterAlias(const wchar_t *name, const wchar_t *address);
  21. HRESULT RegisterCallback(ifc_mlnavigationcallback *callback, unsigned int *cookie);
  22. HRESULT UnregisterCallback(unsigned int cookie);
  23. public:
  24. DISPATCH_CODES
  25. {
  26. API_GETDEFAULTINDEX = 10,
  27. API_QUERYINDEX = 20,
  28. API_RELEASEINDEX = 30,
  29. API_REGISTERALIAS = 40,
  30. API_REGISTERCALLBACK = 50,
  31. API_UNREGISTERCALLBACK = 60,
  32. };
  33. };
  34. inline HRESULT ifc_mlnavigationhelper::GetDefaultIndex(int *index)
  35. {
  36. return _call(API_GETDEFAULTINDEX, (HRESULT)E_NOTIMPL, index);
  37. }
  38. inline HRESULT ifc_mlnavigationhelper::QueryIndex(const wchar_t *name, int *index, BOOL *defaultUsed)
  39. {
  40. return _call(API_QUERYINDEX, (HRESULT)E_NOTIMPL, name, index, defaultUsed);
  41. }
  42. inline HRESULT ifc_mlnavigationhelper::ReleaseIndex(const wchar_t *name)
  43. {
  44. return _call(API_RELEASEINDEX, (HRESULT)E_NOTIMPL, name);
  45. }
  46. inline HRESULT ifc_mlnavigationhelper::RegisterAlias(const wchar_t *name, const wchar_t *address)
  47. {
  48. return _call(API_REGISTERALIAS, (HRESULT)E_NOTIMPL, name, address);
  49. }
  50. inline HRESULT ifc_mlnavigationhelper::RegisterCallback(ifc_mlnavigationcallback *callback, UINT *cookie)
  51. {
  52. return _call(API_REGISTERCALLBACK, (HRESULT)API_REGISTERCALLBACK, callback, cookie);
  53. }
  54. inline HRESULT ifc_mlnavigationhelper::UnregisterCallback(UINT cookie)
  55. {
  56. return _call(API_UNREGISTERCALLBACK, (HRESULT)E_NOTIMPL, cookie);
  57. }
  58. #endif //NULLSOFT_WINAMP_ML_NAVIGATION_HELPER_INTERFACE_HEADER