setupListbox.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #ifndef NULLOSFT_ONLINEMEDIA_PLUGIN_SETUPLISTBOX_HEADER
  2. #define NULLOSFT_ONLINEMEDIA_PLUGIN_SETUPLISTBOX_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <windows.h>
  7. class SetupGroupList;
  8. class SetupListboxItem;
  9. class __declspec(novtable) SetupListbox
  10. {
  11. public:
  12. typedef enum
  13. {
  14. menuGroupContext = 0,
  15. } contextMenu;
  16. public:
  17. static HRESULT CreateInstance(HWND hListbox, SetupGroupList *groupList, SetupListbox **pInstance);
  18. static SetupListbox *GetInstance(HWND hListbox);
  19. public:
  20. virtual HWND GetHwnd() = 0;
  21. virtual HFONT GetFont() = 0;
  22. virtual LRESULT CallDefaultProc(UINT uMsg, WPARAM wParam, LPARAM lParam) = 0;
  23. virtual LRESULT CallPrevProc(UINT uMsg, WPARAM wParam, LPARAM lParam) = 0;
  24. virtual BOOL MeasureItem(INT itemId, UINT *cx, UINT *cy) = 0;
  25. virtual BOOL DrawItem(HDC hdc, const RECT *prcItem, INT itemId, UINT itemState, UINT itemAction) = 0;
  26. virtual INT_PTR KeyToItem(INT vKey, INT caretPos) = 0;
  27. virtual INT_PTR CharToItem(INT vKey, INT caretPos) = 0;
  28. virtual BOOL DrawCheckbox(HDC hdc, BOOL checked, UINT state, const RECT *pRect, const RECT *pClipRect) = 0;
  29. virtual BOOL GetCheckboxMetrics(HDC hdc, BOOL checked, UINT state, SIZE *pSize) = 0;
  30. virtual void SetCapture(SetupListboxItem *item) = 0;
  31. virtual SetupListboxItem *GetCapture() = 0;
  32. virtual void ReleaseCapture() = 0;
  33. virtual BOOL InvalidateRect(const RECT *prcInvalidate, BOOL fErase) = 0;
  34. virtual BOOL InvalidateItem(INT iItem, BOOL fErase) = 0;
  35. virtual void UpdateCount() = 0;
  36. virtual BOOL DrawExpandbox(HDC hdc, BOOL fExpanded, const RECT *pRect, COLORREF rgbBk, COLORREF rgbFg) = 0;
  37. virtual BOOL GetExpandboxMetrics(HDC hdc, BOOL fExpanded, SIZE *pSize) = 0;
  38. virtual INT GetPageCount() = 0;
  39. virtual INT GetNextEnabledItem(INT iItem, SetupListboxItem **itemOut) = 0;
  40. virtual INT GetPrevEnabledItem(INT iItem, SetupListboxItem **itemOut) = 0;
  41. virtual SetupListboxItem *GetSelection() = 0;
  42. virtual BOOL SetSelection(SetupListboxItem *item) = 0;
  43. virtual BOOL GetIndex(SetupListboxItem *item, INT *iItem) = 0;
  44. virtual HMENU GetContextMenu(UINT menuId) = 0;
  45. };
  46. class __declspec(novtable) SetupListboxItem
  47. {
  48. public:
  49. virtual BOOL MeasureItem(SetupListbox *instance, UINT *cx, UINT *cy) = 0;
  50. virtual BOOL DrawItem(SetupListbox *instance, HDC hdc, const RECT *prc, UINT state) = 0;
  51. virtual INT_PTR KeyToItem(SetupListbox *instance, const RECT *prcItem, INT vKey) = 0;
  52. virtual BOOL MouseMove(SetupListbox *instance, const RECT *prcItem, UINT mouseFlags, POINT pt) = 0;
  53. virtual BOOL MouseLeave(SetupListbox *instance, const RECT *prcItem) = 0;
  54. virtual BOOL LButtonDown(SetupListbox *instance, const RECT *prcItem, UINT mouseFlags, POINT pt) = 0;
  55. virtual BOOL LButtonUp(SetupListbox *instance, const RECT *prcItem, UINT mouseFlags, POINT pt) = 0;
  56. virtual BOOL LButtonDblClk(SetupListbox *instance, const RECT *prcItem, UINT mouseFlags, POINT pt) = 0;
  57. virtual BOOL RButtonDown(SetupListbox *instance, const RECT *prcItem, UINT mouseFlags, POINT pt) = 0;
  58. virtual BOOL RButtonUp(SetupListbox *instance, const RECT *prcItem, UINT mouseFlags, POINT pt) = 0;
  59. virtual void CaptureChanged(SetupListbox *instance, const RECT *prcItem, SetupListboxItem *captured) = 0;
  60. virtual BOOL IsDisabled() = 0;
  61. virtual void Command(SetupListbox *instance, INT commandId, INT eventId) = 0;
  62. virtual HWND CreateDetailsView(HWND hParent) = 0;
  63. virtual BOOL GetUniqueName(LPWSTR pszBuffer, UINT cchBufferMax) = 0;
  64. };
  65. #endif //NULLOSFT_ONLINEMEDIA_PLUGIN_SETUPLISTBOX_HEADER