update for HEAD-2003091401
[reactos.git] / subsys / system / explorer / Seashell / SeaShellExt / Include / IEFolderTreeCtrl.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 #if !defined(AFX_IEFOLDERTREECTRL_H__9743E545_1F3A_11D2_A40D_9CB186000000__INCLUDED_)
19 #define AFX_IEFOLDERTREECTRL_H__9743E545_1F3A_11D2_A40D_9CB186000000__INCLUDED_
20
21 #if _MSC_VER >= 1000
22 #pragma once
23 #endif // _MSC_VER >= 1000
24 // IEFolderTreeCtrl.h : header file
25 //
26 #include "ShellPidl.h"
27 #include "ShellSettings.h"
28 #include "Refresh.h"
29 #include "UITreeCtrl.h"
30 /////////////////////////////////////////////////////////////////////////////
31 // CIEFolderTreeCtrl window
32 #include <shlobj.h>
33
34 class CTRL_EXT_CLASS CIEFolderTreeCtrl : public CUITreeCtrl
35 {
36 // Construction
37 public:
38         CIEFolderTreeCtrl();
39
40 // Attributes
41 public:
42         CShellPidl &GetShellPidl();
43         CString GetRootPath();
44         void SetRootPath(const CString &sPath);
45         const CShellSettings &GetShellSettings() const;
46         CShellSettings &GetShellSettings();
47         virtual LPCITEMIDLIST GetPathPidl(HTREEITEM hItem);
48         virtual CString GetPathName(HTREEITEM hItem=NULL);
49
50 // Operations
51 public:
52         virtual void Sort(HTREEITEM hParent,LPSHELLFOLDER pFolder);
53         virtual void Refresh();
54 protected:
55         virtual LPSHELLFOLDER GetItemFolder(HTREEITEM hItem);
56         virtual HTREEITEM AddFolder(HTREEITEM hItem,LPITEMIDLIST pidl,LPSHELLFOLDER pFolder);
57         virtual HTREEITEM AddFolder(HTREEITEM hItem,LPCTSTR pszPath);
58         virtual bool LoadItems(LPCTSTR pszPath=NULL,DWORD dwFolderType=0);
59         virtual bool AddItems(HTREEITEM hItem,IShellFolder* pFolder);
60         virtual void OnDeleteItemData(DWORD dwData);
61         virtual void SetButtonState(HTREEITEM hItem);
62         virtual void RefreshNode(HTREEITEM hItem);
63         virtual void SetAttributes(HTREEITEM hItem,LPSHELLFOLDER pFolder,LPITEMIDLIST pidl);
64
65 // Overrides
66         // ClassWizard generated virtual function overrides
67         //{{AFX_VIRTUAL(CIEFolderTreeCtrl)
68         public:
69         virtual void Init();
70         protected:
71         virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
72         virtual void CalcWindowRect(LPRECT lpClientRect, UINT nAdjustType = adjustBorder);
73         //}}AFX_VIRTUAL
74         virtual BOOL LoadURL(HTREEITEM hItem);
75
76 // Implementation
77 public:
78         virtual ~CIEFolderTreeCtrl();
79
80         // Generated message map functions
81 protected:
82         static int CALLBACK CompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
83         //{{AFX_MSG(CIEFolderTreeCtrl)
84         afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
85         afx_msg void OnDeleteItem(NMHDR* pNMHDR, LRESULT* pResult);
86         afx_msg LRESULT OnSettingChange(WPARAM wParam,LPARAM lParam);
87         afx_msg void OnDestroy();
88         //}}AFX_MSG
89
90         DECLARE_MESSAGE_MAP()
91 private:
92         IMalloc* m_pMalloc;
93         CShellPidl m_ShellPidl;
94         CString m_sRootPath;
95     HIMAGELIST  m_hImageList;
96         CShellSettings m_ShellSettings;
97 };
98
99 inline const CShellSettings &CIEFolderTreeCtrl::GetShellSettings() const
100 {
101         return m_ShellSettings;
102 }
103
104 inline CShellSettings &CIEFolderTreeCtrl::GetShellSettings()
105 {
106         return m_ShellSettings;
107 }
108
109 inline CString CIEFolderTreeCtrl::GetRootPath()
110 {
111         return m_sRootPath;
112 }
113
114 inline void CIEFolderTreeCtrl::SetRootPath(const CString &sPath)
115 {
116         m_sRootPath = sPath;
117 }
118
119 inline CShellPidl &CIEFolderTreeCtrl::GetShellPidl()
120 {
121         return m_ShellPidl;
122 }
123 /////////////////////////////////////////////////////////////////////////////
124
125 //{{AFX_INSERT_LOCATION}}
126 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
127
128 #endif // !defined(AFX_IEFOLDERTREECTRL_H__9743E545_1F3A_11D2_A40D_9CB186000000__INCLUDED_)