Sync with trunk rev.61910 to get latest improvements and bugfixes.
[reactos.git] / dll / win32 / shell32 / folders / fonts.h
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 #ifndef _SHFLDR_FONTS_H_
23 #define _SHFLDR_FONTS_H_
24
25 class CFontsFolder :
26 public CComCoClass<CFontsFolder, &CLSID_FontsFolderShortcut>,
27 public CComObjectRootEx<CComMultiThreadModelNoCS>,
28 public IShellFolder2,
29 public IPersistFolder2,
30 public IContextMenu2
31 {
32 private:
33 /* both paths are parsible from the desktop */
34 LPITEMIDLIST pidlRoot; /* absolute pidl */
35 LPCITEMIDLIST apidl; /* currently focused font item */
36 public:
37 CFontsFolder();
38 ~CFontsFolder();
39 HRESULT WINAPI FinalConstruct();
40
41 // IShellFolder
42 virtual HRESULT WINAPI ParseDisplayName (HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, LPITEMIDLIST *ppidl, DWORD *pdwAttributes);
43 virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList);
44 virtual HRESULT WINAPI BindToObject(LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
45 virtual HRESULT WINAPI BindToStorage(LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
46 virtual HRESULT WINAPI CompareIDs(LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
47 virtual HRESULT WINAPI CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut);
48 virtual HRESULT WINAPI GetAttributesOf (UINT cidl, LPCITEMIDLIST *apidl, DWORD *rgfInOut);
49 virtual HRESULT WINAPI GetUIObjectOf(HWND hwndOwner, UINT cidl, LPCITEMIDLIST *apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut);
50 virtual HRESULT WINAPI GetDisplayNameOf(LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet);
51 virtual HRESULT WINAPI SetNameOf(HWND hwndOwner, LPCITEMIDLIST pidl, LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST *pPidlOut);
52
53 /* ShellFolder2 */
54 virtual HRESULT WINAPI GetDefaultSearchGUID(GUID *pguid);
55 virtual HRESULT WINAPI EnumSearches(IEnumExtraSearch **ppenum);
56 virtual HRESULT WINAPI GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay);
57 virtual HRESULT WINAPI GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags);
58 virtual HRESULT WINAPI GetDetailsEx(LPCITEMIDLIST pidl, const SHCOLUMNID *pscid, VARIANT *pv);
59 virtual HRESULT WINAPI GetDetailsOf(LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS *psd);
60 virtual HRESULT WINAPI MapColumnToSCID(UINT column, SHCOLUMNID *pscid);
61
62 // IPersist
63 virtual HRESULT WINAPI GetClassID(CLSID *lpClassId);
64
65 // IPersistFolder
66 virtual HRESULT WINAPI Initialize(LPCITEMIDLIST pidl);
67
68 // IPersistFolder2
69 virtual HRESULT WINAPI GetCurFolder(LPITEMIDLIST *pidl);
70
71 // IContextMenu
72 virtual HRESULT WINAPI QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
73 virtual HRESULT WINAPI InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi);
74 virtual HRESULT WINAPI GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen);
75
76 // IContextMenu2
77 virtual HRESULT WINAPI HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam);
78
79 DECLARE_REGISTRY_RESOURCEID(IDR_FONTSFOLDERSHORTCUT)
80 DECLARE_NOT_AGGREGATABLE(CFontsFolder)
81
82 DECLARE_PROTECT_FINAL_CONSTRUCT()
83
84 BEGIN_COM_MAP(CFontsFolder)
85 COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2)
86 COM_INTERFACE_ENTRY_IID(IID_IShellFolder, IShellFolder)
87 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
88 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2)
89 COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
90 COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
91 COM_INTERFACE_ENTRY_IID(IID_IContextMenu2, IContextMenu2)
92 END_COM_MAP()
93 };
94
95 #endif /* _SHFLDR_FONTS_H_ */