/************************************************************************ 
* ��������    ����QQ������ 
* �����ˣ�    ���ƽ, 2011��04��11��
* �汾�ţ�    1.0 
************************************************************************/
#if !defined(AFX_MYLISTCTRL_H__AEB7A796_0079_40F7_892E_32954E3D1604__INCLUDED_)
#define AFX_MYLISTCTRL_H__AEB7A796_0079_40F7_892E_32954E3D1604__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// MyListCtrl.h : header file
//
#include	<deque>
#include <atlimage.h> 
#include "EnBitmap.h"

/////////////////////////////////////////////////////////////////////////////
// CMyListCtrl window
struct LUSERITEM
{
	CString		szUserID;
	CString		szUserName;
	CString		szIPAddress;
	CString		szServerAddress;
	CString		szNoticeMsg;
	BOOL		bOnline;
	int			nHeadImageIndex;
};

typedef std::deque<LUSERITEM>	DEQUELVITEM;
/////////////////////////////////////////////////////////////////////////////
// CMyListCtrl window

class CMyListCtrl : public CListCtrl
{
// Construction
public:
	CMyListCtrl();

	enum {  TVS_CAMERA = 1 << 0, TVS_EMAIL = 1 << 1, TVS_MOBILE = 1 << 2,TVS_ONLINEUSER = 1 << 3};
// Attributes
public:
	COLORREF	m_crHighlight;
	COLORREF	m_crHighlightBorder;
	COLORREF	m_crHover;
	CEnBitmap	m_bitmap;
// Operations
public:

	void SetBackBitmap(LPCTSTR lpszImage){};
	int InsertItem(int nItem, LPCTSTR szItemText, int nImageIndex, LUSERITEM* UserInfo = NULL);
	BOOL GetUserItemInfo(LPCTSTR szItemText,LUSERITEM* userInfo);
	CRect GetTailIconRect(int nItem,DWORD dwServeFlag);
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMyListCtrl)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CMyListCtrl();	
	int m_nHighlight;

	virtual void DrawItem(LPDRAWITEMSTRUCT /*lpDrawItemStruct*/);
	// Generated message map functions
protected:
	//{{AFX_MSG(CMyListCtrl)
	afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point) ;
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void MeasureItem( LPMEASUREITEMSTRUCT lpMeasureItemStruct);
	//}}AFX_MSG
    afx_msg void OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	DECLARE_MESSAGE_MAP()
private:
	DEQUELVITEM m_DequeList;
	HICON m_hTailIconCamera;
	HICON m_hTailIconEmail;
	HICON m_hTailIconMobile;
	CEnBitmap m_bmpItemSelected;
	CEnBitmap m_bmpFaceBG;
	int nHoverItem;
	int nLastHoverItem;
public:
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnPaint();
	afx_msg void OnTimer(UINT_PTR nIDEvent);
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MYLISTCTRL_H__AEB7A796_0079_40F7_892E_32954E3D1604__INCLUDED_)