1
0

browserUiHook.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef NULLSOFT_WINAMP_OMBROWSER_UI_HOOK_HEADER
  2. #define NULLSOFT_WINAMP_OMBROWSER_UI_HOOK_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include "./ifc_winamphook.h"
  7. #include "./ifc_omserviceevent.h"
  8. #include "./ifc_omconfigcallback.h"
  9. #include <bfc/multipatch.h>
  10. #define MPIID_WINAMPHOOK 10
  11. #define MPIID_SERVICEEVENT 20
  12. #define MPIID_CONFIGCALLBACK 30
  13. class ifc_omservice;
  14. class obj_ombrowser;
  15. class BrowserUiHook : public MultiPatch<MPIID_WINAMPHOOK, ifc_winamphook>,
  16. public MultiPatch<MPIID_SERVICEEVENT, ifc_omserviceevent>,
  17. public MultiPatch<MPIID_CONFIGCALLBACK, ifc_omconfigcallback>
  18. {
  19. protected:
  20. BrowserUiHook(HWND hTarget, BOOL fPopupMode);
  21. ~BrowserUiHook();
  22. public:
  23. static HRESULT CreateInstance(HWND hTarget, BOOL fPopupMode, BrowserUiHook **instance);
  24. public:
  25. /* Dispatchable */
  26. size_t AddRef();
  27. size_t Release();
  28. int QueryInterface(GUID interface_guid, void **object);
  29. /*ifc_winamphook (partial) */
  30. HRESULT SkinChanging(void);
  31. HRESULT SkinChanged(const wchar_t *skinName);
  32. HRESULT SkinColorChange(const wchar_t *colorTheme);
  33. HRESULT ResetFont(void);
  34. /* ifc_omserviceevent */
  35. void ServiceChange(ifc_omservice *service, UINT nModified);
  36. void CommandStateChange(ifc_omservice *service, const GUID *commandGroup, unsigned int commandId);
  37. /* ifc_omconfigcallback */
  38. HRESULT ValueChanged(const GUID *configUid, UINT valueId, ULONG_PTR value);
  39. public:
  40. HRESULT Register(obj_ombrowser *browserManager, ifc_omservice *service);
  41. HRESULT Unregister(obj_ombrowser *browserManager, ifc_omservice *service);
  42. HRESULT CheckBlockedState(ifc_omservice *service);
  43. protected:
  44. ULONG ref;
  45. BOOL popupMode;
  46. HWND hwnd;
  47. UINT winampCookie;
  48. UINT configCookie;
  49. protected:
  50. RECVS_MULTIPATCH;
  51. };
  52. #endif //NULLSOFT_WINAMP_OMBROWSER_UI_HOOK_HEADER