reinitialize image list in ShellBrowser::invalidate_cache()
[reactos.git] / reactos / subsys / system / explorer / shell / filechild.h
1 /*
2 * Copyright 2003, 2004 Martin Fuchs
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19
20 //
21 // Explorer clone
22 //
23 // filechild.h
24 //
25 // Martin Fuchs, 23.07.2003
26 //
27
28
29 /// information structure for creation of FileChildWindow
30 struct FileChildWndInfo : public ChildWndInfo
31 {
32 typedef ChildWndInfo super;
33
34 FileChildWndInfo(HWND hmdiclient, LPCTSTR path, ENTRY_TYPE etype=ET_UNKNOWN);
35
36 ENTRY_TYPE _etype;
37 LPCTSTR _path;
38
39 WINDOWPLACEMENT _pos;
40 int _open_mode; //OPEN_WINDOW_MODE
41 };
42
43 /// information structure for creation of MDIShellBrowserChild
44 struct ShellChildWndInfo : public FileChildWndInfo
45 {
46 typedef FileChildWndInfo super;
47
48 ShellChildWndInfo(HWND hmdiclient, LPCTSTR path, const ShellPath& root_shell_path);
49
50 ShellPath _shell_path;
51 ShellPath _root_shell_path;
52 };
53
54 /// information structure for creation of FileChildWindow for NT object namespace
55 struct NtObjChildWndInfo : public FileChildWndInfo
56 {
57 typedef FileChildWndInfo super;
58
59 NtObjChildWndInfo(HWND hmdiclient, LPCTSTR path);
60 };
61
62 /// information structure for creation of FileChildWindow for the Registry
63 struct RegistryChildWndInfo : public FileChildWndInfo
64 {
65 typedef FileChildWndInfo super;
66
67 RegistryChildWndInfo(HWND hmdiclient, LPCTSTR path);
68 };
69
70 /// information structure for creation of FileChildWindow
71 struct FATChildWndInfo : public FileChildWndInfo
72 {
73 typedef FileChildWndInfo super;
74
75 FATChildWndInfo(HWND hmdiclient, LPCTSTR path);
76 };
77
78 /// information structure for creation of WebChildWindow
79 struct WebChildWndInfo : public FileChildWndInfo
80 {
81 typedef FileChildWndInfo super;
82
83 WebChildWndInfo(HWND hmdiclient, LPCTSTR url);
84 };
85
86
87 /// MDI child window displaying file lists
88 struct FileChildWindow : public ExtContextMenuHandlerT<ChildWindow>
89 {
90 typedef ExtContextMenuHandlerT<ChildWindow> super;
91
92 FileChildWindow(HWND hwnd, const FileChildWndInfo& info);
93
94 static FileChildWindow* create(const FileChildWndInfo& info);
95
96 protected:
97 LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
98 int Command(int id, int code);
99 int Notify(int id, NMHDR* pnmh);
100
101 virtual void resize_children(int cx, int cy);
102 virtual String jump_to_int(LPCTSTR url);
103
104 void scan_entry(Entry* entry);
105
106 bool expand_entry(Entry* dir);
107 static void collapse_entry(Pane* pane, Entry* dir);
108
109 void set_curdir(Entry* entry);
110 void activate_entry(Pane* pane);
111
112 protected:
113 Root _root;
114 Pane* _left;
115 Pane* _right;
116 TCHAR _path[MAX_PATH];
117 bool _header_wdths_ok;
118
119 public:
120 const Root& get_root() const {return _root;}
121
122 void set_focus_pane(Pane* pane)
123 {_focus_pane = pane==_right? 1: 0;}
124
125 void switch_focus_pane()
126 {SetFocus(_focus_pane? *_left: *_right);}
127 };
128
129
130 /// The "Execute..."-dialog lets the user enter a command line to launch.
131 struct ExecuteDialog { ///@todo use class Dialog
132 TCHAR cmd[MAX_PATH];
133 int cmdshow;
134
135 static INT_PTR CALLBACK WndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam);
136 };