filedlgbrowser.h 4.84 KB
Newer Older
1 2
/*
 *  Implementation of IShellBrowser for the File Open common dialog
3
 *
4 5
 * Copyright 1999 Francois Boisvert
 * Copyright 1999, 2000 Juergen Schmied
6
 *
7 8 9 10 11 12 13 14 15 16 17 18
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * 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
20 21 22
 */

#ifndef SHBROWSER_H
23
#define SHBROWSER_H
24

25 26 27 28 29
#ifndef RC_INVOKED
#include <stdarg.h>
#endif

#include "windef.h"
30
#include "winbase.h"
31 32
#include "winuser.h"
#include "shlobj.h"
33 34 35 36 37 38 39
#include "objbase.h"
#include "commdlg.h"

/***********************************************************************
 * Defines and global variables
 */

40 41 42
/* dialog internal property */

#define FODPROP_SAVEDLG 0x0001  /* File dialog is a Save file dialog */
43
#define FODPROP_USEVIEW 0x0002  /* Indicates the user selection must be taken
44 45
				   from the IShellView */

46 47 48 49 50 51 52
/***********************************************************************
 * Data structure
 */


typedef struct
{
Jacek Caban's avatar
Jacek Caban committed
53
    LPOPENFILENAMEW ofnInfos;
54 55 56 57 58 59 60
    BOOL unicode;
    LPWSTR initdir;
    LPWSTR filename;
    LPCWSTR title;
    LPCWSTR defext;
    LPCWSTR filter;
    LPCWSTR customfilter;
61
    struct {
62
        IShellBrowser *FOIShellBrowser;
63 64
        IShellFolder *FOIShellFolder;
        IShellView *FOIShellView;
65
	IDataObject *FOIDataObject;
66 67 68 69 70 71 72 73 74 75 76 77 78 79
    } Shell;

    struct {
        HWND hwndOwner;
        HWND hwndView;
        FOLDERSETTINGS folderSettings;
        LPITEMIDLIST pidlAbsCurrent;
        LPWSTR lpstrCurrentFilter;
    } ShellInfos;

    struct {
        HWND hwndFileTypeCB;
        HWND hwndLookInCB;
        HWND hwndFileName;
80
	HWND hwndTB;
81
        HWND hwndCustomDlg;
82
	DWORD dwDlgProp;
83 84
    } DlgInfos;

85 86 87 88 89 90 91
    struct {
	UINT fileokstring;
	UINT lbselchstring;
	UINT helpmsgstring;
	UINT sharevistring;
    } HookMsg;

92 93
} FileOpenDlgInfos;

94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
/***********************************************************************
 * Control ID's
 */
#define IDS_ABOUTBOX                    101
#define IDS_DOCUMENTFOLDERS             102
#define IDS_PERSONAL                    103
#define IDS_FAVORITES                   104
#define IDS_PATH                        105
#define IDS_DESKTOP                     106

#define IDS_FONTS                       108
#define IDS_MYCOMPUTER                  110
#define IDS_SYSTEMFOLDERS               112
#define IDS_LOCALHARDRIVES              113
#define IDS_FILENOTFOUND                114
#define IDS_VERIFYFILE                  115
#define IDS_CREATEFILE                  116
Alexandre Julliard's avatar
Alexandre Julliard committed
111 112
#define IDS_CREATEFOLDER_DENIED         117
#define IDS_FILEOPEN_CAPTION            118
113
#define IDS_OVERWRITEFILE		119
114 115 116 117
#define IDS_INVALID_FILENAME_TITLE	120
#define IDS_INVALID_FILENAME		121
#define IDS_PATHNOTEXISTING		122
#define IDS_FILENOTEXISTING		123
118

Alexandre Julliard's avatar
Alexandre Julliard committed
119 120 121 122 123 124
/* File Dialog Tooltips string IDs */

#define IDS_UPFOLDER                    150
#define IDS_NEWFOLDER                   151
#define IDS_LISTVIEW                    152
#define IDS_REPORTVIEW                  153
Juergen Schmied's avatar
Juergen Schmied committed
125
#define IDS_TODESKTOP                   154
Alexandre Julliard's avatar
Alexandre Julliard committed
126

127 128 129 130 131 132 133 134 135 136 137 138 139 140
#define IDC_OPENREADONLY                chx1

#define IDC_TOOLBARSTATIC		stc1
#define IDC_FILETYPESTATIC              stc2
#define IDC_FILENAMESTATIC              stc3
#define IDC_LOOKINSTATIC                stc4

#define IDC_SHELLSTATIC                 lst1

#define IDC_FILETYPE                    cmb1
#define IDC_LOOKIN                      cmb2

#define IDC_FILENAME                    edt1

141
#define IDC_TOOLBAR			1
142

143 144 145 146 147 148 149
/***********************************************************************
 * Prototypes for the methods of the IShellBrowserImpl class
 */
/* Constructor */
IShellBrowser * IShellBrowserImpl_Construct(HWND hwndOwner);


150 151
LPITEMIDLIST GetPidlFromDataObject ( IDataObject *doSelected, UINT nPidlIndex);
UINT GetNumSelected(IDataObject *doSelected);
152

153
/* pidl handling */
154
BOOL IsPidlFolder (LPSHELLFOLDER psf, LPCITEMIDLIST pidl);
155 156 157

/* Functions used by the EDIT box */
void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd);
158

159 160 161 162 163 164 165 166 167 168 169
/**************************************************************************
*   External Prototypes
*/
extern const char FileOpenDlgInfosStr[];

extern IShellFolder*    GetShellFolderFromPidl(LPITEMIDLIST pidlAbs);
extern LPITEMIDLIST     GetParentPidl(LPITEMIDLIST pidl);

extern int     FILEDLG95_LOOKIN_SelectItem(HWND hwnd,LPITEMIDLIST pidl);
extern LRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode);

170
#endif /*SHBROWSER_H*/