2 * Folder 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
);
34 void CFolder::Init(LPITEMIDLIST idlist
)
36 m_idlist
.Attach(idlist
);
39 // *** IDispatch methods ***
40 HRESULT STDMETHODCALLTYPE
CFolder::GetTypeInfoCount(UINT
*pctinfo
)
42 TRACE("(%p, %p)\n", this, pctinfo
);
46 HRESULT STDMETHODCALLTYPE
CFolder::GetTypeInfo(UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
48 TRACE("(%p, %lu, %lu, %p)\n", this, iTInfo
, lcid
, ppTInfo
);
52 HRESULT STDMETHODCALLTYPE
CFolder::GetIDsOfNames(REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
54 TRACE("(%p, %s, %p, %lu, %lu, %p)\n", this, wine_dbgstr_guid(&riid
), rgszNames
, cNames
, lcid
, rgDispId
);
58 HRESULT STDMETHODCALLTYPE
CFolder::Invoke(DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
60 TRACE("(%p, %lu, %s, %lu, %lu, %p, %p, %p, %p)\n", this, dispIdMember
, wine_dbgstr_guid(&riid
), lcid
, (DWORD
)wFlags
,
61 pDispParams
, pVarResult
, pExcepInfo
, puArgErr
);
66 // *** Folder methods ***
67 HRESULT STDMETHODCALLTYPE
CFolder::get_Title(BSTR
*pbs
)
69 TRACE("(%p, %p)\n", this, pbs
);
73 HRESULT STDMETHODCALLTYPE
CFolder::get_Application(IDispatch
**ppid
)
75 TRACE("(%p, %p)\n", this, ppid
);
79 HRESULT STDMETHODCALLTYPE
CFolder::get_Parent(IDispatch
**ppid
)
81 TRACE("(%p %p)\n", this, ppid
);
85 HRESULT STDMETHODCALLTYPE
CFolder::get_ParentFolder(Folder
**ppsf
)
87 TRACE("(%p, %p)\n", this);
91 HRESULT STDMETHODCALLTYPE
CFolder::Items(FolderItems
**ppid
)
93 TRACE("(%p, %p)\n", this, ppid
);
97 HRESULT STDMETHODCALLTYPE
CFolder::ParseName(BSTR bName
, FolderItem
**ppid
)
99 TRACE("(%p, %s, %p)\n", this, wine_dbgstr_w(bName
), ppid
);
101 CComPtr
<IShellFolder
> psfDesktop
;
103 HRESULT hr
= SHGetDesktopFolder(&psfDesktop
);
104 if (FAILED_UNEXPECTEDLY(hr
))
107 CComPtr
<IShellFolder
> psfCurrent
;
108 hr
= psfDesktop
->BindToObject(m_idlist
, NULL
, IID_PPV_ARG(IShellFolder
, &psfCurrent
));
109 if (FAILED_UNEXPECTEDLY(hr
))
112 CComHeapPtr
<ITEMIDLIST_RELATIVE
> relativePidl
;
113 hr
= psfCurrent
->ParseDisplayName(NULL
, NULL
, bName
, NULL
, &relativePidl
, NULL
);
117 CFolderItem
* item
= new CComObject
<CFolderItem
>();
119 item
->Init(ILCombine(m_idlist
, relativePidl
));
124 HRESULT STDMETHODCALLTYPE
CFolder::NewFolder(BSTR bName
, VARIANT vOptions
)
126 TRACE("(%p, %s, %s)\n", this, wine_dbgstr_w(bName
), wine_dbgstr_variant(&vOptions
));
130 HRESULT STDMETHODCALLTYPE
CFolder::MoveHere(VARIANT vItem
, VARIANT vOptions
)
132 TRACE("(%p, %s, %s)\n", this, wine_dbgstr_variant(&vItem
), wine_dbgstr_variant(&vOptions
));
136 HRESULT STDMETHODCALLTYPE
CFolder::CopyHere(VARIANT vItem
, VARIANT vOptions
)
138 TRACE("(%p, %s, %s)\n", this, wine_dbgstr_variant(&vItem
), wine_dbgstr_variant(&vOptions
));
142 HRESULT STDMETHODCALLTYPE
CFolder::GetDetailsOf(VARIANT vItem
, int iColumn
, BSTR
*pbs
)
144 TRACE("(%p, %s, %i, %p)\n", this, wine_dbgstr_variant(&vItem
), iColumn
, pbs
);
149 // *** Folder2 methods ***
150 HRESULT STDMETHODCALLTYPE
CFolder::get_Self(FolderItem
**ppfi
)
152 TRACE("(%p, %p)\n", this, ppfi
);
155 CFolderItem
* item
= new CComObject
<CFolderItem
>();
157 item
->Init(ILClone(m_idlist
));
162 HRESULT STDMETHODCALLTYPE
CFolder::get_OfflineStatus(LONG
*pul
)
164 TRACE("(%p, %p)\n", this, pul
);
168 HRESULT STDMETHODCALLTYPE
CFolder::Synchronize()
170 TRACE("(%p)\n", this);
174 HRESULT STDMETHODCALLTYPE
CFolder::get_HaveToShowWebViewBarricade(VARIANT_BOOL
*pbHaveToShowWebViewBarricade
)
176 TRACE("(%p, %p)\n", this, pbHaveToShowWebViewBarricade
);
180 HRESULT STDMETHODCALLTYPE
CFolder::DismissedWebViewBarricade()
182 TRACE("(%p)\n", this);