1
0

component.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #ifndef NULLSOFT_WINAMP_OMBROWSER_COMPONENT_HEADER
  2. #define NULLSOFT_WINAMP_OMBROWSER_COMPONENT_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <wtypes.h>
  7. #include "../Agave/Component/ifc_wa5component.h"
  8. #include "./ifc_winamphook.h"
  9. #include <bfc/multipatch.h>
  10. #include <vector>
  11. class WasabiHelper;
  12. class WinampHook;
  13. class SkinHelper;
  14. class ifc_wasabihelper;
  15. class ifc_skinhelper;
  16. class ifc_ombrowserclass;
  17. class InternetFeatures;
  18. #define MPIID_WA5COMPONENT 10
  19. #define MPIID_WINAMPHOOK 20
  20. class OmBrowserComponent : public MultiPatch<MPIID_WA5COMPONENT, ifc_wa5component>,
  21. public MultiPatch<MPIID_WINAMPHOOK, ifc_winamphook>
  22. {
  23. public:
  24. OmBrowserComponent();
  25. ~OmBrowserComponent();
  26. public:
  27. /* Dispatchable */
  28. size_t AddRef();
  29. size_t Release();
  30. int QueryInterface(GUID interface_guid, void **object);
  31. /* ifc_wa5component */
  32. void RegisterServices(api_service *service);
  33. int RegisterServicesSafeModeOk();
  34. void DeregisterServices(api_service *service);
  35. /* ifc_winamphook (partial) */
  36. HRESULT ResetFont(void);
  37. HRESULT SkinChanged(const wchar_t *skinName);
  38. HRESULT SkinColorChange(const wchar_t *colorTheme);
  39. public:
  40. HRESULT InitializeComponent(HWND hwndWinamp);
  41. HRESULT GetWasabiHelper(ifc_wasabihelper **wasabiOut);
  42. HRESULT GetSkinHelper(ifc_skinhelper **skinOut);
  43. HRESULT RegisterWinampHook(ifc_winamphook *hook, UINT *cookieOut);
  44. HRESULT UnregisterWinampHook(UINT cookie);
  45. HRESULT GetWinampWnd(HWND *hwndWinamp);
  46. HRESULT RegisterUnloadCallback(PLUGINUNLOADCALLBACK callback);
  47. HRESULT GetBrowserClass(LPCWSTR pszName, ifc_ombrowserclass **instance);
  48. HRESULT UnregisterBrowserClass(LPCWSTR pszName);
  49. protected:
  50. void ReleaseServices(void);
  51. void UpdateColors(void);
  52. void SetInternetFeautures(void);
  53. BOOL SetUserAgent(void);
  54. protected:
  55. RECVS_MULTIPATCH;
  56. private:
  57. typedef std::vector<PLUGINUNLOADCALLBACK> UnloadCallbackList;
  58. typedef std::vector<ifc_ombrowserclass*> BrowserClassList;
  59. private:
  60. WasabiHelper *wasabiHelper;
  61. WinampHook *winampHook;
  62. SkinHelper *skinHelper;
  63. UINT hookCookie;
  64. CRITICAL_SECTION lock;
  65. UnloadCallbackList unloadCallbacks;
  66. BrowserClassList browserClasses;
  67. InternetFeatures *internetFeatures;
  68. };
  69. #endif //NULLSOFT_WINAMP_OMBROWSER_COMPONENT_HEADER