Commit 15602ccf authored by Juergen Schmied's avatar Juergen Schmied Committed by Alexandre Julliard

- new interface declaration for IShellfolder2

- added this interface to all shell folders - small fixes to shellview (crash with native comdlg32)
parent 38eae846
/*
* ShellView
*
* Copyright 1998,1999 <juergen.schmied@metronet.de>
* Copyright 1998,1999 <juergen.schmied@debitel.net>
*
* FIXME: when the ShellView_WndProc gets a WM_NCDESTROY should we do a
* Release() ???
*
* FIXME: There is still a design problem in this implementation.
* This implementation is more or less ok for file system folders
* but there are many more kinds of folders.
* The shellview is not supposed to know much about the colums
* appearing in the view. To fix this it should use the IShellFolder2
* interface when possible to get the informations dynamically
* this will take a lot of work to implemet and wont likely not
* be done in near future
* Please considder this when code new features. Mail me if you
* are in doubt how to do things. (jsch 25/10/99)
*
* FIXME: Set the buttons in the filedialog according to the view state
*/
#include <stdlib.h>
......@@ -220,7 +232,6 @@ static void CheckToolbar(IShellViewImpl * This)
/**********************************************************
* change the style of the listview control
*/
static void SetStyle(IShellViewImpl * This, DWORD dwAdd, DWORD dwRemove)
{
DWORD tmpstyle;
......@@ -278,6 +289,11 @@ static BOOL ShellView_CreateList (IShellViewImpl * This)
}
/**********************************************************
* ShellView_InitList()
*
* NOTES
* FIXME: the headers should depend on the kind of shellfolder
* thats creating the shellview. this hack implements only the
* correct headers for a filesystem folder (jsch 25/10/99)
*/
static BOOL ShellView_InitList(IShellViewImpl * This)
{
......@@ -297,11 +313,11 @@ static BOOL ShellView_InitList(IShellViewImpl * This)
LoadStringA(shell32_hInstance, IDS_SHV_COLUMN1, szString, sizeof(szString));
ListView_InsertColumnA(This->hWndList, 0, &lvColumn);
lvColumn.cx = 80;
lvColumn.cx = 60;
LoadStringA(shell32_hInstance, IDS_SHV_COLUMN2, szString, sizeof(szString));
ListView_InsertColumnA(This->hWndList, 1, &lvColumn);
lvColumn.cx = 170;
lvColumn.cx = 120;
LoadStringA(shell32_hInstance, IDS_SHV_COLUMN3, szString, sizeof(szString));
ListView_InsertColumnA(This->hWndList, 2, &lvColumn);
......@@ -332,7 +348,6 @@ static INT CALLBACK ShellView_CompareItems(LPVOID lParam1, LPVOID lParam2, LPARA
return ret;
}
/*************************************************************************
* ShellView_ListViewCompareItems
*
......@@ -349,7 +364,13 @@ static INT CALLBACK ShellView_CompareItems(LPVOID lParam1, LPVOID lParam2, LPARA
* or zero if the two items are equivalent
*
* NOTES
*
* FIXME: function does what ShellView_CompareItems is supposed to do.
* unify it and figure out how to use the undocumented first parameter
* of IShellFolder_CompareIDs to do the job this function does and
* move this code to IShellFolder.
* make LISTVIEW_SORT_INFO obsolete
* the way this function works is only usable if we had only
* filesystemfolders (25/10/99 jsch)
*/
static INT CALLBACK ShellView_ListViewCompareItems(LPVOID lParam1, LPVOID lParam2, LPARAM lpData)
{
......@@ -961,7 +982,11 @@ static LRESULT ShellView_OnCommand(IShellViewImpl * This,DWORD dwCmdID, DWORD dw
case 0x31:
case 0x32:
case 0x33:
ListView_SortItems(This->hWndList, ShellView_ListViewCompareItems, (LPARAM) (dwCmdID - 0x30));
This->ListViewSortInfo.nHeaderID = (LPARAM) (dwCmdID - 0x30);
This->ListViewSortInfo.bIsAscending = TRUE;
This->ListViewSortInfo.nLastHeaderID = This->ListViewSortInfo.nHeaderID;
ListView_SortItems(This->hWndList, ShellView_ListViewCompareItems, (LPARAM) (&(This->ListViewSortInfo)));
CheckToolbar(This);
break;
default:
......@@ -1014,23 +1039,20 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn
break;
case LVN_COLUMNCLICK:
{
This->ListViewSortInfo.nHeaderID = lpnmlv->iSubItem;
if(This->ListViewSortInfo.nLastHeaderID == This->ListViewSortInfo.nHeaderID)
{
This->ListViewSortInfo.bIsAscending = !This->ListViewSortInfo.bIsAscending;
}
else
{
This->ListViewSortInfo.bIsAscending = TRUE;
}
This->ListViewSortInfo.nLastHeaderID = This->ListViewSortInfo.nHeaderID;
This->ListViewSortInfo.nHeaderID = lpnmlv->iSubItem;
if(This->ListViewSortInfo.nLastHeaderID == This->ListViewSortInfo.nHeaderID)
{
This->ListViewSortInfo.bIsAscending = !This->ListViewSortInfo.bIsAscending;
}
else
{
This->ListViewSortInfo.bIsAscending = TRUE;
}
This->ListViewSortInfo.nLastHeaderID = This->ListViewSortInfo.nHeaderID;
ListView_SortItems(lpnmlv->hdr.hwndFrom, ShellView_ListViewCompareItems, (LPARAM) (&(This->ListViewSortInfo)));
break;
}
case LVN_GETDISPINFOA:
TRACE("-- LVN_GETDISPINFOA %p\n",This);
pidl = (LPITEMIDLIST)lpdi->item.lParam;
......@@ -1319,13 +1341,15 @@ static HRESULT WINAPI IShellView_fnTranslateAccelerator(IShellView * iface,LPMSG
{
ICOM_THIS(IShellViewImpl, iface);
#if 0
FIXME("(%p)->(%p: hwnd=%x msg=%x lp=%lx wp=%x) stub\n",This,lpmsg, lpmsg->hwnd, lpmsg->message, lpmsg->lParam, lpmsg->wParam);
#endif
switch (lpmsg->message)
{ case WM_KEYDOWN: TRACE("-- key=0x04%x",lpmsg->wParam) ;
if ((lpmsg->message>=WM_KEYFIRST) && (lpmsg->message>=WM_KEYLAST))
{
TRACE("-- key=0x04%x",lpmsg->wParam) ;
}
return NOERROR;
return S_FALSE; /* not handled */
}
static HRESULT WINAPI IShellView_fnEnableModeless(IShellView * iface,BOOL fEnable)
......@@ -1341,7 +1365,9 @@ static HRESULT WINAPI IShellView_fnUIActivate(IShellView * iface,UINT uState)
{
ICOM_THIS(IShellViewImpl, iface);
/*
CHAR szName[MAX_PATH];
*/
LRESULT lResult;
int nPartArray[1] = {-1};
......@@ -1360,15 +1386,19 @@ static HRESULT WINAPI IShellView_fnUIActivate(IShellView * iface,UINT uState)
if(uState != SVUIA_DEACTIVATE)
{
/*
GetFolderPath is not a method of IShellFolder
IShellFolder_GetFolderPath( This->pSFParent, szName, sizeof(szName) );
*/
/* set the number of parts */
IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_STATUS, SB_SETPARTS, 1,
(LPARAM)nPartArray, &lResult);
/* set the text for the parts */
/*
IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_STATUS, SB_SETTEXTA,
0, (LPARAM)szName, &lResult);
*/
}
return S_OK;
......
......@@ -10,6 +10,7 @@
#include "wine/obj_base.h"
#include "wine/obj_moniker.h" /* for LPBC */
#include "wine/obj_enumidlist.h"
#include "wine/obj_oleaut.h"
#include "winbase.h"
#include "shell.h"
......@@ -48,6 +49,49 @@ typedef struct IShellFolder IShellFolder, *LPSHELLFOLDER;
DEFINE_SHLGUID(IID_IPersistFolder, 0x000214EAL, 0, 0);
typedef struct IPersistFolder IPersistFolder, *LPPERSISTFOLDER;
DEFINE_GUID(IID_IShellFolder2, 0xB82C5AA8, 0xA41B, 0x11D2, 0xBE, 0x32, 0x0, 0xc0, 0x4F, 0xB9, 0x36, 0x61);
typedef struct IShellFolder2 IShellFolder2, *LPSHELLFOLDER2;
DEFINE_GUID(IID_IEnumExtraSearch, 0xE700BE1, 0x9DB6, 0x11D1, 0xA1, 0xCE, 0x0, 0xc0, 0x4F, 0xD7, 0x5D, 0x13);
typedef struct IEnumExtraSearch IEnumExtraSearch, *LPENUMEXTRASEARCH;
/*****************************************************************************
* IEnumExtraSearch interface
*/
typedef struct
{
GUID guidSearch;
WCHAR wszFriendlyName[80];
WCHAR wszMenuText[80];
WCHAR wszHelpText[MAX_PATH];
WCHAR wszUrl[2084];
WCHAR wszIcon[MAX_PATH+10];
WCHAR wszGreyIcon[MAX_PATH+10];
WCHAR wszClrIcon[MAX_PATH+10];
} EXTRASEARCH,* LPEXTRASEARCH;
#define ICOM_INTERFACE IEnumExtraSearch
#define IEnumExtraSearch_METHODS \
ICOM_METHOD3(HRESULT, Next, ULONG, celt, LPEXTRASEARCH*, rgelt, ULONG*, pceltFetched) \
ICOM_METHOD1(HRESULT, Skip, ULONG, celt) \
ICOM_METHOD (HRESULT, Reset) \
ICOM_METHOD1(HRESULT, Clone, IEnumExtraSearch**, ppenum)
#define IEnumExtraSearch_IMETHODS \
IUnknown_IMETHODS \
IEnumExtraSearch_METHODS
ICOM_DEFINE(IEnumExtraSearch,IUnknown)
#undef ICOM_INTERFACE
/*** IUnknown methods ***/
#define IEnumIDList_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
#define IEnumIDList_AddRef(p) ICOM_CALL (AddRef,p)
#define IEnumIDList_Release(p) ICOM_CALL (Release,p)
/*** IEnumIDList methods ***/
#define IEnumIDList_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
#define IEnumIDList_Skip(p,a) ICOM_CALL1(Skip,p,a)
#define IEnumIDList_Reset(p) ICOM_CALL(Reset,p)
#define IEnumIDList_Clone(p,a) ICOM_CALL1(Clone,p,a)
/*****************************************************************************
* IShellFolder::GetDisplayNameOf/SetNameOf uFlags
......@@ -156,8 +200,7 @@ DWORD WINAPI SHGetDesktopFolder(IShellFolder * *);
ICOM_METHOD3( HRESULT, GetAttributesOf, UINT, cidl, LPCITEMIDLIST *, apidl, ULONG *, rgfInOut)\
ICOM_METHOD6( HRESULT, GetUIObjectOf, HWND, hwndOwner, UINT, cidl, LPCITEMIDLIST *, apidl, REFIID, riid, UINT *, prgfInOut, LPVOID *, ppvOut)\
ICOM_METHOD3( HRESULT, GetDisplayNameOf, LPCITEMIDLIST, pidl, DWORD, uFlags, LPSTRRET, lpName)\
ICOM_METHOD5( HRESULT, SetNameOf, HWND, hwndOwner, LPCITEMIDLIST, pidl,LPCOLESTR, lpszName, DWORD, uFlags,LPITEMIDLIST *, ppidlOut)\
ICOM_METHOD2( HRESULT, GetFolderPath, LPSTR, lpszOut, DWORD, dwOutSize)
ICOM_METHOD5( HRESULT, SetNameOf, HWND, hwndOwner, LPCITEMIDLIST, pidl,LPCOLESTR, lpszName, DWORD, uFlags,LPITEMIDLIST *, ppidlOut)
#define IShellFolder_IMETHODS \
IUnknown_IMETHODS \
IShellFolder_METHODS
......@@ -179,12 +222,89 @@ ICOM_DEFINE(IShellFolder,IUnknown)
#define IShellFolder_GetUIObjectOf(p,a,b,c,d,e,f) ICOM_CALL6(GetUIObjectOf,p,a,b,c,d,e,f)
#define IShellFolder_GetDisplayNameOf(p,a,b,c) ICOM_CALL3(GetDisplayNameOf,p,a,b,c)
#define IShellFolder_SetNameOf(p,a,b,c,d,e) ICOM_CALL5(SetNameOf,p,a,b,c,d,e)
#define IShellFolder_GetFolderPath(p,a,b) ICOM_CALL2(GetFolderPath,p,a,b)
/*****************************************************************************
* IShellFolder2 interface
*/
/* IShellFolder2 */
/* GetDefaultColumnState */
typedef enum
{
SHCOLSTATE_TYPE_STR = 0x00000001,
SHCOLSTATE_TYPE_INT = 0x00000002,
SHCOLSTATE_TYPE_DATE = 0x00000003,
SHCOLSTATE_TYPEMASK = 0x0000000F,
SHCOLSTATE_ONBYDEFAULT = 0x00000010,
SHCOLSTATE_SLOW = 0x00000020,
SHCOLSTATE_EXTENDED = 0x00000040,
SHCOLSTATE_SECONDARYUI = 0x00000080,
SHCOLSTATE_HIDDEN = 0x00000100,
} SHCOLSTATE;
typedef struct
{
GUID fmtid;
DWORD pid;
} SHCOLUMNID, *LPSHCOLUMNID;
typedef const SHCOLUMNID* LPCSHCOLUMNID;
/* GetDetailsEx */
#define PID_FINDDATA 0
#define PID_NETRESOURCE 1
#define PID_DESCRIPTIONID 2
typedef struct
{
int fmt;
int cxChar;
STRRET str;
} SHELLDETAILS, *LPSHELLDETAILS;
#define ICOM_INTERFACE IShellFolder2
#define IShellFolder2_METHODS \
ICOM_METHOD1( HRESULT, GetDefaultSearchGUID, LPGUID, lpguid)\
ICOM_METHOD1( HRESULT, EnumSearches, LPENUMEXTRASEARCH *, ppEnum) \
ICOM_METHOD3( HRESULT, GetDefaultColumn, DWORD, dwReserved, ULONG *, pSort, ULONG *, pDisplay)\
ICOM_METHOD2( HRESULT, GetDefaultColumnState, UINT, iColumn, DWORD *, pcsFlags)\
ICOM_METHOD3( HRESULT, GetDetailsEx, LPCITEMIDLIST, pidl, const SHCOLUMNID *, pscid, VARIANT *, pv)\
ICOM_METHOD3( HRESULT, GetDetailsOf, LPCITEMIDLIST, pidl, UINT, iColumn, LPSHELLDETAILS, pDetails)\
ICOM_METHOD2( HRESULT, MapNameToSCID, LPCWSTR, pwszName, SHCOLUMNID *, pscid)
#define IShellFolder2_IMETHODS \
IShellFolder_METHODS \
IShellFolder2_METHODS
ICOM_DEFINE(IShellFolder2, IShellFolder)
#undef ICOM_INTERFACE
/*** IUnknown methods ***/
#define IShellFolder2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
#define IShellFolder2_AddRef(p) ICOM_CALL (AddRef,p)
#define IShellFolder2_Release(p) ICOM_CALL (Release,p)
/*** IShellFolder methods ***/
#define IShellFolder2_ParseDisplayName(p,a,b,c,d,e,f) ICOM_CALL6(ParseDisplayName,p,a,b,c,d,e,f)
#define IShellFolder2_EnumObjects(p,a,b,c) ICOM_CALL3(EnumObjects,p,a,b,c)
#define IShellFolder2_BindToObject(p,a,b,c,d) ICOM_CALL4(BindToObject,p,a,b,c,d)
#define IShellFolder2_BindToStorage(p,a,b,c,d) ICOM_CALL4(BindToStorage,p,a,b,c,d)
#define IShellFolder2_CompareIDs(p,a,b,c) ICOM_CALL3(CompareIDs,p,a,b,c)
#define IShellFolder2_CreateViewObject(p,a,b,c) ICOM_CALL3(CreateViewObject,p,a,b,c)
#define IShellFolder2_GetAttributesOf(p,a,b,c) ICOM_CALL3(GetAttributesOf,p,a,b,c)
#define IShellFolder2_GetUIObjectOf(p,a,b,c,d,e,f) ICOM_CALL6(GetUIObjectOf,p,a,b,c,d,e,f)
#define IShellFolder2_GetDisplayNameOf(p,a,b,c) ICOM_CALL3(GetDisplayNameOf,p,a,b,c)
#define IShellFolder2_SetNameOf(p,a,b,c,d,e) ICOM_CALL5(SetNameOf,p,a,b,c,d,e)
/*** IShellFolder2 methods ***/
#define IShellFolder2_GetDefaultSearchGUID(p,a) ICOM_CALL1(GetDefaultSearchGUID,p,a)
#define IShellFolder2_EnumSearches(p,a) ICOM_CALL1(EnumSearches,p,a)
#define IShellFolder2_GetDefaultColumn(p,a,b,c) ICOM_CALL3(GetDefaultColumn,p,a,b,c)
#define IShellFolder2_GetDefaultColumnState(p,a,b) ICOM_CALL2(GetDefaultColumnState,p,a,b)
#define IShellFolder2_GetDetailsEx(p,a,b,c) ICOM_CALL3(GetDetailsEx,p,a,b,c)
#define IShellFolder2_GetDetailsOf(p,a,b,c) ICOM_CALL3(GetDetailsOf,p,a,b,c)
#define IShellFolder2_MapNameToSCID(p,a,b) ICOM_CALL2(MapNameToSCID,p,a,b)
/*****************************************************************************
* IPersistFolder interface
*/
/* ClassID's */
DEFINE_GUID (CLSID_SFMyComp,0x20D04FE0,0x3AEA,0x1069,0xA2,0xD8,0x08,0x00,0x2B,0x30,0x30,0x9D);
DEFINE_GUID (CLSID_SFINet, 0x871C5380,0x42A0,0x1069,0xA2,0xEA,0x08,0x00,0x2B,0x30,0x30,0x9D);
DEFINE_GUID (CLSID_SFFile, 0xF3364BA0,0x65B9,0x11CE,0xA9,0xBA,0x00,0xAA,0x00,0x4A,0xE8,0x37);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment