update dev300-m57
[ooovba.git] / tools / win / inc / shutil.h
blob41bf223164ac047f12c0ce9b12d19757e7184869
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: shutil.h,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SHUTIL_H_
32 #define _SHUTIL_H_
34 #if defined WNT
36 #ifndef _SHOBJ_H
37 #include <shlobj.h>
38 #endif
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
44 #define PROTOCOL_FILE "file:"
45 #define MAX_URL (MAX_PATH + sizeof(PROTOCOL_FILE))
47 #define SHUTIL_TO_DELIVER
49 //--------------------------------------------------------------------------
51 void * WINAPI WIN_SHAlloc( ULONG cb );
52 void * WINAPI WIN_SHRealloc( void *pv, ULONG cb );
53 void WINAPI WIN_SHFree( void *pv );
55 //--------------------------------------------------------------------------
57 ULONG WINAPI WIN_SHGetIDListSize( LPCITEMIDLIST pidl );
58 BOOL WINAPI WIN_SHCloneIDList( LPCITEMIDLIST pidl, LPITEMIDLIST *ppidl );
59 BOOL WINAPI WIN_SHAppendIDList( LPCITEMIDLIST pidl, LPITEMIDLIST *ppidl );
60 LONG WINAPI WIN_SHCompareIDList( LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2 );
62 LONG WINAPI WIN_SHGetIDListTokenCount( LPCITEMIDLIST pidl );
63 BOOL WINAPI WIN_SHGetIDListToken( LPCITEMIDLIST pidl, ULONG nToken, LPITEMIDLIST *ppidl );
65 BOOL WINAPI WIN_SHSplitIDList(
66 LPCITEMIDLIST pidl,
67 LPITEMIDLIST * pidlFolder,
68 LPITEMIDLIST * pidlItem
71 BOOL WINAPI WIN_SHSplitIDListEx(
72 LPCITEMIDLIST pidl,
73 LPITEMIDLIST * pidlParent,
74 LPITEMIDLIST * pidlChild,
75 ULONG nLevel
78 //--------------------------------------------------------------------------
80 #define WIN_SHGetSpecialFolderLocation( nFolder, ppidl ) \
81 ((BOOL)(NOERROR == SHGetSpecialFolderLocation( GetFocus(), nFolder, ppidl )))
83 #define WIN_SHGetPathFromIDList( pidl, pszPath ) \
84 SHGetPathFromIDList( pidl, pszPath )
86 // #define SHGP_CLSID 0x00000001
88 // BOOL WINAPI WIN_SHGetPathFromIDListEx( LPCITEMIDLIST pidl, LPSTR pszBuffer, UINT uFlags );
90 BOOL WINAPI WIN_SHGetIDListFromPath( LPCSTR pszPath, LPITEMIDLIST *ppidl );
92 BOOL WINAPI WIN_SHGetPathFromURL( LPCSTR pszURL, LPSTR pszPath );
93 BOOL WINAPI WIN_SHGetURLFromPath( LPCSTR pszPath, LPSTR pszURL );
95 BOOL WINAPI WIN_SHGetFolderFromIDList( LPCITEMIDLIST pidl, LPSHELLFOLDER *ppshf );
96 BOOL WINAPI WIN_SHGetSpecialFolder( int nFolder, LPSHELLFOLDER *ppshf );
97 BOOL WINAPI WIN_SHGetFolderFromPath( LPCSTR pszPath, LPSHELLFOLDER *ppshf );
99 BOOL WINAPI WIN_SHGetSpecialFolderPath( int nFolder, LPSTR pszPath );
101 HRESULT WINAPI WIN_SHGetDataFromIDList(
102 LPSHELLFOLDER psf,
103 LPCITEMIDLIST pidl,
104 int nFormat,
105 PVOID pv,
106 int cb
110 //--------------------------------------------------------------------------
112 #define SHIC_PIDL 0x00000001
113 #define SHIC_NO_UI 0x00000002
115 #define CMDSTR_OPENA "open"
116 #define CMDSTR_EXPLOREA "explore"
117 #define CMDSTR_FINDA "find"
119 #define CMDSTR_OPENW L"open"
120 #define CMDSTR_EXPLOREW L"explore"
121 #define CMDSTR_FINDW L"find"
123 #ifdef UNICODE
124 #define CMDSTR_OPEN CMDSTR_OPENW
125 #define CMDSTR_EXPLORE CMDSTR_EXPLOREW
126 #define CMDSTR_FIND CMDSTR_FINDW
127 #else
128 #define CMDSTR_OPEN CMDSTR_OPENA
129 #define CMDSTR_EXPLORE CMDSTR_EXPLOREA
130 #define CMDSTR_FIND CMDSTR_FINDA
131 #endif
133 #define CMDSTR_DEFAULT MAKEINTRESOURCE(0x00)
135 #define CMDSTR_LINK MAKEINTRESOURCE(0x10)
136 #define CMDSTR_DELETE MAKEINTRESOURCE(0x11)
137 #define CMDSTR_RENAME MAKEINTRESOURCE(0x12)
138 #define CMDSTR_PROPERTIES MAKEINTRESOURCE(0x13)
139 #define CMDSTR_CUT MAKEINTRESOURCE(0x18)
140 #define CMDSTR_COPY MAKEINTRESOURCE(0x19)
142 BOOL WINAPI WIN_SHInvokeCommand(
143 HWND hwndOwner,
144 DWORD dwFlags,
145 LPCTSTR lpPath,
146 LPCSTR lpVerb,
147 LPCSTR lpParameters,
148 LPCSTR lpDirectory,
149 int nShow
152 //--------------------------------------------------------------------------
154 BOOL WINAPI WIN_SHStrRetToMultiByte(
155 LPCITEMIDLIST pidl,
156 const STRRET * pStr,
157 LPSTR lpMultiByte,
158 int cchMultiByte
161 DWORD WIN_SHBuildCRC( LPVOID pBytes, ULONG nBytes );
163 DWORD WINAPI WIN_GetShellVersion(VOID);
165 HIMAGELIST WINAPI WIN_SHGetSystemImageList( UINT uFlags );
167 //--------------------------------------------------------------------------
171 ULONG WINAPI WIN_CreateStringFromBinary (
172 LPCVOID pv,
173 ULONG cbSize,
174 LPSTR pszString,
175 ULONG cbStringSize
178 ULONG WINAPI WIN_CreateBinaryFromString(
179 LPCSTR pszStr,
180 LPVOID pBuffer,
181 ULONG cbSize
185 //--------------------------------------------------------------------------
187 DWORD WINAPI WIN_SHSetValue(
188 HKEY hKey,
189 LPCTSTR pszSubKey,
190 LPCTSTR pszValue,
191 DWORD dwType,
192 LPCVOID pvData,
193 DWORD cbData
196 DWORD WINAPI WIN_SHGetValue(
197 HKEY hKey,
198 LPCTSTR pszSubKey,
199 LPCTSTR pszValue,
200 LPDWORD pdwType,
201 LPVOID pvData,
202 LPDWORD pcbData
205 DWORD WINAPI WIN_SHDeleteValue(
206 HKEY hKey,
207 LPCTSTR pszSubKey,
208 LPCTSTR pszValue
211 #ifdef __cplusplus
213 #endif
215 #endif
217 #endif // _SHUTIL_H_