ReactOS 0.4.15-dev-7918-g2a2556c
entries.h
Go to the documentation of this file.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19
20 //
21 // Explorer clone
22 //
23 // entries.h
24 //
25 // Martin Fuchs, 23.07.2003
26 //
27
28
31#ifndef _NO_WIN_FS
33#endif
34#ifdef __WINE__
35 ET_UNIX,
36#endif
41 ET_WEB
42};
43
50};
51
56};
57
58#ifndef ATTRIBUTE_SYMBOLIC_LINK
59#define ATTRIBUTE_LONGNAME 0x08000000
60#define ATTRIBUTE_VOLNAME 0x10000000
61#define ATTRIBUTE_ERASED 0x20000000
62#define ATTRIBUTE_SYMBOLIC_LINK 0x40000000
63#define ATTRIBUTE_EXECUTABLE 0x80000000
64#endif
65
73 ICF_SYSCACHE = 32
74};
75
76#ifndef SHGFI_ADDOVERLAYS // missing in MinGW (as of 28.12.2005)
77#define SHGFI_ADDOVERLAYS 0x000000020
78#endif
79
80
82struct Entry
83{
84protected:
85 Entry(ENTRY_TYPE etype);
87 Entry(const Entry&);
88
89public:
90 virtual ~Entry();
91
95
98 int _level;
99
101
106
108 int /*ICON_ID*/ _icon_id;
109
112
113 void free_subentries();
114
115 void read_directory_base(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0);
116 Entry* read_tree(const void* path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0);
117 void sort_directory(SORT_ORDER sortOrder);
118 void smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0);
121
122 virtual void read_directory(int scan_flags=0) {}
123 virtual const void* get_next_path_component(const void*) const {return NULL;}
124 virtual Entry* find_entry(const void*) {return NULL;}
125 virtual bool get_path(PTSTR path, size_t path_count) const = 0;
127 virtual HRESULT GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID* ppvOut);
128 virtual ShellFolder get_shell_folder() const;
129 virtual BOOL launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL);
130 virtual HRESULT do_context_menu(HWND hwnd, const POINT& pos, CtxMenuInterfaces& cm_ifs);
131
132protected:
133 bool get_path_base(PTSTR path, size_t path_count, ENTRY_TYPE etype) const;
134};
135
136
138struct Directory {
139protected:
141 virtual ~Directory() {}
142
143 void* _path;
144};
145
146
148struct Root {
149 Root();
150 ~Root();
151
159
160 Entry* read_tree(LPCTSTR path, int scan_flags=0);
161 Entry* read_tree(LPCITEMIDLIST pidl, int scan_flags=0);
162};
HWND hWnd
Definition: settings.c:17
#define NULL
Definition: types.h:112
#define MAX_PATH
Definition: compat.h:34
r parent
Definition: btrfs.c:3010
static IShellFolder IShellItem **static IBindCtx LPITEMIDLIST SFGAOF
Definition: ebrowser.c:83
ICONCACHE_FLAGS
Definition: entries.h:66
@ ICF_MIDDLE
Definition: entries.h:68
@ ICF_HICON
Definition: entries.h:72
@ ICF_LARGE
Definition: entries.h:69
@ ICF_SYSCACHE
Definition: entries.h:73
@ ICF_OVERLAYS
Definition: entries.h:71
@ ICF_OPEN
Definition: entries.h:70
@ ICF_NORMAL
Definition: entries.h:67
SCAN_FLAGS
Definition: entries.h:52
@ SCAN_DONT_EXTRACT_ICONS
Definition: entries.h:53
@ SCAN_NO_FILESYSTEM
Definition: entries.h:55
@ SCAN_DONT_ACCESS
Definition: entries.h:54
ENTRY_TYPE
Definition: entries.h:29
@ ET_UNKNOWN
Definition: entries.h:30
@ ET_FAT
Definition: entries.h:40
@ ET_REGISTRY
Definition: entries.h:39
@ ET_SHELL
Definition: entries.h:37
@ ET_WEB
Definition: entries.h:41
@ ET_NTOBJS
Definition: entries.h:38
@ ET_WINDOWS
Definition: entries.h:32
SORT_ORDER
Definition: entries.h:44
@ SORT_EXT
Definition: entries.h:47
@ SORT_SIZE
Definition: entries.h:48
@ SORT_DATE
Definition: entries.h:49
@ SORT_NONE
Definition: entries.h:45
@ SORT_NAME
Definition: entries.h:46
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
REFIID riid
Definition: atlbase.h:39
#define _MAX_FNAME
Definition: utility.h:74
#define _MAX_DIR
Definition: utility.h:75
unsigned int UINT
Definition: ndis.h:50
#define REFIID
Definition: guiddef.h:118
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
base for all directory entries
Definition: entries.h:138
virtual ~Directory()
Definition: entries.h:141
Directory()
Definition: entries.h:140
void * _path
Definition: entries.h:143
base of all file and directory entries
Definition: entries.h:83
LPTSTR _display_name
Definition: entries.h:103
int _icon_id
Definition: entries.h:108
SFGAOF _shell_attribs
Definition: entries.h:102
virtual BOOL launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL)
Definition: entries.cpp:443
void sort_directory(SORT_ORDER sortOrder)
Definition: entries.cpp:321
LPTSTR _type_name
Definition: entries.h:104
void free_subentries()
Definition: entries.cpp:743
ENTRY_TYPE _etype
Definition: entries.h:107
bool _expanded
Definition: entries.h:96
BY_HANDLE_FILE_INFORMATION _bhfi
Definition: entries.h:110
virtual Entry * find_entry(const void *)
Definition: entries.h:124
virtual void read_directory(int scan_flags=0)
Definition: entries.h:122
void read_directory_base(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0)
Definition: entries.cpp:143
LPTSTR _content
Definition: entries.h:105
virtual const void * get_next_path_component(const void *) const
Definition: entries.h:123
virtual HRESULT GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID *ppvOut)
Definition: entries.cpp:581
bool get_path_base(PTSTR path, size_t path_count, ENTRY_TYPE etype) const
Definition: entries.cpp:639
bool _bhfi_valid
Definition: entries.h:111
virtual HRESULT do_context_menu(HWND hwnd, const POINT &pos, CtxMenuInterfaces &cm_ifs)
Definition: entries.cpp:519
Entry * _down
Definition: entries.h:93
int extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL)
Definition: entries.cpp:365
virtual bool get_path(PTSTR path, size_t path_count) const =0
WIN32_FIND_DATA _data
Definition: entries.h:100
Entry * _up
Definition: entries.h:94
Entry * read_tree(const void *path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0)
Definition: entries.cpp:119
Entry * _next
Definition: entries.h:92
void smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0)
Definition: entries.cpp:353
virtual ~Entry()
Definition: entries.cpp:97
virtual ShellPath create_absolute_pidl() const
Definition: entries.h:126
int safe_extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL)
Definition: entries.cpp:431
int _level
Definition: entries.h:98
virtual ShellFolder get_shell_folder() const
Definition: shellfs.cpp:237
bool _scanned
Definition: entries.h:97
root entry for file system trees
Definition: entries.h:148
DWORD _fs_flags
Definition: entries.h:157
TCHAR _fs[_MAX_DIR]
Definition: entries.h:155
DWORD _drive_type
Definition: entries.h:156
SORT_ORDER _sort_order
Definition: entries.h:158
TCHAR _volname[_MAX_FNAME]
Definition: entries.h:154
Entry * read_tree(LPCTSTR path, int scan_flags=0)
Definition: entries.cpp:761
Entry * _entry
Definition: entries.h:152
Root()
Definition: entries.cpp:164
~Root()
Definition: entries.cpp:169
TCHAR _path[MAX_PATH]
Definition: entries.h:153
IShellFolder smart pointer.
Definition: shellclasses.h:594
wrapper class for item ID lists
Definition: shellclasses.h:652
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define SW_SHOWNORMAL
Definition: winuser.h:770
char TCHAR
Definition: xmlstorage.h:189
CHAR * PTSTR
Definition: xmlstorage.h:191
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
CHAR * LPTSTR
Definition: xmlstorage.h:192