2 * FolderItem(s) implementation
4 * Copyright 2015 Mark Jansen
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 WINE_DEFAULT_DEBUG_CHANNEL(shell
);
26 CFolderItem::CFolderItem()
30 CFolderItem::~CFolderItem()
34 void CFolderItem::Init(LPITEMIDLIST idlist
)
36 m_idlist
.Attach(idlist
);
39 // *** FolderItem methods ***
40 HRESULT STDMETHODCALLTYPE
CFolderItem::get_Application(IDispatch
**ppid
)
42 TRACE("(%p, %p)\n", this, ppid
);
46 HRESULT STDMETHODCALLTYPE
CFolderItem::get_Parent(IDispatch
**ppid
)
48 TRACE("(%p, %p)\n", this, ppid
);
52 HRESULT STDMETHODCALLTYPE
CFolderItem::get_Name(BSTR
*pbs
)
54 TRACE("(%p, %p)\n", this, pbs
);
58 HRESULT STDMETHODCALLTYPE
CFolderItem::put_Name(BSTR bs
)
60 TRACE("(%p, %s)\n", this, wine_dbgstr_w(bs
));
64 HRESULT STDMETHODCALLTYPE
CFolderItem::get_Path(BSTR
*pbs
)
66 CComPtr
<IShellFolder
> psfDesktop
;
68 HRESULT hr
= SHGetDesktopFolder(&psfDesktop
);
73 hr
= psfDesktop
->GetDisplayNameOf(m_idlist
, SHGDN_FORPARSING
, &strret
);
74 if (FAILED_UNEXPECTEDLY(hr
))
77 return StrRetToBSTR(&strret
, NULL
, pbs
);
80 HRESULT STDMETHODCALLTYPE
CFolderItem::get_GetLink(IDispatch
**ppid
)
82 TRACE("(%p, %p)\n", this, ppid
);
86 HRESULT STDMETHODCALLTYPE
CFolderItem::get_GetFolder(IDispatch
**ppid
)
88 TRACE("(%p, %p)\n", this, ppid
);
92 HRESULT STDMETHODCALLTYPE
CFolderItem::get_IsLink(VARIANT_BOOL
*pb
)
94 TRACE("(%p, %p)\n", this, pb
);
98 HRESULT STDMETHODCALLTYPE
CFolderItem::get_IsFolder(VARIANT_BOOL
*pb
)
100 TRACE("(%p, %p)\n", this, pb
);
104 HRESULT STDMETHODCALLTYPE
CFolderItem::get_IsFileSystem(VARIANT_BOOL
*pb
)
106 TRACE("(%p, %p)\n", this, pb
);
110 HRESULT STDMETHODCALLTYPE
CFolderItem::get_IsBrowsable(VARIANT_BOOL
*pb
)
112 TRACE("(%p, %p)\n", this, pb
);
116 HRESULT STDMETHODCALLTYPE
CFolderItem::get_ModifyDate(DATE
*pdt
)
118 TRACE("(%p, %p)\n", this, pdt
);
122 HRESULT STDMETHODCALLTYPE
CFolderItem::put_ModifyDate(DATE dt
)
124 TRACE("(%p, %f)\n", this, dt
);
128 HRESULT STDMETHODCALLTYPE
CFolderItem::get_Size(LONG
*pul
)
130 TRACE("(%p, %p)\n", this, pul
);
134 HRESULT STDMETHODCALLTYPE
CFolderItem::get_Type(BSTR
*pbs
)
136 TRACE("(%p, %p)\n", this, pbs
);
140 HRESULT STDMETHODCALLTYPE
CFolderItem::Verbs(FolderItemVerbs
**ppfic
)
144 CFolderItemVerbs
* verbs
= new CComObject
<CFolderItemVerbs
>();
145 HRESULT hr
= verbs
->Init(m_idlist
);
146 if (FAILED_UNEXPECTEDLY(hr
))
156 HRESULT STDMETHODCALLTYPE
CFolderItem::InvokeVerb(VARIANT vVerb
)
158 TRACE("(%p, %s)\n", this, wine_dbgstr_variant(&vVerb
));
164 CFolderItems::CFolderItems()
168 CFolderItems::~CFolderItems()
172 // *** FolderItems methods ***
173 HRESULT STDMETHODCALLTYPE
CFolderItems::get_Count(long *plCount
)
175 TRACE("(%p, %p)\n", this, plCount
);
179 HRESULT STDMETHODCALLTYPE
CFolderItems::get_Application(IDispatch
**ppid
)
181 TRACE("(%p, %p)\n", this, ppid
);
185 HRESULT STDMETHODCALLTYPE
CFolderItems::get_Parent(IDispatch
**ppid
)
187 TRACE("(%p, %p)\n", this, ppid
);
191 HRESULT STDMETHODCALLTYPE
CFolderItems::Item(VARIANT index
, FolderItem
**ppid
)
193 TRACE("(%p, %s, %p)\n", this, wine_dbgstr_variant(&index
), ppid
);
197 HRESULT STDMETHODCALLTYPE
CFolderItems::_NewEnum(IUnknown
**ppunk
)
199 TRACE("(%p, %p)\n", this, ppunk
);