[SPEC2DEF] Omit skipped exports from ordinal numbering.
[reactos.git] / dll / win32 / shell32 / folders / CMyDocsFolder.h
1 /*
2 * Virtual MyDocuments Folder
3 *
4 * Copyright 2007 Johannes Anderwald
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_MYDOCUMENTS_H_
23 #define _SHFLDR_MYDOCUMENTS_H_
24
25 class CMyDocsFolder :
26 public CComCoClass<CMyDocsFolder, &CLSID_MyDocuments>,
27 public CComObjectRootEx<CComMultiThreadModelNoCS>,
28 public IShellFolder2,
29 public IPersistFolder2,
30 public IItemNameLimits
31 {
32 private:
33 CComPtr<IShellFolder2> m_pisfInner;
34 LPITEMIDLIST m_pidlInner;
35 public:
36 CMyDocsFolder();
37 ~CMyDocsFolder();
38
39 // IShellFolder
40 virtual HRESULT WINAPI ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes);
41 virtual HRESULT WINAPI EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList);
42 virtual HRESULT WINAPI BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
43 virtual HRESULT WINAPI BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut);
44 virtual HRESULT WINAPI CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2);
45 virtual HRESULT WINAPI CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut);
46 virtual HRESULT WINAPI GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut);
47 virtual HRESULT WINAPI GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut);
48 virtual HRESULT WINAPI GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet);
49 virtual HRESULT WINAPI SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut);
50
51 /* ShellFolder2 */
52 virtual HRESULT WINAPI GetDefaultSearchGUID(GUID *pguid);
53 virtual HRESULT WINAPI EnumSearches(IEnumExtraSearch **ppenum);
54 virtual HRESULT WINAPI GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay);
55 virtual HRESULT WINAPI GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags);
56 virtual HRESULT WINAPI GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv);
57 virtual HRESULT WINAPI GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd);
58 virtual HRESULT WINAPI MapColumnToSCID(UINT column, SHCOLUMNID *pscid);
59
60 // IPersist
61 virtual HRESULT WINAPI GetClassID(CLSID *lpClassId);
62
63 // IPersistFolder
64 virtual HRESULT WINAPI Initialize(PCIDLIST_ABSOLUTE pidl);
65
66 // IPersistFolder2
67 virtual HRESULT WINAPI GetCurFolder(PIDLIST_ABSOLUTE * pidl);
68
69 /*** IItemNameLimits methods ***/
70
71 STDMETHODIMP
72 GetMaxLength(LPCWSTR pszName, int *piMaxNameLen)
73 {
74 return E_NOTIMPL;
75 }
76
77 STDMETHODIMP
78 GetValidCharacters(LPWSTR *ppwszValidChars, LPWSTR *ppwszInvalidChars)
79 {
80 if (ppwszValidChars)
81 {
82 *ppwszValidChars = NULL;
83 }
84 if (ppwszInvalidChars)
85 {
86 SHStrDupW(INVALID_FILETITLE_CHARACTERSW, ppwszInvalidChars);
87 }
88 return S_OK;
89 }
90
91 DECLARE_REGISTRY_RESOURCEID(IDR_MYDOCUMENTS)
92 DECLARE_NOT_AGGREGATABLE(CMyDocsFolder)
93
94 DECLARE_PROTECT_FINAL_CONSTRUCT()
95
96 BEGIN_COM_MAP(CMyDocsFolder)
97 COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2)
98 COM_INTERFACE_ENTRY_IID(IID_IShellFolder, IShellFolder)
99 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
100 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2)
101 COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
102 COM_INTERFACE_ENTRY_IID(IID_IItemNameLimits, IItemNameLimits)
103 END_COM_MAP()
104 };
105
106 #endif /* _SHFLDR_MYDOCUMENTS_H_ */