update for HEAD-2003091401
[reactos.git] / subsys / system / explorer / Seashell / SeaShellExt / Include / IEShellComboBox.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
19 #if !defined(AFX_IESHELLCOMBOBOX_H__1EABA279_32DD_4A2D_8957_F478E4D3E5EB__INCLUDED_)
20 #define AFX_IESHELLCOMBOBOX_H__1EABA279_32DD_4A2D_8957_F478E4D3E5EB__INCLUDED_
21
22 #if _MSC_VER > 1000
23 #pragma once
24 #endif // _MSC_VER > 1000
25 // IEShellComboBox.h : header file
26 //
27 #include "ShellContextMenu.h"
28 #include "ShellPidl.h"
29 #include "Refresh.h"
30
31 ////////////////////////////////////////////////
32 // CIEShellComboBoxEdit
33 ////////////////////////////////////////////////
34 class CIEShellComboBoxEdit : public CEdit
35 {
36 public:
37         CIEShellComboBoxEdit();
38         virtual ~CIEShellComboBoxEdit();
39
40 public:
41         CString &GetText() { GetWindowText(m_sText); return m_sText; }
42         void SetTreeWnd(HWND hWnd);  
43         virtual BOOL PreTranslateMessage(MSG* pMsg);
44 protected:
45 private:
46         CString m_sText;
47         HWND m_hTreeWnd;        
48 };
49
50 inline CIEShellComboBoxEdit::CIEShellComboBoxEdit()
51 {
52         m_hTreeWnd = NULL;
53 }
54
55 inline CIEShellComboBoxEdit::~CIEShellComboBoxEdit()
56 {
57
58 }
59
60 inline void CIEShellComboBoxEdit::SetTreeWnd(HWND hWnd)
61 {
62         m_hTreeWnd = hWnd;
63 }
64
65 /////////////////////////////////////////////////////////////////////////////
66 // CIEShellComboBox window
67
68 class CTRL_EXT_CLASS CIEShellComboBox : public CComboBoxEx
69 {
70 // Construction
71 public:
72         CIEShellComboBox();
73
74 // Attributes
75 public:
76         CShellPidl &GetShellPidl() { return m_ShellPidl; }
77         LPITEMIDLIST GetSelectedPidl();
78         void SetTreeCtrlWnd(HWND hWnd) { m_hTreeWnd = hWnd; }
79 // Operations
80 public:
81         void Populate(LPITEMIDLIST pidlAbsSel=NULL);
82 protected:
83         void BuildFolderList(LPSHELLFOLDER pFolder,LPITEMIDLIST pidl,LPITEMIDLIST pidlAbsSel,int nIndent);
84         void InitItems(LPITEMIDLIST pidlAbsSel);
85         void LoadItems(LPITEMIDLIST pidlAbsSel);
86         void LoadURLPrevList();
87         void SetShellImageList();
88         int AddItem(const CShCMSort *pItem);
89         void DeleteItemData(LPTVITEMDATA pItemData);
90         void DeleteAllItemData();
91         void AddItems(vecCMSort &vItems,IShellFolder* pFolder,LPITEMIDLIST pidlAbs,int nIndent);
92         void AddFolder(vecCMSort &vItems,const SHFILEINFO &FileInfo,LPITEMIDLIST pidlAbs,LPITEMIDLIST pidl,LPSHELLFOLDER pFolder,int nIndent);
93         void SelectionChanged(bool bEnter=false);
94
95 // Overrides
96         // ClassWizard generated virtual function overrides
97         //{{AFX_VIRTUAL(CIEShellComboBox)
98         public:
99         virtual void PreSubclassWindow();
100         //}}AFX_VIRTUAL
101
102 // Implementation
103 public:
104         virtual ~CIEShellComboBox();
105
106         // Generated message map functions
107 protected:
108         //{{AFX_MSG(CIEShellComboBox)
109         afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
110         afx_msg void OnDestroy();
111         afx_msg void OnKillFocus(CWnd *pNewWnd);
112         afx_msg void OnSetFocus(CWnd *pWnd);
113         afx_msg void OnDropDown();
114         afx_msg void OnSelChange();
115         afx_msg LRESULT OnCBIEPopulate(WPARAM wParam,LPARAM lParam);
116         afx_msg LRESULT OnAppCbIeHitEnter(WPARAM wParam, LPARAM lParam );
117         //}}AFX_MSG
118
119         DECLARE_MESSAGE_MAP()
120 private:
121         LPMALLOC     m_pMalloc;
122         LPITEMIDLIST m_pidlMyComputer;
123         LPITEMIDLIST m_pidlMyDocuments;
124         LPITEMIDLIST m_pidlInternet;
125         CShellPidl   m_ShellPidl;
126         vecItemData  m_vecItemData;
127         vecCMSort    m_vItems;
128     HIMAGELIST   m_hImageList;
129         CImageList       m_ImageList;
130         HWND             m_hTreeWnd;    
131         HICON            m_hIcon;
132         CIEShellComboBoxEdit m_cbEdit;
133         CString          m_sText;
134         bool             m_bInternet;
135 };
136
137 /////////////////////////////////////////////////////////////////////////////
138
139 //{{AFX_INSERT_LOCATION}}
140 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
141
142 #endif // !defined(AFX_IESHELLCOMBOBOX_H__1EABA279_32DD_4A2D_8957_F478E4D3E5EB__INCLUDED_)