This commit was manufactured by cvs2svn to create branch 'captive'.
[reactos.git] / subsys / system / explorer / Seashell / SeaShellExt / Include / UITreeCtrl.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_URLTREECTRL_H__9743E546_1F3A_11D2_A40D_9CB186000000__INCLUDED_)
19 #define AFX_URLTREECTRL_H__9743E546_1F3A_11D2_A40D_9CB186000000__INCLUDED_
20
21 #if _MSC_VER >= 1000
22 #pragma once
23 #endif // _MSC_VER >= 1000
24 // URLTreeCtrl.h : header file
25 //
26
27 /////////////////////////////////////////////////////////////////////////////
28 // CUITreeCtrl window
29 #include "UIFolderRefresh.h"
30 #include "UIDragDropTree.h"
31 #include "UIData.h"
32
33 class CTRL_EXT_CLASS CUITreeCtrl : public CUIDragDropTree
34 {
35         DECLARE_DYNAMIC(CUITreeCtrl)
36 // Construction
37 public:
38         CUITreeCtrl(bool bDragDrop=true);
39
40 // Attributes
41 public:
42         virtual void UpdateCurrentSelection();
43
44         void SetStyle(UINT nStyle);
45         void AddStyle(UINT nStyle);
46         DWORD GetItemData(HTREEITEM hItem) const;
47         BOOL SetItemData(HTREEITEM hItem,DWORD dwData,bool bAutoDelete=false);
48         void SetDefaultTextColor(HTREEITEM hItem);
49         void SetDefaultBkColor(HTREEITEM hItem);
50         void SetTextColor(HTREEITEM hItem,COLORREF TextColor);
51         void SetBkColor(HTREEITEM hItem,COLORREF BkColor);
52         void SetItemFont(HTREEITEM hItem,CFont *pFont);
53         void SetItemBold(HTREEITEM hItem,bool bBold);
54 // Operations
55 public:
56         virtual void Init();
57         virtual HTREEITEM AddAnItem(HTREEITEM hParent, LPCTSTR szText, LPARAM lParam, HTREEITEM hInsAfter,int iImage = 0,int iSelImage = 0,int nChildren = 0);
58         void SetPopupID(UINT nID);
59         void SetPopupWnd(CWnd *pWnd);
60 protected:
61         virtual void OnDeleteItemData(DWORD dwData);
62         virtual CUIListCtrlData *GetNewListCtrlData(DWORD dwData,HTREEITEM hParent);
63         virtual CUIListCtrlData *GetListCtrlData(HTREEITEM hItem) const;
64         virtual void ItemPostPaint(LPNMTVCUSTOMDRAW lptvcd,LRESULT *pResult);
65         virtual void ItemPrePaint(LPNMTVCUSTOMDRAW lptvcd,LRESULT *pResult);
66         virtual bool EndLabelEdit(HTREEITEM hItem,LPCTSTR pszText);
67         virtual HTREEITEM GetHitItem(CPoint *pt);
68         virtual UINT GetMenuID();
69         virtual CWnd *GetMenuWnd();
70         virtual bool Expanding(NM_TREEVIEW *nmtvw);
71         virtual bool Collapsing(NM_TREEVIEW *nmtvw);
72         virtual void UpdateEvent(LPARAM lHint,CObject *pHint);
73         virtual UINT GetIconID();
74         virtual UINT GetOpenIconID();
75         virtual void DoubleClick(HTREEITEM hItem);
76         virtual void SelectionChanged(HTREEITEM hItem,LPARAM lParam);
77         virtual CRefresh *CreateRefreshObject(HTREEITEM hItem,LPARAM lParam);
78         // OLE Drag and Drop
79         // This called when a drop source is dropped on the list control
80         virtual bool DragDrop(CDD_OleDropTargetInfo *pInfo);
81         // This called when a drop source is currently over the list control
82         // This called when a drop source is currently over the list control
83         virtual bool DragOver(CDD_OleDropTargetInfo *pInfo);
84         virtual bool DragEnter(CDD_OleDropTargetInfo *pInfo);
85         virtual bool DragLeave(CDD_OleDropTargetInfo *pInfo);
86         // This called when the user initiates a OLE drag and drop
87         virtual DROPEFFECT DoDragDrop(NM_TREEVIEW* pNMTreeView,COleDataSource *pOleDataSource);
88         virtual void DeleteKey(HTREEITEM hItem);
89         virtual void ShowPopupMenu(HTREEITEM hItem,CPoint point);
90         virtual void ShowProperties(HTREEITEM hItem);
91         virtual void Refresh();
92         virtual void GoBack(HTREEITEM hItem);
93 // Overrides
94         // ClassWizard generated virtual function overrides
95         //{{AFX_VIRTUAL(CUITreeCtrl)
96         public:
97         virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
98         virtual BOOL PreTranslateMessage(MSG* pMsg);
99         //}}AFX_VIRTUAL
100
101 // Implementation
102 public:
103         virtual ~CUITreeCtrl();
104
105         // Generated message map functions
106 protected:
107         //{{AFX_MSG(CUITreeCtrl)
108         afx_msg BOOL OnDblclk(NMHDR* pNMHDR, LRESULT* pResult);
109         afx_msg BOOL OnReturn(NMHDR* pNMHDR, LRESULT* pResult);
110         afx_msg BOOL OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
111         afx_msg BOOL OnItemExpanded(NMHDR* pNMHDR, LRESULT* pResult);
112         afx_msg BOOL OnItemExpanding(NMHDR* pNMHDR, LRESULT* pResult);
113         afx_msg BOOL OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult);
114         afx_msg BOOL OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
115         afx_msg BOOL OnEndLabelEdit(NMHDR* pNMHDR, LRESULT* pResult);
116         afx_msg BOOL OnDeleteItem(NMHDR* pNMHDR, LRESULT* pResult);
117         afx_msg void OnKeydownFolder(NMHDR* pNMHDR, LRESULT* pResult);
118
119         afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
120         afx_msg void OnTimer(UINT nIDEvent);
121         afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
122         afx_msg LRESULT OnTVMGetItem(WPARAM wParam,LPARAM lParam);
123         afx_msg LRESULT OnTVMSetItem(WPARAM wParam,LPARAM lParam);
124         afx_msg LRESULT OnTVMInsertItem(WPARAM wParam,LPARAM lParam);
125         //}}AFX_MSG
126         afx_msg LRESULT OnAppPropertiesKey(WPARAM wParam, LPARAM lParam );
127         afx_msg LRESULT OnAppDeleteKey(WPARAM wParam, LPARAM lParam );
128         afx_msg LRESULT OnAppRefreshKey(WPARAM wParam, LPARAM lParam );
129         afx_msg LRESULT OnAppBackspaceKey(WPARAM wParam, LPARAM lParam );
130         afx_msg LRESULT OnAppContextMenuKey(WPARAM wParam, LPARAM lParam );
131         afx_msg LRESULT OnAppEditKey(WPARAM wParam, LPARAM lParam );
132
133         afx_msg LRESULT OnTimerSelChange(WPARAM wParam,LPARAM lParam);
134         afx_msg LRESULT OnDragDrop(WPARAM wParam,LPARAM lParam);
135         afx_msg LRESULT OnDragOver(WPARAM wParam,LPARAM lParam);
136         afx_msg LRESULT OnDragEnter(WPARAM wParam,LPARAM lParam);
137         afx_msg LRESULT OnDragLeave(WPARAM wParam,LPARAM lParam);
138         afx_msg LRESULT OnDDDoDragDrop(WPARAM wParam,LPARAM lParam);
139
140         DECLARE_MESSAGE_MAP()
141 protected:
142         int m_idxClosed;
143         int m_idxOpen;
144         WORD m_vkeydown;
145 private:
146         CImageList m_ImageList;
147         NM_TREEVIEW m_NMTreeView;
148         LPARAM m_lParam;
149         UINT m_IDTimer;
150         UINT m_style;
151         HFONT m_hOrigFont;
152         bool m_bMe;
153 protected:
154         CWnd *m_pPopupWnd;
155         UINT m_PopupID;
156 };
157
158 inline void CUITreeCtrl::SetStyle(UINT nStyle)
159 {
160         m_style = nStyle;
161 }
162
163 inline void CUITreeCtrl::AddStyle(UINT nStyle)
164 {
165         m_style |= nStyle;
166 }
167
168 /////////////////////////////////////////////////////////////////////////////
169
170 //{{AFX_INSERT_LOCATION}}
171 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
172
173 #endif // !defined(AFX_URLTREECTRL_H__9743E546_1F3A_11D2_A40D_9CB186000000__INCLUDED_)