// RemoteTreeCtrl.h : header file
//

#pragma once

#include "MainFrm.h"
#include "RTDropTarget.h"

/////////////////////////////////////////////////////////////////////////////
// CShellTreeCtrl window

class CRemoteTreeCtrl : public CTreeCtrl
{
// Construction
public:
	CRemoteTreeCtrl();

// Attributes
protected:
	HTREEITEM m_htiSelected;

	CRTDropTarget m_dropTarget;

public:

// Operations
protected:
	void SetClipboard(HTREEITEM hti, CLIPBOARD_STATE cbs);
	void PasteClipboard(HTREEITEM htiTarget);

public:
	CString GetPath(HTREEITEM hti = NULL);

	HTREEITEM GetVolumeItem(HTREEITEM hti);
	CString   GetVolumeText(HTREEITEM hti);

	HTREEITEM GetItem(HTREEITEM hti, CString sPath);

	bool IsExistsChild(HTREEITEM hti, CString sName);

	void Sort(HTREEITEM hti = NULL);

	void DeleteChildItem(HTREEITEM hti);
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CRemoteTreeCtrl)
	//}}AFX_VIRTUAL

// Implementation
public:
	HTREEITEM InsertItem(LPCTSTR lpszItem, HTREEITEM hParent = TVI_ROOT, HTREEITEM hInsertAfter = TVI_LAST);
	HTREEITEM InsertItem(LPCTSTR lpszItem, int nImage, int nSelectedImage, HTREEITEM hParent = TVI_ROOT, HTREEITEM hInsertAfter = TVI_LAST);
	BOOL SetItemText(HTREEITEM hItem, LPCTSTR lpszItem);
	BOOL DeleteItem(HTREEITEM hItem);
	BOOL DeleteAllItems();

	virtual ~CRemoteTreeCtrl();

protected:
	virtual BOOL PreTranslateMessage(MSG* pMsg);

protected:
	//{{AFX_MSG(CRemoteTreeCtrl)
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
public:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnNMRclick(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/);
	afx_msg void OnBegindrag(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnTreeCut();
	afx_msg void OnTreeCopy();
	afx_msg void OnTreePaste();
	afx_msg void OnTreeDelete();
	afx_msg void OnTreeRename();
	afx_msg void OnTreeSetAnony();
	afx_msg void OnTreeUnsetAnony();
	afx_msg void OnTreeSetBandwidth();
	afx_msg void OnTreeInfo();
};
