2 * Copyright 2003, 2004 Martin Fuchs
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.
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.
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
25 // Martin Fuchs, 23.07.2003
53 SCAN_DONT_EXTRACT_ICONS
= 1,
55 SCAN_NO_FILESYSTEM
= 4
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
66 enum ICONCACHE_FLAGS
{
76 #ifndef SHGFI_ADDOVERLAYS // missing in MinGW (as of 28.12.2005)
77 #define SHGFI_ADDOVERLAYS 0x000000020
81 /// base of all file and directory entries
85 Entry(ENTRY_TYPE etype
);
86 Entry(Entry
* parent
, ENTRY_TYPE etype
);
100 WIN32_FIND_DATA _data
;
102 SFGAOF _shell_attribs
;
103 LPTSTR _display_name
;
108 int /*ICON_ID*/ _icon_id
;
110 BY_HANDLE_FILE_INFORMATION _bhfi
;
113 void free_subentries();
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);
119 int extract_icon(ICONCACHE_FLAGS flags
=ICF_NORMAL
);
120 int safe_extract_icon(ICONCACHE_FLAGS flags
=ICF_NORMAL
);
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;
126 virtual ShellPath
create_absolute_pidl() const {return (LPCITEMIDLIST
)NULL
;}
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
);
133 bool get_path_base(PTSTR path
, size_t path_count
, ENTRY_TYPE etype
) const;
137 /// base for all directory entries
140 Directory() : _path(NULL
) {}
141 virtual ~Directory() {}
147 /// root entry for file system trees
153 TCHAR _path
[MAX_PATH
];
154 TCHAR _volname
[_MAX_FNAME
];
158 SORT_ORDER _sort_order
;
160 Entry
* read_tree(LPCTSTR path
, int scan_flags
=0);
161 Entry
* read_tree(LPCITEMIDLIST pidl
, int scan_flags
=0);