xref: /reactos/dll/win32/shell32/folders/CNetFolder.h (revision 49b2b1da)
1 /*
2  *  Network Places (Neighbourhood) folder
3  *
4  *  Copyright 1997              Marcus Meissner
5  *  Copyright 1998, 1999, 2002  Juergen Schmied
6  *  Copyright 2003              Mike McCormack for Codeweavers
7  *  Copyright 2009              Andrew Hill
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
24 #ifndef _SHFLDR_NETPLACES_H_
25 #define _SHFLDR_NETPLACES_H_
26 
27 class CNetFolder :
28     public CComCoClass<CNetFolder, &CLSID_NetworkPlaces>,
29     public CComObjectRootEx<CComMultiThreadModelNoCS>,
30     public IShellFolder2,
31     public IPersistFolder2
32 {
33     private:
34         /* both paths are parsible from the desktop */
35         LPITEMIDLIST pidlRoot;  /* absolute pidl */
36     public:
37         CNetFolder();
38         ~CNetFolder();
39 
40         // IShellFolder
41         STDMETHOD(ParseDisplayName)(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes) override;
42         STDMETHOD(EnumObjects)(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) override;
43         STDMETHOD(BindToObject)(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override;
44         STDMETHOD(BindToStorage)(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override;
45         STDMETHOD(CompareIDs)(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2) override;
46         STDMETHOD(CreateViewObject)(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) override;
47         STDMETHOD(GetAttributesOf)(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) override;
48         STDMETHOD(GetUIObjectOf)(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut) override;
49         STDMETHOD(GetDisplayNameOf)(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet) override;
50         STDMETHOD(SetNameOf)(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) override;
51 
52         /* ShellFolder2 */
53         STDMETHOD(GetDefaultSearchGUID)(GUID *pguid) override;
54         STDMETHOD(EnumSearches)(IEnumExtraSearch **ppenum) override;
55         STDMETHOD(GetDefaultColumn)(DWORD dwRes, ULONG *pSort, ULONG *pDisplay) override;
56         STDMETHOD(GetDefaultColumnState)(UINT iColumn, DWORD *pcsFlags) override;
57         STDMETHOD(GetDetailsEx)(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv) override;
58         STDMETHOD(GetDetailsOf)(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd) override;
59         STDMETHOD(MapColumnToSCID)(UINT column, SHCOLUMNID *pscid) override;
60 
61         // IPersist
62         STDMETHOD(GetClassID)(CLSID *lpClassId) override;
63 
64         // IPersistFolder
65         STDMETHOD(Initialize)(PCIDLIST_ABSOLUTE pidl) override;
66 
67         // IPersistFolder2
68         STDMETHOD(GetCurFolder)(PIDLIST_ABSOLUTE * pidl) override;
69 
70         DECLARE_REGISTRY_RESOURCEID(IDR_NETWORKPLACES)
71         DECLARE_NOT_AGGREGATABLE(CNetFolder)
72 
73         DECLARE_PROTECT_FINAL_CONSTRUCT()
74 
75         BEGIN_COM_MAP(CNetFolder)
76         COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2)
77         COM_INTERFACE_ENTRY_IID(IID_IShellFolder, IShellFolder)
78         COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
79         COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2)
80         COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
81         END_COM_MAP()
82 };
83 
84 #endif /* _SHFLDR_NETPLACES_H_ */
85