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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 // Martin Fuchs, 23.07.2003
51 // SCAN_EXTRACT_ICONS = 1,
59 #ifndef ATTRIBUTE_SYMBOLIC_LINK
60 #define ATTRIBUTE_LONGNAME 0x08000000
61 #define ATTRIBUTE_VOLNAME 0x10000000
62 #define ATTRIBUTE_ERASED 0x20000000
63 #define ATTRIBUTE_SYMBOLIC_LINK 0x40000000
64 #define ATTRIBUTE_EXECUTABLE 0x80000000
68 /// base of all file and directory entries
72 Entry(ENTRY_TYPE etype
);
73 Entry(Entry
* parent
, ENTRY_TYPE etype
);
87 WIN32_FIND_DATA _data
;
89 SFGAOF _shell_attribs
;
95 int /*ICON_ID*/ _icon_id
;
97 BY_HANDLE_FILE_INFORMATION _bhfi
;
100 void free_subentries();
102 void read_directory_base(SORT_ORDER sortOrder
=SORT_NAME
, int scan_flags
=SCAN_ALL
);
103 Entry
* read_tree(const void* path
, SORT_ORDER sortOrder
=SORT_NAME
, int scan_flags
=SCAN_ALL
);
104 void sort_directory(SORT_ORDER sortOrder
);
105 void smart_scan(SORT_ORDER sortOrder
=SORT_NAME
, int scan_flags
=SCAN_ALL
);
106 void extract_icon(bool big_icons
);
108 virtual void read_directory(int scan_flags
=SCAN_ALL
) {}
109 virtual const void* get_next_path_component(const void*) const {return NULL
;}
110 virtual Entry
* find_entry(const void*) {return NULL
;}
111 virtual bool get_path(PTSTR path
, size_t path_count
) const = 0;
112 virtual ShellPath
create_absolute_pidl() const {return (LPCITEMIDLIST
)NULL
;}
113 virtual HRESULT
GetUIObjectOf(HWND hWnd
, REFIID riid
, LPVOID
* ppvOut
);
114 virtual BOOL
launch_entry(HWND hwnd
, UINT nCmdShow
=SW_SHOWNORMAL
);
115 virtual HRESULT
do_context_menu(HWND hwnd
, const POINT
& pos
, CtxMenuInterfaces
& cm_ifs
);
118 bool get_path_base(PTSTR path
, size_t path_count
, ENTRY_TYPE etype
) const;
122 /// base for all directory entries
125 Directory() : _path(NULL
) {}
126 virtual ~Directory() {}
132 /// root entry for file system trees
138 TCHAR _path
[MAX_PATH
];
139 TCHAR _volname
[_MAX_FNAME
];
143 SORT_ORDER _sort_order
;
145 Entry
* read_tree(LPCTSTR path
, int scan_flags
=SCAN_ALL
);
146 Entry
* read_tree(LPCITEMIDLIST pidl
, int scan_flags
=SCAN_ALL
);