ReactOS 0.4.15-dev-7674-gc0b4db1
CFontsFolder.cpp
Go to the documentation of this file.
1/*
2 * Fonts folder
3 *
4 * Copyright 2008 Johannes Anderwald <johannes.anderwald@reactos.org>
5 * Copyright 2009 Andrew Hill
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#include <precomp.h>
23
25
27{
29}
30
32{
33 if(m_pidlInner)
35}
36
38 ULONG *pchEaten, PIDLIST_RELATIVE *ppidl, ULONG *pdwAttributes)
39{
40 return m_pisfInner->ParseDisplayName(hwndOwner, pbc, lpszDisplayName, pchEaten, ppidl, pdwAttributes);
41}
42
43HRESULT WINAPI CFontsFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
44{
45 return m_pisfInner->EnumObjects(hwndOwner, dwFlags, ppEnumIDList);
46}
47
49{
50 return m_pisfInner->BindToObject(pidl, pbcReserved, riid, ppvOut);
51}
52
54{
55 return m_pisfInner->BindToStorage(pidl, pbcReserved, riid, ppvOut);
56}
57
59{
60 return m_pisfInner->CompareIDs(lParam, pidl1, pidl2);
61}
62
64{
65 return m_pisfInner->CreateViewObject(hwndOwner, riid, ppvOut);
66}
67
69{
70 static const DWORD dwFontsAttributes =
71 SFGAO_STORAGE | SFGAO_STORAGEANCESTOR | SFGAO_FILESYSANCESTOR |
72 SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_HASSUBFOLDER;
73
74 if(cidl)
75 return m_pisfInner->GetAttributesOf(cidl, apidl, rgfInOut);
76
77 if (!rgfInOut || !apidl)
78 return E_INVALIDARG;
79
80 if (*rgfInOut == 0)
81 *rgfInOut = ~0;
82
83 *rgfInOut &= dwFontsAttributes;
84
85 /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
86 *rgfInOut &= ~SFGAO_VALIDATE;
87
88 return S_OK;
89}
90
92 REFIID riid, UINT * prgfInOut, LPVOID * ppvOut)
93{
94 return m_pisfInner->GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, ppvOut);
95}
96
98{
99 if (!strRet || !pidl)
100 return E_INVALIDARG;
101
102 /* If we got an fs item just forward to the fs folder */
103 if (!_ILIsSpecialFolder(pidl))
104 return m_pisfInner->GetDisplayNameOf(pidl, dwFlags, strRet);
105
106 /* The caller wants our path. Let fs folder handle it */
109 {
110 /* Give an empty pidl to the fs folder to tell us its path */
111 if (pidl->mkid.cb)
112 pidl = ILGetNext(pidl);
113
114 return m_pisfInner->GetDisplayNameOf(pidl, dwFlags, strRet);
115 }
116
117 ERR("Got empty pidl without SHGDN_FORPARSING\n");
118 return E_INVALIDARG;
119}
120
122 LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
123{
124 return m_pisfInner->SetNameOf(hwndOwner, pidl, lpName, dwFlags, pPidlOut);
125}
126
128{
129 return m_pisfInner->GetDefaultSearchGUID(pguid);
130}
131
133{
134 return m_pisfInner->EnumSearches(ppenum);
135}
136
138{
139 return m_pisfInner->GetDefaultColumn(dwRes, pSort, pDisplay);
140}
141
143{
144 return m_pisfInner->GetDefaultColumnState(iColumn, pcsFlags);
145}
146
148{
149 return m_pisfInner->GetDetailsEx(pidl, pscid, pv);
150}
151
153{
154 return m_pisfInner->GetDetailsOf(pidl, iColumn, psd);
155}
156
158{
159 return m_pisfInner->MapColumnToSCID(column, pscid);
160}
161
163{
164 if (!lpClassId)
165 return E_POINTER;
166
167 *lpClassId = CLSID_FontsFolderShortcut;
168
169 return S_OK;
170}
171
173{
174 m_pidlInner = ILClone(pidl);
175 if (!m_pidlInner)
176 return E_OUTOFMEMORY;
177
179 &CLSID_ShellFSFolder,
182}
183
185{
186 if (!pidl)
187 return E_POINTER;
188 *pidl = ILClone(m_pidlInner);
189 return S_OK;
190}
static HRESULT SHELL32_CoCreateInitSF(LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO *ppfti, LPCITEMIDLIST pidlChild, const GUID *clsid, REFIID riid, LPVOID *ppvOut)
Definition: CFindFolder.cpp:13
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
#define ERR(fmt,...)
Definition: debug.h:110
virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
virtual HRESULT WINAPI CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
virtual HRESULT WINAPI GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
virtual HRESULT WINAPI GetDefaultSearchGUID(GUID *pguid)
virtual HRESULT WINAPI CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
virtual HRESULT WINAPI GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd)
virtual HRESULT WINAPI BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
virtual HRESULT WINAPI GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
virtual HRESULT WINAPI BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
virtual HRESULT WINAPI GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
virtual HRESULT WINAPI GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
virtual HRESULT WINAPI EnumSearches(IEnumExtraSearch **ppenum)
virtual HRESULT WINAPI GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
virtual HRESULT WINAPI GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags)
virtual HRESULT WINAPI GetClassID(CLSID *lpClassId)
virtual HRESULT WINAPI SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
virtual HRESULT WINAPI Initialize(PCIDLIST_ABSOLUTE pidl)
virtual HRESULT WINAPI MapColumnToSCID(UINT column, SHCOLUMNID *pscid)
virtual HRESULT WINAPI GetCurFolder(PIDLIST_ABSOLUTE *pidl)
CComPtr< IShellFolder2 > m_pisfInner
Definition: CFontsFolder.h:32
LPITEMIDLIST m_pidlInner
Definition: CFontsFolder.h:33
LPARAM lParam
Definition: combotst.c:139
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define NULL
Definition: types.h:112
#define GET_SHGDN_RELATION(dwFlags)
Definition: precomp.h:53
#define GET_SHGDN_FOR(dwFlags)
Definition: precomp.h:52
const GUID CLSID_FontsFolderShortcut
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
static BOOL _ILIsSpecialFolder(LPCITEMIDLIST pidl)
unsigned long DWORD
Definition: ntddk_ex.h:95
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
static LPOLESTR
Definition: stg_prop.c:27
unsigned int UINT
Definition: ndis.h:50
interface IBindCtx * LPBC
Definition: objfwd.h:18
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:855
#define REFIID
Definition: guiddef.h:118
#define CSIDL_FONTS
Definition: shlobj.h:2110
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
uint32_t ULONG
Definition: typedefs.h:59
_In_ LPCSTR lpName
Definition: winbase.h:2789
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
LONG_PTR LPARAM
Definition: windef.h:208
#define WINAPI
Definition: msvc.h:6
#define E_POINTER
Definition: winerror.h:2365
#define IID_PPV_ARG(Itype, ppType)