Changes in crossover-wine-src-6.1.0 except for configure
[wine/hacks.git] / dlls / shell32 / shell32_main.h
blobea30de2ecd78591c2eae2583c212179454e0c586
1 /*
2 * internal Shell32 Library definitions
4 * Copyright 1998 Marcus Meissner
5 * Copyright 1998 Juergen Schmied (jsch) * <juergen.schmied@metronet.de>
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.
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.
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
22 #ifndef __WINE_SHELL_MAIN_H
23 #define __WINE_SHELL_MAIN_H
25 #include <stdarg.h>
27 #include "windef.h"
28 #include "winbase.h"
29 #include "wingdi.h"
30 #include "winuser.h"
31 #include "winnls.h"
32 #include "commctrl.h"
33 #include "objbase.h"
34 #include "docobj.h"
35 #include "undocshell.h"
36 #include "shlobj.h"
37 #include "shellapi.h"
38 #include "wine/windef16.h"
39 #include "wine/unicode.h"
41 /*******************************************
42 * global SHELL32.DLL variables
44 extern HMODULE huser32;
45 extern HINSTANCE shell32_hInstance;
46 extern HIMAGELIST ShellSmallIconList;
47 extern HIMAGELIST ShellBigIconList;
49 BOOL WINAPI Shell_GetImageList(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList);
51 /* Iconcache */
52 #define INVALID_INDEX -1
53 BOOL SIC_Initialize(void);
54 void SIC_Destroy(void);
55 BOOL PidlToSicIndex (IShellFolder * sh, LPCITEMIDLIST pidl, BOOL bBigIcon, UINT uFlags, int * pIndex);
56 INT SIC_GetIconIndex (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags );
58 /* Classes Root */
59 BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL bPrependDot);
60 BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len );
61 BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len );
62 BOOL HCR_GetDefaultIconW(LPCWSTR szClass, LPWSTR szDest, DWORD len, int* picon_idx);
63 BOOL HCR_GetDefaultIconFromGUIDW(REFIID riid, LPWSTR szDest, DWORD len, int* picon_idx);
64 BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len);
66 /* ANSI versions of above functions, supposed to go away as soon as they are not used anymore */
67 BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bPrependDot);
68 BOOL HCR_GetDefaultIconA(LPCSTR szClass, LPSTR szDest, DWORD len, int* picon_idx);
69 BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len);
71 BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD dwAttributes);
73 INT_PTR CALLBACK AboutDlgProc(HWND,UINT,WPARAM,LPARAM);
74 DWORD WINAPI ParseFieldA(LPCSTR src, DWORD nField, LPSTR dst, DWORD len);
75 DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len);
77 /****************************************************************************
78 * Class constructors
80 LPDATAOBJECT IDataObject_Constructor(HWND hwndOwner, LPCITEMIDLIST myPidl, LPCITEMIDLIST * apidl, UINT cidl);
81 LPENUMFORMATETC IEnumFORMATETC_Constructor(UINT, const FORMATETC []);
83 LPCLASSFACTORY IClassFactory_Constructor(REFCLSID);
84 IContextMenu2 * ISvItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, LPCITEMIDLIST *aPidls, UINT uItemCount);
85 IContextMenu2 * ISvBgCm_Constructor(LPSHELLFOLDER pSFParent, BOOL bDesktop);
86 LPSHELLVIEW IShellView_Constructor(LPSHELLFOLDER);
88 HRESULT WINAPI IFSFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
89 HRESULT WINAPI IShellLink_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
90 HRESULT WINAPI IShellLink_ConstructFromFile(IUnknown * pUnkOuter, REFIID riid, LPCITEMIDLIST pidl, LPVOID * ppv);
91 HRESULT WINAPI ISF_Desktop_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
92 HRESULT WINAPI ISF_MyComputer_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
93 HRESULT WINAPI ISF_NetworkPlaces_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
94 HRESULT WINAPI IDropTargetHelper_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
95 HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV);
96 HRESULT WINAPI IControlPanel_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
97 HRESULT WINAPI UnixFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
98 HRESULT WINAPI UnixDosFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID *ppv);
99 HRESULT WINAPI FolderShortcut_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID *ppv);
100 HRESULT WINAPI MyDocuments_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID *ppv);
101 HRESULT WINAPI RecycleBin_Constructor(IUnknown * pUnkOuter, REFIID riif, LPVOID *ppv);
102 HRESULT WINAPI ShellFSFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID *ppv);
103 extern HRESULT CPanel_GetIconLocationW(LPITEMIDLIST, LPWSTR, UINT, int*);
104 HRESULT WINAPI CPanel_ExtractIconA(LPITEMIDLIST pidl, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
105 HRESULT WINAPI CPanel_ExtractIconW(LPITEMIDLIST pidl, LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
107 HRESULT WINAPI IAutoComplete_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
109 LPEXTRACTICONA IExtractIconA_Constructor(LPCITEMIDLIST);
110 LPEXTRACTICONW IExtractIconW_Constructor(LPCITEMIDLIST);
111 HRESULT CreateStreamOnFile (LPCWSTR pszFilename, DWORD grfMode, IStream ** ppstm);
113 /* menu merging */
114 #define MM_ADDSEPARATOR 0x00000001L
115 #define MM_SUBMENUSHAVEIDS 0x00000002L
116 HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags);
118 /* initialisation for FORMATETC */
119 #define InitFormatEtc(fe, cf, med) \
121 (fe).cfFormat=cf;\
122 (fe).dwAspect=DVASPECT_CONTENT;\
123 (fe).ptd=NULL;\
124 (fe).tymed=med;\
125 (fe).lindex=-1;\
128 #define KeyStateToDropEffect(kst)\
129 ((((kst)&(MK_CONTROL|MK_SHIFT))==(MK_CONTROL|MK_SHIFT)) ? DROPEFFECT_LINK :\
130 (((kst)&(MK_CONTROL|MK_SHIFT)) ? DROPEFFECT_COPY :\
131 DROPEFFECT_MOVE))
134 HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
135 HGLOBAL RenderSHELLIDLIST (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
136 HGLOBAL RenderSHELLIDLISTOFFSET (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
137 HGLOBAL RenderFILECONTENTS (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
138 HGLOBAL RenderFILEDESCRIPTOR (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
139 HGLOBAL RenderFILENAMEA (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
140 HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
141 HGLOBAL RenderPREFEREDDROPEFFECT (DWORD dwFlags);
143 /* Change Notification */
144 void InitChangeNotifications(void);
145 void FreeChangeNotifications(void);
147 /* file operation */
148 #define ASK_DELETE_FILE 1
149 #define ASK_DELETE_FOLDER 2
150 #define ASK_DELETE_MULTIPLE_ITEM 3
151 #define ASK_CREATE_FOLDER 4
152 #define ASK_OVERWRITE_FILE 5
153 #define ASK_DELETE_SELECTED 6
154 #define ASK_TRASH_FILE 7
155 #define ASK_TRASH_FOLDER 8
156 #define ASK_TRASH_MULTIPLE_ITEM 9
157 #define ASK_CANT_TRASH_ITEM 10
158 #define ASK_OVERWRITE_FOLDER 11
160 BOOL SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pwszDir, BOOL bShowUI);
161 BOOL SHELL_ConfirmYesNoW(HWND hWnd, int nKindOfDialog, LPCWSTR szDir);
163 /* 16-bit functions */
164 void WINAPI DragAcceptFiles16(HWND16 hWnd, BOOL16 b);
165 UINT16 WINAPI DragQueryFile16(HDROP16 hDrop, WORD wFile, LPSTR lpszFile, WORD wLength);
166 void WINAPI DragFinish16(HDROP16 h);
167 BOOL16 WINAPI DragQueryPoint16(HDROP16 hDrop, POINT16 *p);
168 HINSTANCE16 WINAPI ShellExecute16(HWND16,LPCSTR,LPCSTR,LPCSTR,LPCSTR,INT16);
169 HICON16 WINAPI ExtractIcon16(HINSTANCE16,LPCSTR,UINT16);
170 HICON16 WINAPI ExtractAssociatedIcon16(HINSTANCE16,LPSTR,LPWORD);
171 HICON16 WINAPI ExtractIconEx16 ( LPCSTR, INT16, HICON16 *, HICON16 *, UINT16 );
172 HINSTANCE16 WINAPI FindExecutable16(LPCSTR,LPCSTR,LPSTR);
173 HGLOBAL16 WINAPI InternalExtractIcon16(HINSTANCE16,LPCSTR,UINT16,WORD);
174 BOOL16 WINAPI ShellAbout16(HWND16,LPCSTR,LPCSTR,HICON16);
175 BOOL16 WINAPI AboutDlgProc16(HWND16,UINT16,WPARAM16,LPARAM);
177 void WINAPI _InsertMenuItem (HMENU hmenu, UINT indexMenu, BOOL fByPosition,
178 UINT wID, UINT fType, LPCSTR dwTypeData, UINT fState);
180 static inline BOOL SHELL_OsIsUnicode(void)
182 /* if high-bit of version is 0, we are emulating NT */
183 return !(GetVersion() & 0x80000000);
186 #define __SHFreeAndNil(ptr) \
188 SHFree(*ptr); \
189 *ptr = NULL; \
191 static inline void __SHCloneStrA(char ** target,const char * source)
193 *target = SHAlloc(strlen(source)+1);
194 strcpy(*target, source);
197 static inline void __SHCloneStrWtoA(char ** target, const WCHAR * source)
199 int len = WideCharToMultiByte(CP_ACP, 0, source, -1, NULL, 0, NULL, NULL);
200 *target = SHAlloc(len);
201 WideCharToMultiByte(CP_ACP, 0, source, -1, *target, len, NULL, NULL);
204 static inline void __SHCloneStrW(WCHAR ** target, const WCHAR * source)
206 *target = SHAlloc( (lstrlenW(source)+1) * sizeof(WCHAR) );
207 lstrcpyW(*target, source);
210 static inline WCHAR * __SHCloneStrAtoW(WCHAR ** target, const char * source)
212 int len = MultiByteToWideChar(CP_ACP, 0, source, -1, NULL, 0);
213 *target = SHAlloc(len*sizeof(WCHAR));
214 MultiByteToWideChar(CP_ACP, 0, source, -1, *target, len);
215 return *target;
218 /* handle conversions */
219 #define HICON_16(h32) (LOWORD(h32))
220 #define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
221 #define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16))
222 #define HINSTANCE_16(h32) (LOWORD(h32))
224 typedef UINT_PTR (*SHELL_ExecuteW32)(const WCHAR *lpCmd, WCHAR *env, BOOL shWait,
225 LPSHELLEXECUTEINFOW sei, LPSHELLEXECUTEINFOW sei_out);
227 BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc);
229 UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
230 LPWSTR lpResult, int resultLen, LPWSTR key, WCHAR **env, LPITEMIDLIST pidl, LPCWSTR args);
232 extern WCHAR swShell32Name[MAX_PATH];
234 BOOL UNIXFS_is_rooted_at_desktop(void);
235 extern const GUID CLSID_UnixFolder;
236 extern const GUID CLSID_UnixDosFolder;
238 /* Default shell folder value registration */
239 HRESULT SHELL_RegisterShellFolders(void);
241 /* Detect Shell Links */
242 BOOL SHELL_IsShortcut(LPCITEMIDLIST);
244 #endif