ReactOS  0.4.14-dev-77-gd9e7c48
ShellEntry Struct Reference

shell file/directory entry More...

#include <shellfs.h>

Inheritance diagram for ShellEntry:
Collaboration diagram for ShellEntry:

Public Member Functions

 ShellEntry (Entry *parent, LPITEMIDLIST shell_path)
 
 ShellEntry (Entry *parent, const ShellPath &shell_path)
 
virtual bool get_path (PTSTR path, size_t path_count) const
 
virtual ShellPath create_absolute_pidl () const
 
virtual HRESULT GetUIObjectOf (HWND hWnd, REFIID riid, LPVOID *ppvOut)
 
virtual BOOL launch_entry (HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL)
 
virtual HRESULT do_context_menu (HWND hwnd, const POINT &pptScreen, CtxMenuInterfaces &cm_ifs)
 
virtual ShellFolder get_shell_folder () const
 
IShellFolderget_parent_folder () const
 
- Public Member Functions inherited from Entry
virtual ~Entry ()
 
void free_subentries ()
 
void read_directory_base (SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0)
 
Entryread_tree (const void *path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0)
 
void sort_directory (SORT_ORDER sortOrder)
 
void smart_scan (SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0)
 
int extract_icon (ICONCACHE_FLAGS flags=ICF_NORMAL)
 
int safe_extract_icon (ICONCACHE_FLAGS flags=ICF_NORMAL)
 
virtual void read_directory (int scan_flags=0)
 
virtual const voidget_next_path_component (const void *) const
 
virtual Entryfind_entry (const void *)
 

Public Attributes

ShellPath _pidl
 
- Public Attributes inherited from Entry
Entry_next
 
Entry_down
 
Entry_up
 
bool _expanded
 
bool _scanned
 
int _level
 
WIN32_FIND_DATA _data
 
SFGAOF _shell_attribs
 
LPTSTR _display_name
 
LPTSTR _type_name
 
LPTSTR _content
 
ENTRY_TYPE _etype
 
int _icon_id
 
BY_HANDLE_FILE_INFORMATION _bhfi
 
bool _bhfi_valid
 

Protected Member Functions

 ShellEntry (LPITEMIDLIST shell_path)
 
 ShellEntry (const ShellPath &shell_path)
 
- Protected Member Functions inherited from Entry
 Entry (ENTRY_TYPE etype)
 
 Entry (Entry *parent, ENTRY_TYPE etype)
 
 Entry (const Entry &)
 
bool get_path_base (PTSTR path, size_t path_count, ENTRY_TYPE etype) const
 

Detailed Description

shell file/directory entry

Definition at line 30 of file shellfs.h.

Constructor & Destructor Documentation

◆ ShellEntry() [1/4]

ShellEntry::ShellEntry ( Entry parent,
LPITEMIDLIST  shell_path 
)
inline

Definition at line 32 of file shellfs.h.

32 : Entry(parent, ET_SHELL), _pidl(shell_path) {}
Entry(ENTRY_TYPE etype)
Definition: entries.cpp:35
r parent
Definition: btrfs.c:2897
ShellPath _pidl
Definition: shellfs.h:44

Referenced by ShellDirectory::read_directory().

◆ ShellEntry() [2/4]

ShellEntry::ShellEntry ( Entry parent,
const ShellPath shell_path 
)
inline

Definition at line 33 of file shellfs.h.

33 : Entry(parent, ET_SHELL), _pidl(shell_path) {}
Entry(ENTRY_TYPE etype)
Definition: entries.cpp:35
r parent
Definition: btrfs.c:2897
ShellPath _pidl
Definition: shellfs.h:44

◆ ShellEntry() [3/4]

ShellEntry::ShellEntry ( LPITEMIDLIST  shell_path)
inlineprotected

Definition at line 47 of file shellfs.h.

47 : Entry(ET_SHELL), _pidl(shell_path) {}
Entry(ENTRY_TYPE etype)
Definition: entries.cpp:35
ShellPath _pidl
Definition: shellfs.h:44

◆ ShellEntry() [4/4]

ShellEntry::ShellEntry ( const ShellPath shell_path)
inlineprotected

Definition at line 48 of file shellfs.h.

48 : Entry(ET_SHELL), _pidl(shell_path) {}
Entry(ENTRY_TYPE etype)
Definition: entries.cpp:35
ShellPath _pidl
Definition: shellfs.h:44

Member Function Documentation

◆ create_absolute_pidl()

ShellPath ShellEntry::create_absolute_pidl ( ) const
virtual

Reimplemented from Entry.

Definition at line 114 of file shellfs.cpp.

115 {
116  CONTEXT("ShellEntry::create_absolute_pidl()");
117 
118  if (_up)
119  {
120  if (_up->_etype == ET_SHELL) {
121  ShellDirectory* dir = static_cast<ShellDirectory*>(_up);
122 
123  if (dir->_pidl->mkid.cb) // Caching of absolute PIDLs could enhance performance.
124  return _pidl.create_absolute_pidl(dir->create_absolute_pidl());
125  } else
127  }
128  return _pidl;
129 }
virtual ShellPath create_absolute_pidl() const
Definition: entries.h:126
struct _CONTEXT CONTEXT
Entry * _up
Definition: entries.h:94
shell folder entry
Definition: shellfs.h:53
unsigned int dir
Definition: maze.c:112
ENTRY_TYPE _etype
Definition: entries.h:107
ShellPath _pidl
Definition: shellfs.h:44
ShellPath create_absolute_pidl(LPCITEMIDLIST parent_pidl) const

Referenced by get_path(), ShellBrowser::jump_to(), and launch_entry().

◆ do_context_menu()

HRESULT ShellEntry::do_context_menu ( HWND  hwnd,
const POINT pptScreen,
CtxMenuInterfaces cm_ifs 
)
virtual

Reimplemented from Entry.

Definition at line 218 of file shellfs.cpp.

219 {
220  ShellDirectory* dir = static_cast<ShellDirectory*>(_up);
221 
222  ShellFolder folder = dir? dir->_folder: GetDesktopFolder();
223  LPCITEMIDLIST pidl = _pidl;
224 
225  return ShellFolderContextMenu(folder, hwnd, 1, &pidl, pptScreen.x, pptScreen.y, cm_ifs);
226 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Definition: fci.c:115
long y
Definition: polytest.cpp:48
Entry * _up
Definition: entries.h:94
long x
Definition: polytest.cpp:48
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
shell folder entry
Definition: shellfs.h:53
IShellFolder smart pointer.
Definition: shellclasses.h:593
unsigned int dir
Definition: maze.c:112
ShellPath _pidl
Definition: shellfs.h:44
ShellFolder & GetDesktopFolder()
HRESULT ShellFolderContextMenu(IShellFolder *shell_folder, HWND hwndParent, int cidl, LPCITEMIDLIST *apidl, int x, int y, CtxMenuInterfaces &cm_ifs)

◆ get_parent_folder()

IShellFolder * ShellEntry::get_parent_folder ( ) const
inline

Definition at line 120 of file shellfs.h.

121 {
122  if (_up)
123  return static_cast<ShellDirectory*>(_up)->_folder;
124  else
125  return GetDesktopFolder();
126 }
Entry * _up
Definition: entries.h:94
ShellFolder & GetDesktopFolder()

Referenced by ShellDirectory::get_path(), get_shell_folder(), and GetUIObjectOf().

◆ get_path()

bool ShellEntry::get_path ( PTSTR  path,
size_t  path_count 
) const
virtual

Implements Entry.

Reimplemented in ShellDirectory.

Definition at line 133 of file shellfs.cpp.

134 {
135  if (!path || path_count==0)
136  return false;
137 /*
138  path[0] = TEXT('\0');
139 
140  if (FAILED(path_from_pidl(get_parent_folder(), &*_pidl, path, path_count)))
141  return false;
142 */
144  LPCTSTR ret = fs_path;
145 
146  if (ret) {
147  lstrcpyn(path, ret, path_count);
148  return true;
149  } else
150  return false;
151 }
virtual ShellPath create_absolute_pidl() const
Definition: shellfs.cpp:114
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
Retrieval of file system paths of ShellPath objects.
Definition: shellclasses.h:932
int ret
Definition: services.c:325
#define lstrcpyn
Definition: winbase.h:3692

◆ get_shell_folder()

ShellFolder ShellEntry::get_shell_folder ( ) const
virtual

Reimplemented from Entry.

Reimplemented in ShellDirectory.

Definition at line 242 of file shellfs.cpp.

243 {
244  return get_parent_folder();
245 }
IShellFolder * get_parent_folder() const
Definition: shellfs.h:120

◆ GetUIObjectOf()

HRESULT ShellEntry::GetUIObjectOf ( HWND  hWnd,
REFIID  riid,
LPVOID ppvOut 
)
virtual

Reimplemented from Entry.

Definition at line 229 of file shellfs.cpp.

230 {
231  LPCITEMIDLIST pidl = _pidl;
232 
233  return get_parent_folder()->GetUIObjectOf(hWnd, 1, &pidl, riid, NULL, ppvOut);
234 }
REFIID riid
Definition: precomp.h:44
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
HWND hWnd
Definition: settings.c:17
smooth NULL
Definition: ftsmooth.c:416
IShellFolder * get_parent_folder() const
Definition: shellfs.h:120
ShellPath _pidl
Definition: shellfs.h:44
HRESULT GetUIObjectOf([in] HWND hwndOwner, [in] UINT cidl, [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in] REFIID riid, [in, out, unique] UINT *prgfInOut, [out, iid_is(riid)] void **ppvOut)

◆ launch_entry()

BOOL ShellEntry::launch_entry ( HWND  hwnd,
UINT  nCmdShow = SW_SHOWNORMAL 
)
virtual

Reimplemented from Entry.

Definition at line 186 of file shellfs.cpp.

187 {
188  CONTEXT("ShellEntry::launch_entry()");
189 
190  SHELLEXECUTEINFO shexinfo;
191 
192  shexinfo.cbSize = sizeof(SHELLEXECUTEINFO);
193  shexinfo.fMask = SEE_MASK_INVOKEIDLIST; // SEE_MASK_IDLIST is also possible.
194  shexinfo.hwnd = hwnd;
195  shexinfo.lpVerb = NULL;
196  shexinfo.lpFile = NULL;
197  shexinfo.lpParameters = NULL;
198  shexinfo.lpDirectory = NULL;
199  shexinfo.nShow = nCmdShow;
200 
201  ShellPath shell_path = create_absolute_pidl();
202  shexinfo.lpIDList = &*shell_path;
203 
204  // add PIDL to the recent file list
206 
207  BOOL ret = TRUE;
208 
209  if (!ShellExecuteEx(&shexinfo)) {
211  ret = FALSE;
212  }
213 
214  return ret;
215 }
virtual ShellPath create_absolute_pidl() const
Definition: shellfs.cpp:114
#define ShellExecuteEx
Definition: shellapi.h:690
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
struct _CONTEXT CONTEXT
#define TRUE
Definition: types.h:120
SHELLEXECUTEINFOA SHELLEXECUTEINFO
Definition: shellapi.h:677
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
void WINAPI SHAddToRecentDocs(UINT uFlags, LPCVOID pv)
Definition: shellord.c:669
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
LPCSTR lpParameters
Definition: shellapi.h:314
void display_error(HWND hwnd, DWORD error)
Definition: utility.cpp:98
int ret
LPCSTR lpDirectory
Definition: shellapi.h:315
#define SHARD_PIDL
Definition: shlobj.h:1092
#define SEE_MASK_INVOKEIDLIST
Definition: shellapi.h:28
wrapper class for item ID lists
Definition: shellclasses.h:651

Member Data Documentation

◆ _pidl


The documentation for this struct was generated from the following files: