ReactOS  0.4.14-dev-833-g5f692ed
CFolderItemVerbs Class Reference

#include <CFolderItemVerbs.h>

Inheritance diagram for CFolderItemVerbs:
Collaboration diagram for CFolderItemVerbs:

Public Member Functions

 CFolderItemVerbs ()
 
virtual ~CFolderItemVerbs ()
 
HRESULT Init (LPITEMIDLIST idlist)
 
virtual HRESULT STDMETHODCALLTYPE get_Count (LONG *plCount)
 
virtual HRESULT STDMETHODCALLTYPE get_Application (IDispatch **ppid)
 
virtual HRESULT STDMETHODCALLTYPE get_Parent (IDispatch **ppid)
 
virtual HRESULT STDMETHODCALLTYPE Item (VARIANT index, FolderItemVerb **ppid)
 
virtual HRESULT STDMETHODCALLTYPE _NewEnum (IUnknown **ppunk)
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 

Private Attributes

CComPtr< IContextMenum_contextmenu
 
HMENU m_menu
 
int m_count
 

Additional Inherited Members

- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 

Detailed Description

Definition at line 56 of file CFolderItemVerbs.h.

Constructor & Destructor Documentation

◆ CFolderItemVerbs()

CFolderItemVerbs::CFolderItemVerbs ( )

Definition at line 73 of file CFolderItemVerbs.cpp.

74  :m_menu(NULL)
75  ,m_count(0)
76 {
77 }
smooth NULL
Definition: ftsmooth.c:416

◆ ~CFolderItemVerbs()

CFolderItemVerbs::~CFolderItemVerbs ( )
virtual

Definition at line 79 of file CFolderItemVerbs.cpp.

80 {
82 }
BOOL WINAPI DestroyMenu(_In_ HMENU)

Member Function Documentation

◆ _NewEnum()

HRESULT STDMETHODCALLTYPE CFolderItemVerbs::_NewEnum ( IUnknown **  ppunk)
virtual

Definition at line 183 of file CFolderItemVerbs.cpp.

184 {
185  TRACE("(%p, %p)\n", this, ppunk);
186  return E_NOTIMPL;
187 }
#define TRACE(s)
Definition: solgame.cpp:4
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ get_Application()

HRESULT STDMETHODCALLTYPE CFolderItemVerbs::get_Application ( IDispatch **  ppid)
virtual

Definition at line 115 of file CFolderItemVerbs.cpp.

116 {
117  TRACE("(%p, %p)\n", this, ppid);
118 
119  if (ppid)
120  *ppid = NULL;
121 
122  return E_NOTIMPL;
123 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ get_Count()

HRESULT STDMETHODCALLTYPE CFolderItemVerbs::get_Count ( LONG plCount)
virtual

Definition at line 107 of file CFolderItemVerbs.cpp.

108 {
109  if (!plCount)
110  return E_INVALIDARG;
111  *plCount = m_count;
112  return S_OK;
113 }
#define E_INVALIDARG
Definition: ddrawi.h:101
#define S_OK
Definition: intsafe.h:59

◆ get_Parent()

HRESULT STDMETHODCALLTYPE CFolderItemVerbs::get_Parent ( IDispatch **  ppid)
virtual

Definition at line 125 of file CFolderItemVerbs.cpp.

126 {
127  TRACE("(%p, %p)\n", this, ppid);
128 
129  if (ppid)
130  *ppid = NULL;
131 
132  return E_NOTIMPL;
133 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Init()

HRESULT CFolderItemVerbs::Init ( LPITEMIDLIST  idlist)

Definition at line 84 of file CFolderItemVerbs.cpp.

85 {
90  return hr;
91 
92  hr = folder->GetUIObjectOf(NULL, 1, &child, IID_IContextMenu, NULL, (PVOID*)&m_contextmenu);
94  return hr;
95 
97  hr = m_contextmenu->QueryContextMenu(m_menu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, CMF_NORMAL);
98  if (!SUCCEEDED(hr))
99  return hr;
100 
102  return hr;
103 }
Definition: fci.c:115
HRESULT hr
Definition: shlfolder.c:183
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define FCIDM_SHVIEWFIRST
Definition: shlobj.h:507
#define IID_PPV_ARG(Itype, ppType)
static HWND child
Definition: cursoricon.c:298
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
smooth NULL
Definition: ftsmooth.c:416
struct CFFOLDER folder
Definition: fdi.c:102
#define FCIDM_SHVIEWLAST
Definition: shlobj.h:540
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
CComPtr< IContextMenu > m_contextmenu
HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
Definition: pidl.c:1323
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:846
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by CFolderItem::Verbs().

◆ Item()

HRESULT STDMETHODCALLTYPE CFolderItemVerbs::Item ( VARIANT  index,
FolderItemVerb **  ppid 
)
virtual

Definition at line 135 of file CFolderItemVerbs.cpp.

136 {
137  if (!ppid)
138  return E_POINTER;
139 
140  CComVariant var;
141 
142  HRESULT hr = VariantChangeType(&var, &indexVar, 0, VT_I4);
143  if (FAILED_UNEXPECTEDLY(hr))
144  return E_INVALIDARG;
145 
146  int index = V_I4(&var);
147 
148  if (index > m_count)
149  return S_OK;
150 
151  BSTR name = NULL;
152 
153  if(index == m_count)
154  {
156  }
157  else
158  {
159  MENUITEMINFOW info = { sizeof(info), 0 };
160  info.fMask = MIIM_STRING;
162  return E_FAIL;
164  if (name)
165  {
166  info.dwTypeData = name;
167  info.cch++;
169  }
170  }
171 
172  if (!name)
173  return E_OUTOFMEMORY;
174 
176  verb->Init(m_contextmenu, name);
177  verb->AddRef();
178  *ppid = verb;
179 
180  return S_OK;
181 }
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
Definition: variant.c:962
#define TRUE
Definition: types.h:120
Definition: compat.h:1947
HRESULT hr
Definition: shlfolder.c:183
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
OLECHAR * BSTR
Definition: compat.h:1942
#define E_FAIL
Definition: ddrawi.h:102
#define V_I4(A)
Definition: oleauto.h:247
struct _test_info info[]
Definition: SetCursorPos.c:19
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
void Init(IContextMenu *menu, BSTR name)
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define MIIM_STRING
Definition: winuser.h:722
#define S_OK
Definition: intsafe.h:59
CComPtr< IContextMenu > m_contextmenu
Definition: name.c:38
#define E_POINTER
Definition: winerror.h:2365
GLuint const GLchar * name
Definition: glext.h:6031

Member Data Documentation

◆ m_contextmenu

CComPtr<IContextMenu> CFolderItemVerbs::m_contextmenu
private

Definition at line 62 of file CFolderItemVerbs.h.

Referenced by Init(), and Item().

◆ m_count

int CFolderItemVerbs::m_count
private

Definition at line 64 of file CFolderItemVerbs.h.

Referenced by get_Count(), Init(), and Item().

◆ m_menu

HMENU CFolderItemVerbs::m_menu
private

Definition at line 63 of file CFolderItemVerbs.h.

Referenced by Init(), Item(), and ~CFolderItemVerbs().


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