Updated with progress work.
[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 #if _MSC_VER > 1000
31 #pragma once
32 #endif // _MSC_VER > 1000
33
34
35
36 typedef struct _Entry {
37 struct _Entry* next;
38 struct _Entry* down;
39 struct _Entry* up;
40
41 BOOL expanded;
42 BOOL scanned;
43 int level;
44
45 WIN32_FIND_DATA data;
46
47 #ifndef _NO_EXTENSIONS
48 BY_HANDLE_FILE_INFORMATION bhfi;
49 BOOL bhfi_valid;
50 BOOL unix_dir;
51 #endif
52 } Entry;
53
54
55 typedef enum {
56 SORT_NAME,
57 SORT_EXT,
58 SORT_SIZE,
59 SORT_DATE
60 } SORT_ORDER;
61
62 //enum SORT_ORDER { SORT_BY_NAME, SORT_BY_TYPE, SORT_BY_SIZE, SORT_BY_DATE };
63
64 typedef struct {
65 Entry entry;
66 TCHAR path[MAX_PATH];
67 TCHAR volname[_MAX_FNAME];
68 TCHAR fs[_MAX_DIR];
69 DWORD drive_type;
70 DWORD fs_flags;
71 } Root;
72
73
74 typedef struct {
75 HWND hwnd;
76 #ifndef _NO_EXTENSIONS
77 HWND hwndHeader;
78 #endif
79
80 #ifndef _NO_EXTENSIONS
81 #define COLUMNS 10
82 #else
83 #define COLUMNS 5
84 #endif
85 int widths[COLUMNS];
86 int positions[COLUMNS+1];
87
88 BOOL treePane;
89 int visible_cols;
90 Entry* root;
91 Entry* cur;
92 } Pane;
93
94 typedef struct {
95 HWND hwnd;
96 Pane left;
97 Pane right;
98 int focus_pane; // 0: left 1: right
99 WINDOWPLACEMENT pos;
100 int split_pos;
101 BOOL header_wdths_ok;
102
103 TCHAR path[MAX_PATH];
104 Root root;
105
106 SORT_ORDER sortOrder;
107 } ChildWnd;
108
109
110 void insert_entries(Pane* pane, Entry* parent, int idx);
111 void scan_entry(ChildWnd* child, Entry* entry);
112 void activate_entry(ChildWnd* child, Pane* pane);
113 void collapse_entry(Pane* pane, Entry* dir);
114 BOOL expand_entry(ChildWnd* child, Entry* dir);
115 Entry* find_entry_win(Entry* parent, LPCTSTR name);
116 void free_entries(Entry* parent);
117 Entry* read_tree_win(Root* root, LPCTSTR path, int sortOrder);
118
119
120
121 #ifdef __cplusplus
122 };
123 #endif
124
125 #endif // __ENTRIES_H__