remove empty dir
[reactos.git] / rosapps / winfile / entries.h
1 /*
2 * ReactOS winfile
3 *
4 * entries.h
5 *
6 * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23 #ifndef __ENTRIES_H__
24 #define __ENTRIES_H__
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30
31 typedef struct _Entry {
32 struct _Entry* next;
33 struct _Entry* down;
34 struct _Entry* up;
35
36 BOOL expanded;
37 BOOL scanned;
38 int level;
39
40 WIN32_FIND_DATA data;
41 HTREEITEM hTreeItem;
42
43 #ifndef _NO_EXTENSIONS
44 BY_HANDLE_FILE_INFORMATION bhfi;
45 BOOL bhfi_valid;
46 BOOL unix_dir;
47 #endif
48 } Entry;
49
50
51 typedef enum {
52 SORT_NAME,
53 SORT_EXT,
54 SORT_SIZE,
55 SORT_DATE
56 } SORT_ORDER;
57
58 //enum SORT_ORDER { SORT_BY_NAME, SORT_BY_TYPE, SORT_BY_SIZE, SORT_BY_DATE };
59
60 typedef struct {
61 Entry entry;
62 TCHAR path[MAX_PATH];
63 TCHAR volname[_MAX_FNAME];
64 TCHAR fs[_MAX_DIR];
65 DWORD drive_type;
66 DWORD fs_flags;
67 } Root;
68
69
70 typedef struct {
71 HWND hWnd;
72
73 #ifndef _NO_EXTENSIONS
74 #define COLUMNS 10
75 #else
76 #define COLUMNS 5
77 #endif
78 int widths[COLUMNS];
79 int positions[COLUMNS+1];
80
81 Entry* root;
82 Entry* cur;
83 } Pane;
84
85 typedef struct {
86 HWND hWnd;
87 HWND hTreeWnd;
88 HWND hListWnd;
89 int nFocusPanel; // 0: left 1: right
90 int nSplitPos;
91 WINDOWPLACEMENT pos;
92 TCHAR szPath[MAX_PATH];
93
94 // Root root;
95 Root* pRoot;
96 Pane left;
97 Pane right;
98 SORT_ORDER sortOrder;
99 int last_split;
100
101 } ChildWnd;
102
103
104 void insert_entries(HWND hWnd, Entry* parent, int idx);
105 void scan_entry(ChildWnd* child, Entry* entry);
106 void activate_entry(ChildWnd* child, Pane* pane);
107 void collapse_entry(Pane* pane, Entry* dir);
108 BOOL expand_entry(ChildWnd* child, Entry* dir);
109 Entry* find_entry_win(Entry* parent, LPCTSTR name);
110 void free_entries(Entry* parent);
111 Entry* read_tree_win(Root* root, LPCTSTR path, int sortOrder);
112
113
114
115 #ifdef __cplusplus
116 };
117 #endif
118
119 #endif // __ENTRIES_H__