8169c7496471a0654ab55c67ac2c4b7624f6b74f
[reactos.git] / reactos / dll / win32 / shell32 / shfldr.h
1
2 /*
3 * Virtual Folder
4 * common definitions
5 *
6 * Copyright 1997 Marcus Meissner
7 * Copyright 1998, 1999, 2002 Juergen Schmied
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_H_
25 #define _SHFLDR_H_
26
27 #define CHARS_IN_GUID 39
28
29 typedef struct {
30 int colnameid;
31 int pcsFlags;
32 int fmt;
33 int cxChar;
34 } shvheader;
35
36 #define GET_SHGDN_FOR(dwFlags) ((DWORD)dwFlags & (DWORD)0x0000FF00)
37 #define GET_SHGDN_RELATION(dwFlags) ((DWORD)dwFlags & (DWORD)0x000000FF)
38
39 LPCWSTR GetNextElementW (LPCWSTR pszNext, LPWSTR pszOut, DWORD dwOut);
40 HRESULT SHELL32_ParseNextElement (IShellFolder2 * psf, HWND hwndOwner, LPBC pbc, LPITEMIDLIST * pidlInOut,
41 LPOLESTR szNext, DWORD * pEaten, DWORD * pdwAttributes);
42
43 HRESULT HCR_GetClassName(REFIID riid, LPSTRRET strRet);
44
45 HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet);
46
47 HRESULT SHELL32_BindToFS (LPCITEMIDLIST pidlRoot,
48 LPCWSTR pathRoot, LPCITEMIDLIST pidlComplete, REFIID riid, LPVOID * ppvOut);
49
50 HRESULT SHELL32_CompareIDs (IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
51 LPITEMIDLIST SHELL32_CreatePidlFromBindCtx(IBindCtx *pbc, LPCWSTR path);
52
53 HRESULT SHELL32_BindToGuidItem(LPCITEMIDLIST pidlRoot,
54 PCUIDLIST_RELATIVE pidl,
55 LPBC pbcReserved,
56 REFIID riid,
57 LPVOID *ppvOut);
58
59 HRESULT SHELL32_GetGuidItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWORD pdwAttributes);
60
61 HRESULT SHELL32_GetFSItemAttributes(IShellFolder * psf, LPCITEMIDLIST pidl, LPDWORD pdwAttributes);
62
63 HRESULT SHELL32_GetDisplayNameOfGUIDItem(IShellFolder2* psf, LPCWSTR pszFolderPath, PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet);
64
65 HRESULT SHELL32_SetNameOfGuidItem(PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut);
66
67 HRESULT SHELL32_GetDetailsOfGuidItem(IShellFolder2* psf, PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd);
68
69 HRESULT SH_ParseGuidDisplayName(IShellFolder2 * pFolder,
70 HWND hwndOwner,
71 LPBC pbc,
72 LPOLESTR lpszDisplayName,
73 DWORD *pchEaten,
74 PIDLIST_RELATIVE *ppidl,
75 DWORD *pdwAttributes);
76
77 extern "C"
78 BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey);
79
80 static __inline int SHELL32_GUIDToStringA (REFGUID guid, LPSTR str)
81 {
82 return sprintf(str, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
83 guid.Data1, guid.Data2, guid.Data3,
84 guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3],
85 guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]);
86 }
87
88 static __inline int SHELL32_GUIDToStringW (REFGUID guid, LPWSTR str)
89 {
90 static const WCHAR fmtW[] =
91 { '{','%','0','8','l','x','-','%','0','4','x','-','%','0','4','x','-',
92 '%','0','2','x','%','0','2','x','-',
93 '%','0','2','x','%','0','2','x','%','0','2','x','%','0','2','x',
94 '%','0','2','x','%','0','2','x','}',0 };
95 return swprintf(str, fmtW,
96 guid.Data1, guid.Data2, guid.Data3,
97 guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3],
98 guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]);
99 }
100
101 void SHELL_FS_ProcessDisplayFilename(LPWSTR szPath, DWORD dwFlags);
102 BOOL SHELL_FS_HideExtension(LPWSTR pwszPath);
103
104 #endif /* _SHFLDR_H_ */