Sunc with trunk revision 58971.
[reactos.git] / dll / win32 / comdlg32 / filedlgbrowser.h
1 /*
2 * Implementation of IShellBrowser for the File Open common dialog
3 *
4 * Copyright 1999 Francois Boisvert
5 * Copyright 1999, 2000 Juergen Schmied
6 *
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.
11 *
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.
16 *
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
20 */
21
22 #ifndef SHBROWSER_H
23 #define SHBROWSER_H
24
25 #define WIN32_NO_STATUS
26 #define _INC_WINDOWS
27 #define COM_NO_WINDOWS_H
28
29 //#ifndef RC_INVOKED
30 //#include <stdarg.h>
31 //#endif
32
33 //#include "windef.h"
34 //#include "winbase.h"
35 //#include "winuser.h"
36 #include "wincon.h"
37 #include <shlobj.h>
38 //#include "objbase.h"
39 //#include "commdlg.h"
40
41 /***********************************************************************
42 * Defines and global variables
43 */
44
45 /* dialog internal property */
46
47 #define FODPROP_SAVEDLG 0x0001 /* File dialog is a Save file dialog */
48 #define FODPROP_USEVIEW 0x0002 /* Indicates the user selection must be taken
49 from the IShellView */
50
51 /***********************************************************************
52 * Data structure
53 */
54
55
56 typedef struct
57 {
58 LPOPENFILENAMEW ofnInfos;
59 BOOL unicode;
60 LPWSTR initdir;
61 LPWSTR filename;
62 LPCWSTR title;
63 LPCWSTR defext;
64 LPCWSTR filter;
65 LPCWSTR customfilter;
66 SIZE sizedlg; /* remember the size of the dialog */
67 POINT initial_size; /* remember the initial size of the dialog */
68 struct {
69 IShellBrowser *FOIShellBrowser;
70 IShellFolder *FOIShellFolder;
71 IShellView *FOIShellView;
72 IDataObject *FOIDataObject;
73 } Shell;
74
75 struct {
76 HWND hwndOwner;
77 HWND hwndView;
78 FOLDERSETTINGS folderSettings;
79 LPITEMIDLIST pidlAbsCurrent;
80 LPWSTR lpstrCurrentFilter;
81 } ShellInfos;
82
83 struct {
84 HWND hwndFileTypeCB;
85 HWND hwndLookInCB;
86 HWND hwndFileName;
87 HWND hwndTB;
88 HWND hwndGrip;
89 HWND hwndCustomDlg;
90 DWORD dwDlgProp;
91 } DlgInfos;
92
93 struct {
94 UINT fileokstring;
95 UINT lbselchstring;
96 UINT helpmsgstring;
97 UINT sharevistring;
98 } HookMsg;
99
100 } FileOpenDlgInfos;
101
102 /***********************************************************************
103 * Control IDs
104 */
105 #define IDS_FILENOTFOUND 114
106 #define IDS_VERIFYFILE 115
107 #define IDS_CREATEFILE 116
108 #define IDS_OVERWRITEFILE 119
109 #define IDS_INVALID_FILENAME_TITLE 120
110 #define IDS_INVALID_FILENAME 121
111 #define IDS_PATHNOTEXISTING 122
112 #define IDS_FILENOTEXISTING 123
113
114 /* File Dialog Tooltips string IDs */
115
116 #define IDS_UPFOLDER 150
117 #define IDS_NEWFOLDER 151
118 #define IDS_LISTVIEW 152
119 #define IDS_REPORTVIEW 153
120 #define IDS_TODESKTOP 154
121
122 #define IDC_OPENREADONLY chx1
123
124 #define IDC_TOOLBARSTATIC stc1
125 #define IDC_FILETYPESTATIC stc2
126 #define IDC_FILENAMESTATIC stc3
127 #define IDC_LOOKINSTATIC stc4
128
129 #define IDC_SHELLSTATIC lst1
130
131 #define IDC_FILETYPE cmb1
132 #define IDC_LOOKIN cmb2
133
134 #define IDC_FILENAME edt1
135
136 #define IDC_TOOLBAR 1
137
138 /***********************************************************************
139 * Prototypes for the methods of the IShellBrowserImpl class
140 */
141 /* Constructor */
142 IShellBrowser * IShellBrowserImpl_Construct(HWND hwndOwner) DECLSPEC_HIDDEN;
143
144
145 LPITEMIDLIST GetPidlFromDataObject ( IDataObject *doSelected, UINT nPidlIndex) DECLSPEC_HIDDEN;
146
147 /* Functions used by the EDIT box */
148 void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd) DECLSPEC_HIDDEN;
149
150 /**************************************************************************
151 * External Prototypes
152 */
153 extern const char FileOpenDlgInfosStr[] DECLSPEC_HIDDEN;
154
155 extern IShellFolder* GetShellFolderFromPidl(LPITEMIDLIST pidlAbs) DECLSPEC_HIDDEN;
156 extern LPITEMIDLIST GetParentPidl(LPITEMIDLIST pidl) DECLSPEC_HIDDEN;
157
158 extern int FILEDLG95_LOOKIN_SelectItem(HWND hwnd,LPITEMIDLIST pidl) DECLSPEC_HIDDEN;
159 extern LRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode) DECLSPEC_HIDDEN;
160
161 #endif /*SHBROWSER_H*/