ReactOS  r74227
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 
29 enum ENTRY_TYPE {
31 #ifndef _NO_WIN_FS
33 #endif
34 #ifdef __WINE__
35  ET_UNIX,
36 #endif
42 };
43 
44 enum SORT_ORDER {
50 };
51 
52 enum SCAN_FLAGS {
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 
69  ICF_LARGE = 2,
70  ICF_OPEN = 4,
72  ICF_HICON = 16,
74 };
75 
76 #ifndef SHGFI_ADDOVERLAYS // missing in MinGW (as of 28.12.2005)
77 #define SHGFI_ADDOVERLAYS 0x000000020
78 #endif
79 
80 
82 struct Entry
83 {
84 protected:
85  Entry(ENTRY_TYPE etype);
86  Entry(Entry* parent, ENTRY_TYPE etype);
87  Entry(const Entry&);
88 
89 public:
90  virtual ~Entry();
91 
95 
96  bool _expanded;
97  bool _scanned;
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 
132 protected:
133  bool get_path_base(PTSTR path, size_t path_count, ENTRY_TYPE etype) const;
134 };
135 
136 
138 struct Directory {
139 protected:
141  virtual ~Directory() {}
142 
143  void* _path;
144 };
145 
146 
148 struct 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 };
Entry * _entry
Definition: entries.h:152
virtual ShellPath create_absolute_pidl() const
Definition: entries.h:126
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Entry * _next
Definition: entries.h:92
#define REFIID
Definition: guiddef.h:113
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
void read_directory_base(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0)
Definition: entries.cpp:143
DWORD _fs_flags
Definition: entries.h:157
ENTRY_TYPE
Definition: entries.h:29
Entry * _up
Definition: entries.h:94
virtual HRESULT GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID *ppvOut)
Definition: entries.cpp:581
WIN32_FIND_DATA _data
Definition: entries.h:100
REFIID riid
Definition: precomp.h:44
BY_HANDLE_FILE_INFORMATION _bhfi
Definition: entries.h:110
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
HWND hWnd
Definition: settings.c:17
SCAN_FLAGS
Definition: entries.h:52
HANDLE HWND
Definition: compat.h:13
IShellFolder smart pointer.
Definition: shellclasses.h:593
virtual bool get_path(PTSTR path, size_t path_count) const =0
DWORD _drive_type
Definition: entries.h:156
virtual HRESULT do_context_menu(HWND hwnd, const POINT &pos, CtxMenuInterfaces &cm_ifs)
Definition: entries.cpp:519
Entry * read_tree(LPCTSTR path, int scan_flags=0)
Definition: entries.cpp:761
#define _MAX_FNAME
Definition: utility.h:74
int _icon_id
Definition: entries.h:108
DWORD DWORD
Definition: winlogon.h:75
CHAR * LPTSTR
Definition: xmlstorage.h:192
bool _expanded
Definition: entries.h:96
SORT_ORDER _sort_order
Definition: entries.h:158
int extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL)
Definition: entries.cpp:365
bool _bhfi_valid
Definition: entries.h:111
virtual void read_directory(int scan_flags=0)
Definition: entries.h:122
virtual ~Entry()
Definition: entries.cpp:97
Entry(ENTRY_TYPE etype)
Definition: entries.cpp:35
LPTSTR _content
Definition: entries.h:105
smooth NULL
Definition: ftsmooth.c:464
Directory()
Definition: entries.h:140
void sort_directory(SORT_ORDER sortOrder)
Definition: entries.cpp:321
SORT_ORDER
Definition: entries.h:44
CHAR * PTSTR
Definition: xmlstorage.h:191
TCHAR _path[MAX_PATH]
Definition: entries.h:153
char TCHAR
Definition: xmlstorage.h:189
root entry for file system trees
Definition: entries.h:148
int safe_extract_icon(ICONCACHE_FLAGS flags=ICF_NORMAL)
Definition: entries.cpp:431
TCHAR _fs[_MAX_DIR]
Definition: entries.h:155
unsigned int BOOL
Definition: ntddk_ex.h:94
ENTRY_TYPE _etype
Definition: entries.h:107
virtual Entry * find_entry(const void *)
Definition: entries.h:124
void smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0)
Definition: entries.cpp:353
LONG HRESULT
Definition: typedefs.h:78
Entry * read_tree(const void *path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0)
Definition: entries.cpp:119
Entry * _down
Definition: entries.h:93
#define MAX_PATH
Definition: compat.h:26
Root()
Definition: entries.cpp:164
~Root()
Definition: entries.cpp:169
GLbitfield flags
Definition: glext.h:7161
Definition: msg.h:33
virtual const void * get_next_path_component(const void *) const
Definition: entries.h:123
virtual ~Directory()
Definition: entries.h:141
SFGAOF _shell_attribs
Definition: entries.h:102
ICONCACHE_FLAGS
Definition: entries.h:66
int _level
Definition: entries.h:98
Definition: entries.h:41
virtual BOOL launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL)
Definition: entries.cpp:443
LPTSTR _type_name
Definition: entries.h:104
#define SW_SHOWNORMAL
Definition: winuser.h:764
void * _path
Definition: entries.h:143
Definition: services.c:311
void free_subentries()
Definition: entries.cpp:743
unsigned int UINT
Definition: ndis.h:50
bool get_path_base(PTSTR path, size_t path_count, ENTRY_TYPE etype) const
Definition: entries.cpp:639
bool _scanned
Definition: entries.h:97
TCHAR _volname[_MAX_FNAME]
Definition: entries.h:154
base for all directory entries
Definition: entries.h:138
Definition: entries.h:40
virtual ShellFolder get_shell_folder() const
Definition: shellfs.cpp:237
wrapper class for item ID lists
Definition: shellclasses.h:651
base of all file and directory entries
Definition: entries.h:82
static IShellFolder IShellItem **static IBindCtx LPITEMIDLIST SFGAOF
Definition: ebrowser.c:78
#define _MAX_DIR
Definition: utility.h:75
LPTSTR _display_name
Definition: entries.h:103