From c9ece8cfa551ab9f263dee9b61cf3f89d1fb9d1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Mon, 20 Sep 2004 19:47:14 +0000 Subject: [PATCH] =?UTF-8?q?Maxime=20Belleng=EF=BF=BD=20=20-=20Add=20the=20IAutoComplete=20and=20IAutoComplet?= =?UTF-8?q?e2=20implementation=20(but=20methods=20=20=20stubbed=20for=20no?= =?UTF-8?q?w).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/trunk/; revision=10948 --- reactos/include/wine/shlguid.h | 6 +- reactos/include/wine/shtypes.h | 41 +---- reactos/include/wine/winuser.h | 1 + reactos/lib/shell32/Makefile.in | 1 + reactos/lib/shell32/debughlp.c | 3 + reactos/lib/shell32/regsvr.c | 6 + reactos/lib/shell32/shell32_main.h | 2 + reactos/lib/uuid/uuid.c | 1 + reactos/w32api/include/shldisp.h | 245 +++++++++++++++++++++++++++++ reactos/w32api/include/shlguid.h | 1 + reactos/w32api/include/shlobj.h | 24 +-- reactos/w32api/include/shtypes.h | 42 +++++ 12 files changed, 309 insertions(+), 64 deletions(-) create mode 100644 reactos/w32api/include/shldisp.h create mode 100644 reactos/w32api/include/shtypes.h diff --git a/reactos/include/wine/shlguid.h b/reactos/include/wine/shlguid.h index 2d3efc7f330..ebdba27fbdd 100644 --- a/reactos/include/wine/shlguid.h +++ b/reactos/include/wine/shlguid.h @@ -1,4 +1,4 @@ -/* $Id: shlguid.h,v 1.4 2004/06/29 13:40:40 gvg Exp $ +/* $Id: shlguid.h,v 1.5 2004/09/20 19:47:13 gvg Exp $ * * Compatibility header * @@ -48,4 +48,6 @@ DEFINE_GUID(IID_IQueryAssociations, 0xc46ca590, 0x3c3f, 0x11d2, 0xbe, 0xe6, 0x00 DEFINE_GUID(CLSID_DragDropHelper, 0x4657278a, 0x411b, 0x11d2, 0x83, 0x9a, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0xd0); -#endif /* __WINE_SHLOBJ_H */ +DEFINE_GUID(CLSID_AutoComplete, 0x00bb2763, 0x6a77, 0x11d0, 0xa5, 0x35, 0x00, 0xc0, 0x4f, 0xd7, 0xd0, 0x62); + +#endif /* __WINE_SHLGUID_H */ diff --git a/reactos/include/wine/shtypes.h b/reactos/include/wine/shtypes.h index 8946190cdd1..0f05ae0b78e 100644 --- a/reactos/include/wine/shtypes.h +++ b/reactos/include/wine/shtypes.h @@ -1,58 +1,21 @@ -/*** Autogenerated by WIDL 0.1 from shtypes.idl - Do not edit ***/ #include #include +#include_next + #ifndef __WIDL_SHTYPES_H #define __WIDL_SHTYPES_H #ifdef __cplusplus extern "C" { #endif #include -#include -typedef struct { - WORD cb; - BYTE abID[1]; -} SHITEMID, *LPSHITEMID; -typedef const SHITEMID *LPCSHITEMID; - -typedef struct _ITEMIDLIST { - SHITEMID mkid; -} ITEMIDLIST, *LPITEMIDLIST; - -typedef const ITEMIDLIST *LPCITEMIDLIST; - -#include -#if 0 -typedef struct { - int dummy; -} WIN32_FIND_DATAA, WIN32_FIND_DATAW; - -#endif typedef enum tagSTRRET_TYPE { STRRET_WSTR = 0, STRRET_OFFSET = 1, STRRET_CSTR = 2 } STRRET_TYPE; -#include -typedef struct _STRRET { - UINT uType; - union { - LPWSTR pOleStr; - UINT uOffset; - char cStr[260]; - } DUMMYUNIONNAME; -} STRRET, *LPSTRRET; - -#include -#include -typedef struct { - int fmt; - int cxChar; - STRRET str; -} SHELLDETAILS, *LPSHELLDETAILS; - #include #ifdef __cplusplus } diff --git a/reactos/include/wine/winuser.h b/reactos/include/wine/winuser.h index 97e3fd372a4..137b7144c4b 100644 --- a/reactos/include/wine/winuser.h +++ b/reactos/include/wine/winuser.h @@ -12,6 +12,7 @@ #define WS_EX_TRAYWINDOW 0x80000000L #define DCX_USESTYLE 0x00010000 #define WS_EX_MANAGED 0x40000000L /* Window managed by the window system */ +#define LB_CARETOFF 0x01a4 UINT WINAPI PrivateExtractIconsA(LPCSTR,int,int,int,HICON*,UINT*,UINT,UINT); UINT WINAPI PrivateExtractIconsW(LPCWSTR,int,int,int,HICON*,UINT*,UINT,UINT); diff --git a/reactos/lib/shell32/Makefile.in b/reactos/lib/shell32/Makefile.in index 4aa50ecc449..40ab8742334 100644 --- a/reactos/lib/shell32/Makefile.in +++ b/reactos/lib/shell32/Makefile.in @@ -13,6 +13,7 @@ SPEC_SRCS16 = $(ALTNAMES:.dll=.spec) C_SRCS = \ authors.c \ + autocomplete.c \ brsfolder.c \ changenotify.c \ classes.c \ diff --git a/reactos/lib/shell32/debughlp.c b/reactos/lib/shell32/debughlp.c index 2c3cb9d32cf..0423e1798e6 100644 --- a/reactos/lib/shell32/debughlp.c +++ b/reactos/lib/shell32/debughlp.c @@ -26,6 +26,7 @@ #include "wingdi.h" #include "pidl.h" #include "shlguid.h" +#include "shldisp.h" #include "wine/debug.h" #include "debughlp.h" #include "docobj.h" @@ -301,6 +302,8 @@ static struct { {&IID_IExtractIconA, "IID_IExtractIconA"}, {&IID_IExtractIconW, "IID_IExtractIconW"}, {&IID_IDataObject, "IID_IDataObject"}, + {&IID_IAutoComplete, "IID_IAutoComplete"}, + {&IID_IAutoComplete2, "IID_IAutoComplete2"}, {NULL,NULL}}; const char * shdebugstr_guid( const struct _GUID *id ) diff --git a/reactos/lib/shell32/regsvr.c b/reactos/lib/shell32/regsvr.c index 396a377b28c..e3f46ddf44c 100644 --- a/reactos/lib/shell32/regsvr.c +++ b/reactos/lib/shell32/regsvr.c @@ -489,6 +489,12 @@ static struct regsvr_coclass const coclass_list[] = { "Apartment", SHELLEX_MAYCHANGEDEFAULTMENU }, + { &CLSID_AutoComplete, + "AutoComplete", + NULL, + "shell32.dll", + "Apartment", + }, { NULL } /* list terminator */ }; diff --git a/reactos/lib/shell32/shell32_main.h b/reactos/lib/shell32/shell32_main.h index 2e99ea9cf11..5b1e218aa81 100644 --- a/reactos/lib/shell32/shell32_main.h +++ b/reactos/lib/shell32/shell32_main.h @@ -96,6 +96,8 @@ HRESULT WINAPI CPanel_GetIconLocationW(LPITEMIDLIST pidl, LPWSTR szIconFile, UIN HRESULT WINAPI CPanel_ExtractIconA(LPITEMIDLIST pidl, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize); HRESULT WINAPI CPanel_ExtractIconW(LPITEMIDLIST pidl, LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize); +HRESULT WINAPI IAutoComplete_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv); + LPEXTRACTICONA IExtractIconA_Constructor(LPCITEMIDLIST); LPEXTRACTICONW IExtractIconW_Constructor(LPCITEMIDLIST); HRESULT CreateStreamOnFile (LPCWSTR pszFilename, DWORD grfMode, IStream ** ppstm); diff --git a/reactos/lib/uuid/uuid.c b/reactos/lib/uuid/uuid.c index 53b28f7a331..62d8dd1f230 100644 --- a/reactos/lib/uuid/uuid.c +++ b/reactos/lib/uuid/uuid.c @@ -48,6 +48,7 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); #include "shlguid.h" #include "shlobj.h" +#include "shldisp.h" #include "comcat.h" #if 0 /* FIXME */ #include "urlmon.h" diff --git a/reactos/w32api/include/shldisp.h b/reactos/w32api/include/shldisp.h new file mode 100644 index 00000000000..4d1a9942a8b --- /dev/null +++ b/reactos/w32api/include/shldisp.h @@ -0,0 +1,245 @@ +/*** Autogenerated by WIDL 0.1 from shldisp.idl - Do not edit ***/ +#include +#include + +#ifndef __WIDL_SHLDISP_H +#define __WIDL_SHLDISP_H +#ifdef __cplusplus +extern "C" { +#endif +#include +#include +#include +#include +#include +#include +#ifndef __IAutoComplete_FWD_DEFINED__ +#define __IAutoComplete_FWD_DEFINED__ +typedef struct IAutoComplete IAutoComplete; +#endif + +typedef IAutoComplete *LPAUTOCOMPLETE; + +/***************************************************************************** + * IAutoComplete interface + */ +#ifndef __IAutoComplete_INTERFACE_DEFINED__ +#define __IAutoComplete_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_IAutoComplete, 0x00bb2762, 0x6a77, 0x11d0, 0xa5,0x35, 0x00,0xc0,0x4f,0xd7,0xd0,0x62); +#if defined(__cplusplus) && !defined(CINTERFACE) +struct IAutoComplete : public IUnknown +{ + virtual HRESULT STDMETHODCALLTYPE Init( + HWND hwndEdit, + IUnknown* punkACL, + LPCOLESTR pwszRegKeyPath, + LPCOLESTR pwszQuickComplete) = 0; + + virtual HRESULT STDMETHODCALLTYPE Enable( + BOOL fEnable) = 0; + +}; +#else +typedef struct IAutoCompleteVtbl IAutoCompleteVtbl; +struct IAutoComplete { + const IAutoCompleteVtbl* lpVtbl; +}; +struct IAutoCompleteVtbl { + ICOM_MSVTABLE_COMPAT_FIELDS + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + IAutoComplete* This, + REFIID riid, + void** ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + IAutoComplete* This); + + ULONG (STDMETHODCALLTYPE *Release)( + IAutoComplete* This); + + /*** IAutoComplete methods ***/ + HRESULT (STDMETHODCALLTYPE *Init)( + IAutoComplete* This, + HWND hwndEdit, + IUnknown* punkACL, + LPCOLESTR pwszRegKeyPath, + LPCOLESTR pwszQuickComplete); + + HRESULT (STDMETHODCALLTYPE *Enable)( + IAutoComplete* This, + BOOL fEnable); + +}; + +/*** IUnknown methods ***/ +#define IAutoComplete_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IAutoComplete_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IAutoComplete_Release(p) (p)->lpVtbl->Release(p) +/*** IAutoComplete methods ***/ +#define IAutoComplete_Init(p,a,b,c,d) (p)->lpVtbl->Init(p,a,b,c,d) +#define IAutoComplete_Enable(p,a) (p)->lpVtbl->Enable(p,a) + +#endif + +#define IAutoComplete_METHODS \ + ICOM_MSVTABLE_COMPAT_FIELDS \ + /*** IUnknown methods ***/ \ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; \ + STDMETHOD_(ULONG,AddRef)(THIS) PURE; \ + STDMETHOD_(ULONG,Release)(THIS) PURE; \ + /*** IAutoComplete methods ***/ \ + STDMETHOD_(HRESULT,Init)(THIS_ HWND hwndEdit, IUnknown* punkACL, LPCOLESTR pwszRegKeyPath, LPCOLESTR pwszQuickComplete) PURE; \ + STDMETHOD_(HRESULT,Enable)(THIS_ BOOL fEnable) PURE; + +HRESULT CALLBACK IAutoComplete_Init_Proxy( + IAutoComplete* This, + HWND hwndEdit, + IUnknown* punkACL, + LPCOLESTR pwszRegKeyPath, + LPCOLESTR pwszQuickComplete); +void __RPC_STUB IAutoComplete_Init_Stub( + struct IRpcStubBuffer* This, + struct IRpcChannelBuffer* pRpcChannelBuffer, + PRPC_MESSAGE pRpcMessage, + DWORD* pdwStubPhase); +HRESULT CALLBACK IAutoComplete_Enable_Proxy( + IAutoComplete* This, + BOOL fEnable); +void __RPC_STUB IAutoComplete_Enable_Stub( + struct IRpcStubBuffer* This, + struct IRpcChannelBuffer* pRpcChannelBuffer, + PRPC_MESSAGE pRpcMessage, + DWORD* pdwStubPhase); + +#endif /* __IAutoComplete_INTERFACE_DEFINED__ */ + +#ifndef __IAutoComplete2_FWD_DEFINED__ +#define __IAutoComplete2_FWD_DEFINED__ +typedef struct IAutoComplete2 IAutoComplete2; +#endif + +typedef IAutoComplete2 *LPAUTOCOMPLETE2; + +typedef enum _tagAUTOCOMPLETEOPTIONS { + ACO_NONE = 0x0, + ACO_AUTOSUGGEST = 0x1, + ACO_AUTOAPPEND = 0x2, + ACO_SEARCH = 0x4, + ACO_FILTERPREFIXES = 0x8, + ACO_USETAB = 0x10, + ACO_UPDOWNKEYDROPSLIST = 0x20, + ACO_RTLREADING = 0x40 +} AUTOCOMPLETEOPTIONS; + +/***************************************************************************** + * IAutoComplete2 interface + */ +#ifndef __IAutoComplete2_INTERFACE_DEFINED__ +#define __IAutoComplete2_INTERFACE_DEFINED__ + +DEFINE_GUID(IID_IAutoComplete2, 0xeac04bc0, 0x3791, 0x11d2, 0xbb,0x95, 0x00,0x60,0x97,0x7b,0x46,0x4c); +#if defined(__cplusplus) && !defined(CINTERFACE) +struct IAutoComplete2 : public IAutoComplete +{ + virtual HRESULT STDMETHODCALLTYPE SetOptions( + DWORD dwFlag) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetOptions( + DWORD* pdwFlag) = 0; + +}; +#else +typedef struct IAutoComplete2Vtbl IAutoComplete2Vtbl; +struct IAutoComplete2 { + const IAutoComplete2Vtbl* lpVtbl; +}; +struct IAutoComplete2Vtbl { + ICOM_MSVTABLE_COMPAT_FIELDS + + /*** IUnknown methods ***/ + HRESULT (STDMETHODCALLTYPE *QueryInterface)( + IAutoComplete2* This, + REFIID riid, + void** ppvObject); + + ULONG (STDMETHODCALLTYPE *AddRef)( + IAutoComplete2* This); + + ULONG (STDMETHODCALLTYPE *Release)( + IAutoComplete2* This); + + /*** IAutoComplete methods ***/ + HRESULT (STDMETHODCALLTYPE *Init)( + IAutoComplete2* This, + HWND hwndEdit, + IUnknown* punkACL, + LPCOLESTR pwszRegKeyPath, + LPCOLESTR pwszQuickComplete); + + HRESULT (STDMETHODCALLTYPE *Enable)( + IAutoComplete2* This, + BOOL fEnable); + + /*** IAutoComplete2 methods ***/ + HRESULT (STDMETHODCALLTYPE *SetOptions)( + IAutoComplete2* This, + DWORD dwFlag); + + HRESULT (STDMETHODCALLTYPE *GetOptions)( + IAutoComplete2* This, + DWORD* pdwFlag); + +}; + +/*** IUnknown methods ***/ +#define IAutoComplete2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IAutoComplete2_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IAutoComplete2_Release(p) (p)->lpVtbl->Release(p) +/*** IAutoComplete methods ***/ +#define IAutoComplete2_Init(p,a,b,c,d) (p)->lpVtbl->Init(p,a,b,c,d) +#define IAutoComplete2_Enable(p,a) (p)->lpVtbl->Enable(p,a) +/*** IAutoComplete2 methods ***/ +#define IAutoComplete2_SetOptions(p,a) (p)->lpVtbl->SetOptions(p,a) +#define IAutoComplete2_GetOptions(p,a) (p)->lpVtbl->GetOptions(p,a) + +#endif + +#define IAutoComplete2_METHODS \ + ICOM_MSVTABLE_COMPAT_FIELDS \ + /*** IUnknown methods ***/ \ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; \ + STDMETHOD_(ULONG,AddRef)(THIS) PURE; \ + STDMETHOD_(ULONG,Release)(THIS) PURE; \ + /*** IAutoComplete methods ***/ \ + STDMETHOD_(HRESULT,Init)(THIS_ HWND hwndEdit, IUnknown* punkACL, LPCOLESTR pwszRegKeyPath, LPCOLESTR pwszQuickComplete) PURE; \ + STDMETHOD_(HRESULT,Enable)(THIS_ BOOL fEnable) PURE; \ + /*** IAutoComplete2 methods ***/ \ + STDMETHOD_(HRESULT,SetOptions)(THIS_ DWORD dwFlag) PURE; \ + STDMETHOD_(HRESULT,GetOptions)(THIS_ DWORD* pdwFlag) PURE; + +HRESULT CALLBACK IAutoComplete2_SetOptions_Proxy( + IAutoComplete2* This, + DWORD dwFlag); +void __RPC_STUB IAutoComplete2_SetOptions_Stub( + struct IRpcStubBuffer* This, + struct IRpcChannelBuffer* pRpcChannelBuffer, + PRPC_MESSAGE pRpcMessage, + DWORD* pdwStubPhase); +HRESULT CALLBACK IAutoComplete2_GetOptions_Proxy( + IAutoComplete2* This, + DWORD* pdwFlag); +void __RPC_STUB IAutoComplete2_GetOptions_Stub( + struct IRpcStubBuffer* This, + struct IRpcChannelBuffer* pRpcChannelBuffer, + PRPC_MESSAGE pRpcMessage, + DWORD* pdwStubPhase); + +#endif /* __IAutoComplete2_INTERFACE_DEFINED__ */ + +#ifdef __cplusplus +} +#endif +#endif /* __WIDL_SHLDISP_H */ diff --git a/reactos/w32api/include/shlguid.h b/reactos/w32api/include/shlguid.h index ff1dfa01551..d38299fa6c2 100644 --- a/reactos/w32api/include/shlguid.h +++ b/reactos/w32api/include/shlguid.h @@ -71,6 +71,7 @@ extern const GUID IID_IDropTargetHelper; extern const GUID IID_IDragSourceHelper; #if (_WIN32_IE >= 0x400 || _WIN32_WINNT >= 0x500) extern const GUID IID_IPersistFolder2; +extern const GUID CLSID_AutoComplete; #endif #if (_WIN32_WINNT >= 0x500) extern const GUID IID_IPersistFolder3; diff --git a/reactos/w32api/include/shlobj.h b/reactos/w32api/include/shlobj.h index 1e53e3b558f..7e1f8b5e4b6 100644 --- a/reactos/w32api/include/shlobj.h +++ b/reactos/w32api/include/shlobj.h @@ -11,6 +11,7 @@ extern "C" { #include #include #include +#include #pragma pack(push,1) #include @@ -384,15 +385,6 @@ typedef struct _IDA { UINT cidl; UINT aoffset[1]; } CIDA,*LPIDA; -typedef struct _SHITEMID { - USHORT cb; - BYTE abID[1]; -} SHITEMID, * LPSHITEMID; -typedef const SHITEMID *LPCSHITEMID; -typedef struct _ITEMIDLIST { - SHITEMID mkid; -} ITEMIDLIST,*LPITEMIDLIST; -typedef const ITEMIDLIST *LPCITEMIDLIST; typedef int (CALLBACK* BFFCALLBACK)(HWND,UINT,LPARAM,LPARAM); typedef struct _browseinfoA { HWND hwndOwner; @@ -448,14 +440,6 @@ typedef enum tagSHCONTF { SHCONTF_SHAREABLE = 1024, SHCONTF_STORAGE = 2048 } SHCONTF; -typedef struct _STRRET { - UINT uType; - _ANONYMOUS_UNION union { - LPWSTR pOleStr; - UINT uOffset; - char cStr[MAX_PATH]; - } DUMMYUNIONNAME; -} STRRET,*LPSTRRET; typedef enum { FD_CLSID=1,FD_SIZEPOINT=2,FD_ATTRIBUTES=4,FD_CREATETIME=8,FD_ACCESSTIME=16, FD_WRITESTIME=32,FD_FILESIZE=64,FD_LINKUI=0x8000 @@ -545,12 +529,6 @@ typedef struct DWORD pid; } SHCOLUMNID, *LPSHCOLUMNID; typedef const SHCOLUMNID *LPCSHCOLUMNID; -typedef struct _SHELLDETAILS -{ - int fmt; - int cxChar; - STRRET str; -} SHELLDETAILS, *LPSHELLDETAILS; typedef struct { LPITEMIDLIST pidlTargetFolder; diff --git a/reactos/w32api/include/shtypes.h b/reactos/w32api/include/shtypes.h new file mode 100644 index 00000000000..427fa3ffca3 --- /dev/null +++ b/reactos/w32api/include/shtypes.h @@ -0,0 +1,42 @@ +#ifndef _SHTYPES_H +#define _SHTYPES_H +#if __GNUC__ >= 3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif +#pragma pack(push,1) + +typedef struct _SHITEMID { + USHORT cb; + BYTE abID[1]; +} SHITEMID, * LPSHITEMID; +typedef const SHITEMID *LPCSHITEMID; +typedef struct _ITEMIDLIST { + SHITEMID mkid; +} ITEMIDLIST,*LPITEMIDLIST; +typedef const ITEMIDLIST *LPCITEMIDLIST; +typedef struct _STRRET { + UINT uType; + _ANONYMOUS_UNION union { + LPWSTR pOleStr; + UINT uOffset; + char cStr[MAX_PATH]; + } DUMMYUNIONNAME; +} STRRET,*LPSTRRET; +typedef struct _SHELLDETAILS +{ + int fmt; + int cxChar; + STRRET str; +} SHELLDETAILS, *LPSHELLDETAILS; + +#pragma pack(pop) +#ifdef __cplusplus +} +#endif + + +#endif /* _SHLOBJ_H */