obj_ombrowser.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. #ifndef NULLSOFT_WINAMP_OMBROWSER_OBJECT_INTERFACE_HEADER
  2. #define NULLSOFT_WINAMP_OMBROWSER_OBJECT_INTERFACE_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include "bfc/dispatch.h"
  7. // {D5325EAB-9BD7-4382-A31D-38EF603061B3}
  8. static const GUID OBJ_OmBrowser =
  9. { 0xd5325eab, 0x9bd7, 0x4382, { 0xa3, 0x1d, 0x38, 0xef, 0x60, 0x30, 0x61, 0xb3 } };
  10. class ifc_ombrowserclass;
  11. class ifc_winamphook;
  12. class ifc_ombrowserregistry;
  13. class ifc_omservice;
  14. class ifc_ombrowserevent;
  15. #define BOSTYLE_NORMAL 0x0000
  16. #define BOSTYLE_SHOWDEBUG 0x0001
  17. #define BOCALLBACK_INIT 0
  18. typedef void (CALLBACK *BROWSEROPTIONSCALLBACK)(HWND /*hDialog*/, UINT /*type*/, ULONG_PTR /*user*/);
  19. class __declspec( novtable ) obj_ombrowser : public Dispatchable
  20. {
  21. protected:
  22. obj_ombrowser() {}
  23. ~obj_ombrowser() {}
  24. public:
  25. HRESULT Initialize( const wchar_t *pszName, HWND hwndWinamp );
  26. HRESULT Finish( void );
  27. HRESULT RegisterWinampHook( ifc_winamphook *hook, UINT *cookieOut );
  28. HRESULT UnregisterWinampHook( UINT cookie );
  29. HRESULT GetConfig( const GUID *configIfc, void **configOut );
  30. HRESULT GetSessionId( LPWSTR pszBuffer, INT cchBufferMax );
  31. HRESULT GetClientId( LPWSTR pszBuffer, INT cchBufferMax );
  32. HRESULT GetRegistry( ifc_ombrowserregistry **registryOut );
  33. HRESULT CreateView( ifc_omservice *service, HWND hParent, LPCWSTR forceUrl, UINT viewStyle, HWND *hView );
  34. HRESULT CreatePopup( ifc_omservice *service, INT x, INT y, INT cx, INT cy, HWND hOwner, LPCWSTR forceUrl, UINT viewStyle, HWND *hWindow );
  35. HRESULT IsFinishing( void );
  36. HRESULT GetClass( ifc_ombrowserclass **instance );
  37. HRESULT GetVersion( int *major, int *minor );
  38. HRESULT GetIEVersion( int *major, int *minor, int *build, int *subbuild );
  39. HRESULT ShowOptions( HWND hOwner, UINT style, BROWSEROPTIONSCALLBACK callback, ULONG_PTR user );
  40. DISPATCH_CODES
  41. {
  42. API_INITIALIZE = 10,
  43. API_FINISH = 20,
  44. API_REGISTERWINAMPHOOK = 30,
  45. API_UNREGISTERWINAMPHOOK = 40,
  46. API_GETLANGMODULE = 60,
  47. API_GETCONFIG = 70,
  48. API_GETSESSIONID = 80,
  49. API_GETCLIENTID = 90,
  50. API_GETREGISTRY = 100,
  51. API_CREATEVIEW = 110,
  52. API_CREATEPOPUP = 120,
  53. API_ISFINISHING = 130,
  54. API_GETCLASS = 140,
  55. API_GETVERSION = 150,
  56. API_GETIEVERSION = 160,
  57. API_SHOWOPTIONS = 170,
  58. };
  59. };
  60. inline HRESULT obj_ombrowser::Initialize( const wchar_t *pszName, HWND hwndWinamp )
  61. {
  62. return _call( API_INITIALIZE, (HRESULT)E_NOTIMPL, pszName, hwndWinamp );
  63. }
  64. inline HRESULT obj_ombrowser::Finish( void )
  65. {
  66. return _call( API_FINISH, (HRESULT)E_NOTIMPL );
  67. }
  68. inline HRESULT obj_ombrowser::RegisterWinampHook( ifc_winamphook *hook, UINT *hookCookie )
  69. {
  70. return _call( API_REGISTERWINAMPHOOK, (HRESULT)E_NOTIMPL, hook, hookCookie );
  71. }
  72. inline HRESULT obj_ombrowser::UnregisterWinampHook( UINT hookCookie )
  73. {
  74. return _call( API_UNREGISTERWINAMPHOOK, (HRESULT)E_NOTIMPL, hookCookie );
  75. }
  76. inline HRESULT obj_ombrowser::GetConfig( const GUID *configIfc, void **configOut )
  77. {
  78. return _call( API_GETCONFIG, (HRESULT)E_NOTIMPL, configIfc, configOut );
  79. }
  80. inline HRESULT obj_ombrowser::GetSessionId( LPWSTR pszBuffer, INT cchBufferMax )
  81. {
  82. return _call( API_GETSESSIONID, (HRESULT)E_NOTIMPL, pszBuffer, cchBufferMax );
  83. }
  84. inline HRESULT obj_ombrowser::GetClientId( LPWSTR pszBuffer, INT cchBufferMax )
  85. {
  86. return _call( API_GETCLIENTID, (HRESULT)E_NOTIMPL, pszBuffer, cchBufferMax );
  87. }
  88. inline HRESULT obj_ombrowser::GetRegistry( ifc_ombrowserregistry **registryOut )
  89. {
  90. return _call( API_GETREGISTRY, (HRESULT)E_NOTIMPL, registryOut );
  91. }
  92. inline HRESULT obj_ombrowser::CreateView( ifc_omservice *service, HWND hParent, LPCWSTR forceUrl, UINT viewStyle, HWND *hView )
  93. {
  94. return _call( API_CREATEVIEW, (HRESULT)E_NOTIMPL, service, hParent, forceUrl, viewStyle, hView );
  95. }
  96. inline HRESULT obj_ombrowser::CreatePopup( ifc_omservice *service, INT x, INT y, INT cx, INT cy, HWND hOwner, LPCWSTR forceUrl, UINT viewStyle, HWND *hWindow )
  97. {
  98. return _call( API_CREATEPOPUP, (HRESULT)E_NOTIMPL, service, x, y, cx, cy, hOwner, forceUrl, viewStyle, hWindow );
  99. }
  100. inline HRESULT obj_ombrowser::IsFinishing( void )
  101. {
  102. return _call( API_ISFINISHING, (HRESULT)E_NOTIMPL );
  103. }
  104. inline HRESULT obj_ombrowser::GetClass( ifc_ombrowserclass **instance )
  105. {
  106. return _call( API_GETCLASS, (HRESULT)E_NOTIMPL, instance );
  107. }
  108. inline HRESULT obj_ombrowser::GetVersion( int *major, int *minor )
  109. {
  110. return _call( API_GETVERSION, (HRESULT)E_NOTIMPL, major, minor );
  111. }
  112. inline HRESULT obj_ombrowser::GetIEVersion( int *major, int *minor, int *build, int *subbuild )
  113. {
  114. return _call( API_GETIEVERSION, (HRESULT)E_NOTIMPL, major, minor, build, subbuild );
  115. }
  116. inline HRESULT obj_ombrowser::ShowOptions( HWND hOwner, UINT style, BROWSEROPTIONSCALLBACK callback, ULONG_PTR user )
  117. {
  118. return _call( API_SHOWOPTIONS, (HRESULT)E_NOTIMPL, hOwner, style, callback, user );
  119. }
  120. #endif //NULLSOFT_WINAMP_OMBROWSER_OBJECT_INTERFACE_HEADER