browserUiCommon.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #ifndef NULLSOFT_WINAMP_OMBROWSER_UI_COMMON_HEADER
  2. #define NULLSOFT_WINAMP_OMBROWSER_UI_COMMON_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <wtypes.h>
  7. class ifc_omservice;
  8. // styles
  9. #define NBCS_DISABLEHOSTCSS 0x00000001 // no coloring
  10. #define NBCS_POPUPOWNER 0x00000002 // every created popup owner by window
  11. #define NBCS_DISABLEFULLSCREEN 0x00000004 // disable fullscreen mode (popup only)
  12. #define NBCS_NOTOOLBAR 0x00000100 // force no toolbar
  13. #define NBCS_NOSTATUSBAR 0x00000200 // force no statusbar
  14. #define NBCS_NOSERVICECOMMANDS 0x00000400 // force disable service commands
  15. #define NBCS_DISABLECONTEXTMENU 0x00001000 // disable context menu
  16. #define NBCS_DIALOGMODE 0x00002000 // enable dialog mode
  17. #define NBCS_BLOCKPOPUP 0x00004000 // block any popup creation
  18. // messages
  19. #define NBCM_FIRST (WM_USER + 20)
  20. #define NBVM_FIRST (NBCM_FIRST + 100)
  21. #define NBPM_FIRST (NBCM_FIRST + 200)
  22. #define NBCM_GETTOOLBAR (NBCM_FIRST + 1) // wParam - not used; lParam - not used; Return: toolbar hwnd.
  23. #define BrowserControl_GetToolbar(/*HWND*/ __hwndControl)\
  24. ((HWND)SENDMSG((__hwndControl), NBCM_GETTOOLBAR, 0, 0L))
  25. #define NBCM_GETSTATUSBAR (NBCM_FIRST + 2) // wParam - not used; lParam - not used; Return: statusbar hwnd.
  26. #define BrowserControl_GetStatusbar(/*HWND*/ __hwndControl)\
  27. ((HWND)SENDMSG((__hwndControl), NBCM_GETSTATUSBAR, 0, 0L))
  28. #define NBCM_UPDATESKIN (NBCM_FIRST + 3) // wParam - not used; lParam - (LPARAM)(BOOL)fRedraw; Return: not used.
  29. #define BrowserControl_UpdateSkin(/*HWND*/ __hwndControl, /*BOOL*/ __fRedraw)\
  30. (SENDMSG((__hwndControl), NBCM_UPDATESKIN, 0, (LPARAM)(__fRedraw)))
  31. #define NBCM_GETSERVICE (NBCM_FIRST + 4) // wParam - not used; lParam = (LPARAM)(ifc_omservice**)serviceOut; Return: TRUE on success.
  32. #define BrowserControl_GetService(/*HWND*/ __hwndControl, /*ifc_omservice** */ __serviceOut)\
  33. ((BOOL)SENDMSG((__hwndControl), NBCM_GETSERVICE, 0, (LPARAM)(__serviceOut)))
  34. #define NAVIGATE_BLANK MAKEINTRESOURCEW(0)
  35. #define NAVIGATE_HOME MAKEINTRESOURCEW(1)
  36. #define NAVIGATE_BACK MAKEINTRESOURCEW(2)
  37. #define NAVIGATE_FORWARD MAKEINTRESOURCEW(3)
  38. #define NAVIGATE_REFRESH MAKEINTRESOURCEW(4)
  39. #define NAVIGATE_STOP MAKEINTRESOURCEW(5)
  40. #define NAVIGATE_REFRESH_COMPLETELY MAKEINTRESOURCEW(6)
  41. #define NBCM_NAVIGATE (NBCM_FIRST + 5) // wParam = (WPARAM)(BOOL)fScheduleIfBlocked; lParam = (LPARAM)(LPWSTR)navigateUrl; Return: TRUE on success.
  42. #define BrowserControl_Navigate(/*HWND*/ __hwndControl, /*LPCWSTR*/ __navigateUrl, /*BOOL*/ __scheduleBlocked)\
  43. ((BOOL)SENDMSG((__hwndControl), NBCM_NAVIGATE, (WPARAM)__scheduleBlocked, (LPARAM)(__navigateUrl)))
  44. #define NBCM_WRITEDOCUMENT (NBCM_FIRST + 6) // wParam = (WPARAM)(BOOL)fScheduleIfBlocked; lParam = (LPARAM)(BSTR)documentData; Return: TRUE on success.
  45. #define BrowserControl_WriteDocument(/*HWND*/ __hwndControl, /*BSTR*/ __documentData, /*BOOL*/ __scheduleBlocked)\
  46. ((BOOL)SENDMSG((__hwndControl), NBCM_WRITEDOCUMENT, (WPARAM)__scheduleBlocked, (LPARAM)(__documentData)))
  47. #define NBCM_GETHOST (NBCM_FIRST + 7) // wParam - not used; lParam - not used; Return: host hwnd.
  48. #define BrowserControl_GetHost(/*HWND*/ __hwndControl)\
  49. ((HWND)SENDMSG((__hwndControl), NBCM_GETHOST, 0, 0L))
  50. #define NBCM_GETBROWSEROBJECT (NBCM_FIRST + 8) // wParam - not used; lParam = (LPARAM)(obj_ombrowser**)browserOut; Return: TRUE on success.
  51. #define BrowserControl_GetBrowserObject(/*HWND*/ __hwndControl, /*obj_ombrowser** */ __browserOut)\
  52. ((BOOL)SENDMSG((__hwndControl), NBCM_GETBROWSEROBJECT, 0, (LPARAM)(__browserOut)))
  53. // operation flags
  54. #define NBCOF_HIDEWIDGET 0x00000001
  55. #define NBCOF_SHOWWIDGET 0x00000002
  56. // operation valid fields mask
  57. #define NBCOM_FLAGS 0x00000001
  58. #define NBCOM_TITLE 0x00000002
  59. #define NBCOM_TEXT 0x00000004
  60. typedef struct __OPERATIONINFO
  61. {
  62. UINT cbSize; //sizeof(OPERATIONINFO)
  63. UINT mask; //
  64. UINT flags; // show flags;
  65. LPCWSTR title; // operation title
  66. LPCWSTR text; // operation text
  67. } OPERATIONINFO;
  68. #define NBCM_SHOWOPERATION (NBCM_FIRST + 9) // wParam - not sued, lParam - (LPARAM)(OPERATIONINFO*)__pOperationInfo.
  69. #define BrowserControl_ShowOperation(/*HWND*/ __hwndControl, /*const OPERATIONINFO* */ __pOperationInfo)\
  70. ((BOOL)SENDMSG((__hwndControl), NBCM_SHOWOPERATION, 0, (LPARAM)(__pOperationInfo)))
  71. #define NBCM_NAVSTOREDURL (NBCM_FIRST + 10) // wParam - not used, lParam - not used
  72. #define BrowserControl_NavigateStoredUrl(/*HWND*/ __hwndControl)\
  73. ((BOOL)SNDMSG((__hwndControl), NBCM_NAVSTOREDURL, 0, 0L))
  74. #define NBCM_BLOCK (NBCM_FIRST + 11) //wParam - not used, lParam = (LPARAM)(BOOL)fBlock;
  75. #define BrowserControl_Block(/*HWND*/ __hwndControl, /*BOOL*/ __fBlock)\
  76. (SNDMSG((__hwndControl), NBCM_BLOCK, 0, (LPARAM)(__fBlock)))
  77. #define NBCM_SETEXTSTYLE (NBCM_FIRST + 12) //wParam = (WPARAM)(UINT)extMask, lParam = (LPARAM)(UINT)extStyle; Return UINT with prevoius extended style
  78. #define BrowserControl_SetExtendedStyle(/*HWND*/ __hwndControl, /*UINT*/ __extMask, /*UINT*/__extStyle)\
  79. ((UINT)SNDMSG((__hwndControl), NBCM_SETEXTSTYLE, (WPARAM)(__extMask), (LPARAM)(__extStyle)))
  80. #define NBCM_GETEXTSTYLE (NBCM_FIRST + 13) //wParam - not used, lParam - not used; Return UINT extended style.
  81. #define BrowserControl_GetExtendedStyle(/*HWND*/ __hwndControl)\
  82. ((UINT)SNDMSG((__hwndControl), NBCM_GETTEXTSTYLE, 0, 0L))
  83. #endif // NULLSOFT_WINAMP_OMBROWSER_UI_COMMON_HEADER