ReactOS 0.4.15-dev-8138-g1e75ea8
CFolder.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: shell32
3 * LICENSE: LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+)
4 * PURPOSE: Folder implementation
5 * COPYRIGHT: Copyright 2015-2018 Mark Jansen (mark.jansen@reactos.org)
6 */
7
8#include "precomp.h"
9
11
12
14{
15}
16
18{
19}
20
22{
23 m_idlist.Attach(ILClone(idlist));
25}
26
28{
29 CComPtr<IShellFolder> psfDesktop;
30
31 HRESULT hr = SHGetDesktopFolder(&psfDesktop);
33 return hr;
34
35 return psfDesktop->BindToObject(m_idlist, NULL, IID_PPV_ARG(IShellFolder, &psfCurrent));
36}
37
38// *** Folder methods ***
40{
41 if (!pbs)
42 return E_POINTER;
43
44 WCHAR path[MAX_PATH+2] = {0};
47 return hr;
48
49 *pbs = SysAllocString(path);
50 return S_OK;
51}
52
54{
55 TRACE("(%p, %p)\n", this, ppid);
56
57 if (!ppid)
58 return E_INVALIDARG;
59
60 *ppid = m_Application;
61 (*ppid)->AddRef();
62
63 return S_OK;
64}
65
67{
68 TRACE("(%p %p)\n", this, ppid);
69
70 if (ppid)
71 *ppid = NULL;
72
73 return E_NOTIMPL;
74}
75
77{
78 TRACE("(%p, %p)\n", this);
79
80 *ppsf = NULL;
81
82 return E_NOTIMPL;
83}
84
86{
87 /* FolderItems_Constructor */
88 return ShellObjectCreatorInit<CFolderItems>(static_cast<LPITEMIDLIST>(m_idlist), this, IID_PPV_ARG(FolderItems, ppid));
89}
90
92{
93 TRACE("(%p, %s, %p)\n", this, wine_dbgstr_w(bName), ppid);
94 if (!ppid)
95 return E_POINTER;
96 *ppid = NULL;
97
98 CComPtr<IShellFolder> psfCurrent;
99 HRESULT hr = GetShellFolder(psfCurrent);
101 return hr;
102
104 hr = psfCurrent->ParseDisplayName(NULL, NULL, bName, NULL, &relativePidl, NULL);
105 if (!SUCCEEDED(hr))
106 return S_FALSE;
107
109 combined.Attach(ILCombine(m_idlist, relativePidl));
110
111 return ShellObjectCreatorInit<CFolderItem>(this, static_cast<LPITEMIDLIST>(combined), IID_PPV_ARG(FolderItem, ppid));
112}
113
115{
116 TRACE("(%p, %s, %s)\n", this, wine_dbgstr_w(bName), wine_dbgstr_variant(&vOptions));
117 return E_NOTIMPL;
118}
119
121{
122 TRACE("(%p, %s, %s)\n", this, wine_dbgstr_variant(&vItem), wine_dbgstr_variant(&vOptions));
123 return E_NOTIMPL;
124}
125
127{
128 TRACE("(%p, %s, %s)\n", this, wine_dbgstr_variant(&vItem), wine_dbgstr_variant(&vOptions));
129 return E_NOTIMPL;
130}
131
133{
134 TRACE("(%p, %s, %i, %p)\n", this, wine_dbgstr_variant(&vItem), iColumn, pbs);
135 return E_NOTIMPL;
136}
137
138
139// *** Folder2 methods ***
141{
142 TRACE("(%p, %p)\n", this, ppfi);
143 if (!ppfi)
144 return E_POINTER;
145
146 return ShellObjectCreatorInit<CFolderItem>(this, static_cast<LPITEMIDLIST>(m_idlist), IID_PPV_ARG(FolderItem, ppfi));
147}
148
150{
151 TRACE("(%p, %p)\n", this, pul);
152 return E_NOTIMPL;
153}
154
156{
157 TRACE("(%p)\n", this);
158 return E_NOTIMPL;
159}
160
162{
163 TRACE("(%p, %p)\n", this, pbHaveToShowWebViewBarricade);
164 return E_NOTIMPL;
165}
166
168{
169 TRACE("(%p)\n", this);
170 return E_NOTIMPL;
171}
172
173
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
HRESULT WINAPI CShellDispatch_Constructor(REFIID riid, LPVOID *ppvOut)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
~CFolder()
Definition: CFolder.cpp:17
CComHeapPtr< ITEMIDLIST > m_idlist
Definition: CFolder.h:20
STDMETHOD() MoveHere(VARIANT vItem, VARIANT vOptions) override
Definition: CFolder.cpp:120
STDMETHOD() Items(FolderItems **ppid) override
Definition: CFolder.cpp:85
STDMETHOD() CopyHere(VARIANT vItem, VARIANT vOptions) override
Definition: CFolder.cpp:126
STDMETHOD() ParseName(BSTR bName, FolderItem **ppid) override
Definition: CFolder.cpp:91
STDMETHOD() get_ParentFolder(Folder **ppsf) override
Definition: CFolder.cpp:76
STDMETHOD() NewFolder(BSTR bName, VARIANT vOptions) override
Definition: CFolder.cpp:114
CFolder()
Definition: CFolder.cpp:13
STDMETHOD() get_HaveToShowWebViewBarricade(VARIANT_BOOL *pbHaveToShowWebViewBarricade) override
Definition: CFolder.cpp:161
STDMETHOD() GetDetailsOf(VARIANT vItem, int iColumn, BSTR *pbs) override
Definition: CFolder.cpp:132
HRESULT Initialize(LPITEMIDLIST idlist)
Definition: CFolder.cpp:21
HRESULT GetShellFolder(CComPtr< IShellFolder > &psfCurrent)
Definition: CFolder.cpp:27
STDMETHOD() get_Parent(IDispatch **ppid) override
Definition: CFolder.cpp:66
STDMETHOD() get_Application(IDispatch **ppid) override
Definition: CFolder.cpp:53
CComPtr< IShellDispatch > m_Application
Definition: CFolder.h:21
STDMETHOD() get_OfflineStatus(LONG *pul) override
Definition: CFolder.cpp:149
STDMETHOD() Synchronize() override
Definition: CFolder.cpp:155
STDMETHOD() DismissedWebViewBarricade() override
Definition: CFolder.cpp:167
STDMETHOD() get_Self(FolderItem **ppfi) override
Definition: CFolder.cpp:140
STDMETHOD() get_Title(BSTR *pbs) override
Definition: CFolder.cpp:39
void Attach(T *lp)
Definition: atlalloc.h:162
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
OLECHAR * BSTR
Definition: compat.h:2293
#define MAX_PATH
Definition: compat.h:34
short VARIANT_BOOL
Definition: compat.h:2290
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define wine_dbgstr_w
Definition: kernel32.h:34
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
long LONG
Definition: pedump.c:60
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:712
BOOL ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
Definition: pidl.c:100
HRESULT hr
Definition: shlfolder.c:183
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define TRACE(s)
Definition: solgame.cpp:4
#define ILGDN_INFOLDER
Definition: undocshell.h:72
#define S_FALSE
Definition: winerror.h:2357
#define E_POINTER
Definition: winerror.h:2365
#define IID_PPV_ARG(Itype, ppType)
__wchar_t WCHAR
Definition: xmlstorage.h:180