update for HEAD-2003091401
[reactos.git] / subsys / system / explorer / Seashell / SeaShellExt / Include / IEShellTreeCtrl.h
1 //*******************************************************************************
2 // COPYRIGHT NOTES
3 // ---------------
4 // You may use this source code, compile or redistribute it as part of your application 
5 // for free. You cannot redistribute it as a part of a software development 
6 // library without the agreement of the author. If the sources are 
7 // distributed along with the application, you should leave the original 
8 // copyright notes in the source code without any changes.
9 // This code can be used WITHOUT ANY WARRANTIES at your own risk.
10 // 
11 // For the latest updates to this code, check this site:
12 // http://www.masmex.com 
13 // after Sept 2000
14 // 
15 // Copyright(C) 2000 Philip Oldaker <email: philip@masmex.com>
16 //*******************************************************************************
17
18 #ifndef __IESHELLTREECTRL_H__
19 #define __IESHELLTREECTRL_H__
20
21 #if _MSC_VER > 1000
22 #pragma once
23 #endif // _MSC_VER > 1000
24
25 #ifndef __AFXMT_H__
26 #include "afxmt.h"
27 #endif
28 // IEShellTreeCtrl.h : header file
29 //
30 #include <afxpriv.h>
31 #include "IEFolderTreeCtrl.h"
32 #include "IEShellDragDrop.h"
33 /////////////////////////////////////////////////////////////////////////////
34 // CIEShellTreeCtrl window
35
36 class CTRL_EXT_CLASS CIEShellTreeCtrl : public CIEFolderTreeCtrl
37 {
38 // Construction
39 public:
40         CIEShellTreeCtrl();
41
42 // Attributes
43 public:
44         void SetNotifyParent(bool bNotifyParent) { m_bNotifyParent = bNotifyParent; }
45         bool RefreshAllowed() { return m_bRefreshAllowed; }
46         void SetRefreshAllowed(bool bRefresh) { m_bRefreshAllowed = bRefresh; } 
47         void SetListCtrlWnd(HWND hWnd) { m_hListWnd = hWnd; }
48         void SetComboBoxWnd(HWND hWnd) { m_hComboWnd = hWnd; }
49         CString GetSelectedPath() { return GetPathName(); }
50 // Operations
51 public:
52         virtual void UpOneLevel(HTREEITEM hItem=NULL);
53         virtual void ShellExecute(HTREEITEM hItem,LPCTSTR pszVerb=NULL);
54         virtual void SetNotificationObject(bool bNotify);
55         virtual bool LoadFolderItems(LPCTSTR pszPath=NULL);
56         virtual bool GetFolderInfo(HTREEITEM hItem,CString &sPath,CString &sName);
57         virtual void Refresh();
58         virtual HTREEITEM FindPidl(LPITEMIDLIST pidlAbs,BOOL bSelect=TRUE);
59         virtual HTREEITEM ExpandPidl(LPITEMIDLIST pidlAbs);
60         virtual HTREEITEM ExpandMyComputer(LPITEMIDLIST pidlAbs);
61 // Overrides
62 protected:
63         virtual void RefreshComboBox(LPTVITEMDATA lptvid);
64         virtual void DestroyThreads();
65         virtual void CreateFileChangeThreads(HWND hwnd);
66         virtual void CreateFileChangeThread (const CString& sPath,HWND hwnd);
67         virtual HTREEITEM SearchSiblings(HTREEITEM hItem,LPITEMIDLIST pidlAbs);
68         virtual HTREEITEM FindItem(HTREEITEM hItem, const CString& strTarget);
69         virtual UINT DeleteChildren(HTREEITEM hItem);
70         virtual bool SHMoveFile(HTREEITEM hSrcItem,HTREEITEM hDestItem);
71         // ClassWizard generated virtual function overrides
72         //{{AFX_VIRTUAL(CIEShellTreeCtrl)
73         virtual BOOL OnWndMsg( UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult );
74         virtual bool Expanding(NM_TREEVIEW *nmtvw);
75         virtual CRefresh *CreateRefreshObject(HTREEITEM hItem,LPARAM lParam);
76         virtual DROPEFFECT DoDragDrop(NM_TREEVIEW* pNMTreeView,COleDataSource *pOleDataSource);
77         virtual bool EndLabelEdit(HTREEITEM hItem,LPCTSTR pszText);
78         virtual BOOL TransferItem(HTREEITEM hitemDrag, HTREEITEM hitemDrop);
79         protected:
80         virtual void Init();
81         virtual void ShowProperties(HTREEITEM hItem);
82         virtual void ShowPopupMenu(HTREEITEM hItem,CPoint point);
83         virtual void DoubleClick(HTREEITEM hItem);
84         virtual void DeleteKey(HTREEITEM hItem);
85         virtual void GoBack(HTREEITEM hItem);
86         virtual void PreSubclassWindow();
87         virtual void UpdateEvent(LPARAM lHint,CObject *pHint);
88         virtual bool DragDrop(CDD_OleDropTargetInfo *pInfo);
89         virtual bool DragOver(CDD_OleDropTargetInfo *pInfo);
90         virtual bool DragEnter(CDD_OleDropTargetInfo *pInfo);
91         virtual bool DragLeave(CDD_OleDropTargetInfo *pInfo);
92         //}}AFX_VIRTUAL
93 // Implementation
94 public:
95         virtual ~CIEShellTreeCtrl();
96
97 // Generated message map functions
98 protected:
99         //{{AFX_MSG(CIEShellTreeCtrl)
100                         // NOTE - the ClassWizard will add and remove member functions here.
101         afx_msg BOOL OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
102         afx_msg void OnDestroy();
103         afx_msg LRESULT OnAppDirChangeEvent(WPARAM wParam, LPARAM lParam);
104         afx_msg LRESULT OnCBIESelChange(WPARAM wParam,LPARAM lParam);
105         afx_msg LRESULT OnAppPopulateTree(WPARAM wParam, LPARAM lParam );
106         afx_msg LRESULT OnAppCbIeHitEnter(WPARAM wParam, LPARAM lParam );
107         afx_msg LRESULT OnSetmessagestring(WPARAM wParam, LPARAM lParam );
108         //}}AFX_MSG
109         DECLARE_MESSAGE_MAP()
110 private:
111         enum { MAX_THREADS=32 };
112         static UINT ThreadFunc (LPVOID pParam);
113         LPTVITEMDATA m_lptvid;
114         HANDLE m_hThreads[MAX_THREADS];
115         CWinThread *m_pThreads[MAX_THREADS];
116         CEvent m_event[MAX_THREADS];
117         int m_nThreadCount;
118         bool m_bRefreshAllowed;
119         bool m_bNotifyParent;
120         CIEShellDragDrop m_ShellDragDrop;
121         HWND m_hListWnd;
122         HWND m_hComboWnd;
123 };
124
125 /////////////////////////////////////////////////////////////////////////////
126 typedef struct DC_THREADINFO
127 {
128     HANDLE hEvent;
129     CIEShellTreeCtrl *pTreeCtrl;
130         CString sPath;
131 } DC_THREADINFO, *PDC_THREADINFO;
132
133
134 //{{AFX_INSERT_LOCATION}}
135 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
136
137 #endif //__IESHELLTREECTRL_H__