Public Member Functions | Public Attributes | Protected Member Functions

ShellEntry Struct Reference

shell file/directory entry More...

#include <shellfs.h>

Inheritance diagram for ShellEntry:
Inheritance graph
[legend]
Collaboration diagram for ShellEntry:
Collaboration graph
[legend]

List of all members.

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, LPPOINT pptScreen, CtxMenuInterfaces &cm_ifs)
virtual ShellFolder get_shell_folder () const
IShellFolder * get_parent_folder () const

Public Attributes

ShellPath _pidl

Protected Member Functions

 ShellEntry (LPITEMIDLIST shell_path)
 ShellEntry (const ShellPath &shell_path)

Detailed Description

shell file/directory entry

Definition at line 30 of file shellfs.h.


Constructor & Destructor Documentation

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

Definition at line 32 of file shellfs.h.

Referenced by ShellDirectory::read_directory().

: Entry(parent, ET_SHELL), _pidl(shell_path) {}

Here is the caller graph for this function:

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

Definition at line 33 of file shellfs.h.

: Entry(parent, ET_SHELL), _pidl(shell_path) {}
ShellEntry::ShellEntry ( LPITEMIDLIST  shell_path ) [inline, protected]

Definition at line 47 of file shellfs.h.

: Entry(ET_SHELL), _pidl(shell_path) {}
ShellEntry::ShellEntry ( const ShellPath shell_path ) [inline, protected]

Definition at line 48 of file shellfs.h.

: Entry(ET_SHELL), _pidl(shell_path) {}

Member Function Documentation

ShellPath ShellEntry::create_absolute_pidl (  ) const [virtual]

Reimplemented from Entry.

Definition at line 120 of file shellfs.cpp.

References Entry::_etype, _pidl, Entry::_up, CONTEXT, Entry::create_absolute_pidl(), create_absolute_pidl(), ShellPath::create_absolute_pidl(), and ET_SHELL.

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

{
    CONTEXT("ShellEntry::create_absolute_pidl()");

    if (_up)
    {
        if (_up->_etype == ET_SHELL) {
            ShellDirectory* dir = static_cast<ShellDirectory*>(_up);

            if (dir->_pidl->mkid.cb)    // Caching of absolute PIDLs could enhance performance.
                return _pidl.create_absolute_pidl(dir->create_absolute_pidl());
        } else
            return _pidl.create_absolute_pidl(_up->create_absolute_pidl());
    }
    return _pidl;
}

Here is the call graph for this function:

Here is the caller graph for this function:

HRESULT ShellEntry::do_context_menu ( HWND  hwnd,
LPPOINT  pptScreen,
CtxMenuInterfaces cm_ifs 
) [virtual]

Definition at line 220 of file shellfs.cpp.

References ShellDirectory::_folder, _pidl, Entry::_up, GetDesktopFolder(), and ShellFolderContextMenu().

{
    ShellDirectory* dir = static_cast<ShellDirectory*>(_up);

    ShellFolder folder = dir? dir->_folder: GetDesktopFolder();
    LPCITEMIDLIST pidl = _pidl;

    return ShellFolderContextMenu(folder, hwnd, 1, &pidl, pptScreen->x, pptScreen->y, cm_ifs);
}

Here is the call graph for this function:

IShellFolder * ShellEntry::get_parent_folder (  ) const [inline]

Definition at line 120 of file shellfs.h.

References Entry::_up, and GetDesktopFolder().

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

{
    if (_up)
        return static_cast<ShellDirectory*>(_up)->_folder;
    else
        return GetDesktopFolder();
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Implements Entry.

Reimplemented in ShellDirectory.

Definition at line 139 of file shellfs.cpp.

References create_absolute_pidl().

{
    if (!path || path_count==0)
        return false;
/*
    path[0] = TEXT('\0');

    if (FAILED(path_from_pidl(get_parent_folder(), &*_pidl, path, path_count)))
        return false;
*/
    FileSysShellPath fs_path(create_absolute_pidl());
    LPCTSTR ret = fs_path;

    if (ret) {
        lstrcpyn(path, ret, path_count);
        return true;
    } else
        return false;
}

Here is the call graph for this function:

ShellFolder ShellEntry::get_shell_folder (  ) const [virtual]

Reimplemented from Entry.

Reimplemented in ShellDirectory.

Definition at line 244 of file shellfs.cpp.

References get_parent_folder().

{
    return get_parent_folder();
}

Here is the call graph for this function:

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

Reimplemented from Entry.

Definition at line 231 of file shellfs.cpp.

References _pidl, and get_parent_folder().

{
    LPCITEMIDLIST pidl = _pidl;

    return get_parent_folder()->GetUIObjectOf(hWnd, 1, &pidl, riid, NULL, ppvOut);
}

Here is the call graph for this function:

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

Reimplemented from Entry.

Definition at line 188 of file shellfs.cpp.

References CONTEXT, create_absolute_pidl(), and display_error().

{
    CONTEXT("ShellEntry::launch_entry()");

    SHELLEXECUTEINFO shexinfo;

    shexinfo.cbSize = sizeof(SHELLEXECUTEINFO);
    shexinfo.fMask = SEE_MASK_INVOKEIDLIST; // SEE_MASK_IDLIST is also possible.
    shexinfo.hwnd = hwnd;
    shexinfo.lpVerb = NULL;
    shexinfo.lpFile = NULL;
    shexinfo.lpParameters = NULL;
    shexinfo.lpDirectory = NULL;
    shexinfo.nShow = nCmdShow;

    ShellPath shell_path = create_absolute_pidl();
    shexinfo.lpIDList = &*shell_path;

     // add PIDL to the recent file list
    SHAddToRecentDocs(SHARD_PIDL, shexinfo.lpIDList);

    BOOL ret = TRUE;

    if (!ShellExecuteEx(&shexinfo)) {
        display_error(hwnd, GetLastError());
        ret = FALSE;
    }

    return ret;
}

Here is the call graph for this function:


Member Data Documentation


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

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage