ReactOS  0.4.12-dev-914-g71f84a3
ShellFolder Struct Reference

IShellFolder smart pointer. More...

#include <shellclasses.h>

Inheritance diagram for ShellFolder:
Collaboration diagram for ShellFolder:

Public Types

typedef SIfacePtr< IShellFoldersuper
 

Public Member Functions

 ShellFolder ()
 
 ShellFolder (IShellFolder *p)
 
 ShellFolder (IShellFolder *parent, LPCITEMIDLIST pidl)
 
 ShellFolder (LPCITEMIDLIST pidl)
 
void attach (IShellFolder *parent, LPCITEMIDLIST pidl)
 
String get_name (LPCITEMIDLIST pidl, SHGDNF flags=SHGDN_NORMAL) const
 
- Public Member Functions inherited from SIfacePtr< IShellFolder >
 SIfacePtr ()
 
 SIfacePtr (IShellFolder *p)
 
 SIfacePtr (IUnknown *unknown, REFIID riid)
 
 ~SIfacePtr ()
 
IShellFolderoperator-> ()
 
const IShellFolderoperator-> () const
 
 operator IShellFolder * ()
 
IShellFolder ** operator & ()
 
bool empty () const
 
SIfacePtroperator= (IShellFolder *p)
 
void operator= (SIfacePtr const &o)
 
HRESULT CreateInstance (REFIID clsid, REFIID riid)
 
HRESULT QueryInterface (REFIID riid, I *p)
 
IShellFolderget ()
 
void Free ()
 

Additional Inherited Members

- Protected Member Functions inherited from SIfacePtr< IShellFolder >
 SIfacePtr (const SIfacePtr &o)
 
- Protected Attributes inherited from SIfacePtr< IShellFolder >
IShellFolder_p
 

Detailed Description

IShellFolder smart pointer.

Definition at line 593 of file shellclasses.h.

Member Typedef Documentation

◆ super

Definition at line 595 of file shellclasses.h.

Constructor & Destructor Documentation

◆ ShellFolder() [1/4]

ShellFolder::ShellFolder ( )

Definition at line 194 of file shellclasses.cpp.

195 {
196  CONTEXT("ShellFolder::ShellFolder()");
197 
198  IShellFolder* desktop;
199 
200  CHECKERROR(SHGetDesktopFolder(&desktop));
201 
202  super::Attach(desktop);
203  desktop->AddRef();
204 }
struct _CONTEXT CONTEXT
#define CHECKERROR(hr)
Definition: shellclasses.h:162
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
ULONG AddRef()

◆ ShellFolder() [2/4]

ShellFolder::ShellFolder ( IShellFolder p)

Definition at line 206 of file shellclasses.cpp.

207  : super(p)
208 {
209  CONTEXT("ShellFolder::ShellFolder(IShellFolder*)");
210 
211  p->AddRef();
212 }
struct _CONTEXT CONTEXT
GLfloat GLfloat p
Definition: glext.h:8902
SIfacePtr< IShellFolder > super
Definition: shellclasses.h:595

◆ ShellFolder() [3/4]

ShellFolder::ShellFolder ( IShellFolder parent,
LPCITEMIDLIST  pidl 
)

Definition at line 214 of file shellclasses.cpp.

215 {
216  CONTEXT("ShellFolder::ShellFolder(IShellFolder*, LPCITEMIDLIST)");
217 
218  IShellFolder* ptr;
219 
220  if (!pidl)
222 
223  if (pidl && pidl->mkid.cb)
224  CHECKERROR(parent->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID*)&ptr));
225  else
226  ptr = parent;
227 
228  super::Attach(ptr);
229  ptr->AddRef();
230 }
struct _CONTEXT CONTEXT
static PVOID ptr
Definition: dispmode.c:27
#define E_INVALIDARG
Definition: ddrawi.h:101
#define CHECKERROR(hr)
Definition: shellclasses.h:162
r parent
Definition: btrfs.c:2659
nsrefcnt AddRef()

◆ ShellFolder() [4/4]

ShellFolder::ShellFolder ( LPCITEMIDLIST  pidl)

Definition at line 232 of file shellclasses.cpp.

233 {
234  CONTEXT("ShellFolder::ShellFolder(LPCITEMIDLIST)");
235 
236  IShellFolder* ptr;
238 
239  if (pidl && pidl->mkid.cb)
240  CHECKERROR(parent->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID*)&ptr));
241  else
242  ptr = parent;
243 
244  super::Attach(ptr);
245  ptr->AddRef();
246 }
struct _CONTEXT CONTEXT
static PVOID ptr
Definition: dispmode.c:27
#define CHECKERROR(hr)
Definition: shellclasses.h:162
r parent
Definition: btrfs.c:2659
ShellFolder & GetDesktopFolder()
nsrefcnt AddRef()

Member Function Documentation

◆ attach()

void ShellFolder::attach ( IShellFolder parent,
LPCITEMIDLIST  pidl 
)

Definition at line 248 of file shellclasses.cpp.

249 {
250  CONTEXT("ShellFolder::attach(IShellFolder*, LPCITEMIDLIST)");
251 
252  IShellFolder* ptr;
253 
254  if (pidl && pidl->mkid.cb)
255  CHECKERROR(parent->BindToObject(pidl, 0, IID_IShellFolder, (LPVOID*)&ptr));
256  else
257  ptr = parent;
258 
259  super::Attach(ptr);
260  ptr->AddRef();
261 }
struct _CONTEXT CONTEXT
static PVOID ptr
Definition: dispmode.c:27
#define CHECKERROR(hr)
Definition: shellclasses.h:162
r parent
Definition: btrfs.c:2659
nsrefcnt AddRef()

◆ get_name()

String ShellFolder::get_name ( LPCITEMIDLIST  pidl,
SHGDNF  flags = SHGDN_NORMAL 
) const

Definition at line 320 of file shellclasses.cpp.

321 {
322  CONTEXT("ShellFolder::get_name()");
323 
325  StrRet strret;
326 
327  HRESULT hr = ((IShellFolder*)*const_cast<ShellFolder*>(this))->GetDisplayNameOf(pidl, flags, &strret);
328 
329  if (hr == S_OK)
330  strret.GetString(pidl->mkid, buffer, COUNTOF(buffer));
331  else {
332  CHECKERROR(hr);
333  *buffer = TEXT('\0');
334  }
335 
336  return buffer;
337 }
struct _CONTEXT CONTEXT
HRESULT hr
Definition: shlfolder.c:183
GLuint buffer
Definition: glext.h:5915
#define StrRet
Definition: shellclasses.h:871
#define CHECKERROR(hr)
Definition: shellclasses.h:162
char TCHAR
Definition: xmlstorage.h:189
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
GLbitfield flags
Definition: glext.h:7161
#define S_OK
Definition: intsafe.h:59
#define TEXT(s)
Definition: k32.h:26
#define COUNTOF(x)
Definition: utility.h:93

Referenced by ShellBrowser::Init(), and ShellDirectory::ShellDirectory().


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