Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
3.1 KiB

  1. // File: roomlist.h
  2. #ifndef _ROOMLIST_H_
  3. #define _ROOMLIST_H_
  4. #include "GenWindow.h"
  5. class CParticipant;
  6. void TileBltWatermark(UINT x, UINT y, UINT cx, UINT cy, UINT xOff, UINT yOff, HDC hdcDst, HDC hdcSrc,
  7. UINT cxWatermark, UINT cyWatermark);
  8. class CRoomListView : public CWindowImpl<CRoomListView>, public IGenWindow
  9. {
  10. private:
  11. enum
  12. {
  13. COLUMN_INDEX_NAME = 0,
  14. NUM_COLUMNS
  15. };
  16. // Member Variables:
  17. enum { m_iSortColumn = COLUMN_INDEX_NAME };
  18. BOOL m_fSortAscending;
  19. LPARAM m_lUserData;
  20. LRESULT OnClick(LV_HITTESTINFO* plvhi, BOOL fLeftClick);
  21. // static methods
  22. static int CALLBACK RoomListViewCompareProc(LPARAM lParam1,
  23. LPARAM lParam2,
  24. LPARAM lParamSort);
  25. LPARAM GetSelectedLParam();
  26. VOID GetDispInfo(LV_DISPINFO * pLvdi);
  27. int LParamToPos(LPARAM lParam);
  28. BOOL Add(int iPosition, CParticipant * pPart);
  29. VOID Remove(LPARAM lParam);
  30. public:
  31. // Methods:
  32. CRoomListView();
  33. ~CRoomListView();
  34. // begin IGenWindow interface
  35. virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFGUID iid, LPVOID *pObj)
  36. { return(E_NOTIMPL); }
  37. virtual ULONG STDMETHODCALLTYPE AddRef(void) { return(3); }
  38. virtual ULONG STDMETHODCALLTYPE Release(void) { return(2); }
  39. virtual void GetDesiredSize(SIZE *ppt);
  40. virtual HBRUSH GetBackgroundBrush() { return(NULL); }
  41. virtual HPALETTE GetPalette() { return(NULL); }
  42. virtual void OnDesiredSizeChanged() {}
  43. // Get the LPARAM of user data
  44. virtual LPARAM GetUserData() { return(m_lUserData); }
  45. // end IGenWindow interface
  46. void SetUserData(LPARAM lUserData) { m_lUserData = lUserData; }
  47. // CView
  48. BOOL Create(HWND hwndParent);
  49. VOID Show(BOOL fVisible);
  50. VOID ShiftFocus(HWND hwndCur, BOOL fForward);
  51. VOID Redraw(void);
  52. VOID SaveSettings(RegEntry * pre) {}
  53. BOOL LoadSettings(RegEntry * pre);
  54. HWND GetHwnd() const {return m_hWnd;}
  55. BOOL IsChildWindow(HWND hwnd)
  56. {
  57. return ((hwnd == m_hWnd) || ::IsChild(m_hWnd, hwnd));
  58. }
  59. VOID ForwardSysChangeMsg(UINT uMsg, WPARAM wParam, LPARAM lParam);
  60. BOOL OnPopup(POINT pt);
  61. VOID OnChangeParticipant(CParticipant * pPart, NM_MEMBER_NOTIFY uNotify);
  62. CParticipant * GetParticipant();
  63. // Handlers:
  64. LRESULT OnNotify(WPARAM wParam, LPARAM lParam);
  65. //////////////////////////////////
  66. // ATLWin stuff
  67. // This is a superclass of a SysListTreeView32
  68. DECLARE_WND_SUPERCLASS(NULL,_T("SysListView32"))
  69. // Message map
  70. BEGIN_MSG_MAP(CComponentWnd)
  71. MESSAGE_HANDLER(c_msgFromHandle,OnFromHandle)
  72. MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
  73. MESSAGE_HANDLER(WM_SIZE, OnSize)
  74. END_MSG_MAP()
  75. private:
  76. // Message Map Handlers
  77. LRESULT OnFromHandle(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  78. {
  79. return(reinterpret_cast<LRESULT>(static_cast<IGenWindow*>(this)));
  80. }
  81. LRESULT OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  82. {
  83. CGenWindow::SetHotControl(NULL);
  84. bHandled = FALSE;
  85. return(0);
  86. }
  87. LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  88. };
  89. #endif // _ROOMLIST_H_