- fixed reported bugs
[wine] / dlls / commdlg / filedlgbrowser.h
1 /*
2  *  Implementation of IShellBrowser for the File Open common dialog
3  * 
4  *
5  */
6
7 #ifndef SHBROWSER_H
8 #define SHBROWSER_H TRUE
9
10 #include "shlobj.h"
11 #include "winbase.h"
12 #include "objbase.h"
13 #include "commdlg.h"
14
15 /***********************************************************************
16  * Defines and global variables
17  */
18 #define _ICOM_THIS_FromICommDlgBrowser(Class,name) Class* This = (Class*) (((char*)name)-sizeof(void *))
19
20 /* dialog internal property */
21
22 #define FODPROP_SAVEDLG 0x0001  /* File dialog is a Save file dialog */
23 #define FODPROP_USEVIEW 0x0002  /* Indicates the user selection must be taken 
24                                    from the IShellView */
25
26 /***********************************************************************
27  * Data structure
28  */
29
30
31 typedef struct
32 {
33
34     ICOM_VTABLE(IShellBrowser)* lpVtbl;         /* IShellBrowser VTable */
35     ICOM_VTABLE(ICommDlgBrowser)* lpVtbl2;      /* ICommDlgBrowser VTable */
36     DWORD ref;                                  /* Reference counter */
37     HWND hwndOwner;                             /* Owner dialog of the interface */
38
39 } IShellBrowserImpl;
40
41 typedef struct
42 {
43     
44     LPOPENFILENAMEA ofnInfos;
45     struct {
46         IShellBrowser *FOIShellBrowser; 
47         IShellFolder *FOIShellFolder;
48         IShellView *FOIShellView;
49         IDataObject *FOIDataObject;
50     } Shell;
51
52     struct {
53         HWND hwndOwner;
54         HWND hwndView;
55         RECT rectView;
56         FOLDERSETTINGS folderSettings;
57         LPITEMIDLIST pidlAbsCurrent;
58         LPWSTR lpstrCurrentFilter;
59     } ShellInfos;
60
61     struct {
62         HWND hwndFileTypeCB;
63         HWND hwndLookInCB;
64         HWND hwndFileName;
65         HWND hwndTB;
66         HWND hwndCustomDlg;
67         DWORD dwDlgProp;
68     } DlgInfos;
69
70 } FileOpenDlgInfos;
71
72 /***********************************************************************
73  * Control ID's
74  */
75 #define IDS_ABOUTBOX                    101
76 #define IDS_DOCUMENTFOLDERS             102
77 #define IDS_PERSONAL                    103
78 #define IDS_FAVORITES                   104
79 #define IDS_PATH                        105
80 #define IDS_DESKTOP                     106
81
82 #define IDS_FONTS                       108
83 #define IDS_MYCOMPUTER                  110
84 #define IDS_SYSTEMFOLDERS               112
85 #define IDS_LOCALHARDRIVES              113
86 #define IDS_FILENOTFOUND                114
87 #define IDS_VERIFYFILE                  115
88 #define IDS_CREATEFILE                  116
89 #define IDS_CREATEFOLDER_DENIED         117
90 #define IDS_FILEOPEN_CAPTION            118
91 #define IDL_OVERWRITEFILE               119
92 #define IDS_INVALID_FILENAME_TITLE      120
93 #define IDS_INVALID_FILENAME            121
94 #define IDS_PATHNOTEXISTING             122
95 #define IDS_FILENOTEXISTING             123
96
97 /* File Dialog Tooltips string IDs */
98
99 #define IDS_UPFOLDER                    150
100 #define IDS_NEWFOLDER                   151
101 #define IDS_LISTVIEW                    152
102 #define IDS_REPORTVIEW                  153
103 #define IDS_TODESKTOP                   154
104
105 #define IDC_OPENREADONLY                chx1
106
107 #define IDC_TOOLBARSTATIC               stc1
108 #define IDC_FILETYPESTATIC              stc2
109 #define IDC_FILENAMESTATIC              stc3
110 #define IDC_LOOKINSTATIC                stc4
111
112 #define IDC_SHELLSTATIC                 lst1
113
114 #define IDC_FILETYPE                    cmb1
115 #define IDC_LOOKIN                      cmb2
116
117 #define IDC_FILENAME                    edt1
118
119 #define IDC_TOOLBAR                     ctl1
120
121 /***********************************************************************
122  * Prototypes for the methods of the IShellBrowserImpl class
123  */
124 /* Constructor */
125 IShellBrowser * IShellBrowserImpl_Construct(HWND hwndOwner);
126
127 /* IUnknown */
128 HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface,
129                                             REFIID riid, 
130                                             LPVOID *ppvObj);
131
132 ULONG WINAPI IShellBrowserImpl_AddRef(IShellBrowser * iface);
133
134 ULONG WINAPI IShellBrowserImpl_Release(IShellBrowser * iface);
135
136 /* IOleWindow */
137 HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface,  
138                                            HWND * phwnd);
139
140 HRESULT WINAPI IShellBrowserImpl_ContextSensitiveHelp(IShellBrowser * iface,
141                                                       BOOL fEnterMode);
142
143 /* IShellBrowser */
144
145 HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface, 
146                                           LPCITEMIDLIST pidl,   
147                                           UINT wFlags);
148
149 HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface,    
150                                               BOOL fEnable);
151                                               
152 HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface,    
153                                               UINT id,    
154                                               HWND *lphwnd);
155
156 HRESULT WINAPI IShellBrowserImpl_GetViewStateStream(IShellBrowser *iface,
157                                                 DWORD grfMode,    
158                                                 LPSTREAM *ppStrm);
159
160 HRESULT WINAPI IShellBrowserImpl_InsertMenusSB(IShellBrowser *iface,
161                                            HMENU hmenuShared,
162                                            LPOLEMENUGROUPWIDTHS lpMenuWidths);
163
164 HRESULT WINAPI IShellBrowserImpl_OnViewWindowActive(IShellBrowser *iface,
165                                                 IShellView *ppshv);
166                                               
167
168 HRESULT WINAPI IShellBrowserImpl_QueryActiveShellView(IShellBrowser *iface,
169                                                   IShellView **ppshv);
170
171 HRESULT WINAPI IShellBrowserImpl_RemoveMenusSB(IShellBrowser *iface,
172                                            HMENU hmenuShared);
173
174 HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface,    
175                                             UINT id,    
176                                             UINT uMsg,    
177                                             WPARAM wParam,    
178                                             LPARAM lParam,
179                                             LRESULT *pret);
180
181 HRESULT WINAPI IShellBrowserImpl_SetMenuSB(IShellBrowser *iface,
182                                        HMENU hmenuShared,    
183                                        HOLEMENU holemenuReserved,
184                                        HWND hwndActiveObject);
185
186 HRESULT WINAPI IShellBrowserImpl_SetStatusTextSB(IShellBrowser *iface,
187                                              LPCOLESTR lpszStatusText);
188                                                 
189
190 HRESULT WINAPI IShellBrowserImpl_SetToolbarItems(IShellBrowser *iface,
191                                              LPTBBUTTON lpButtons,    
192                                              UINT nButtons,    
193                                              UINT uFlags);
194                                               
195 HRESULT WINAPI IShellBrowserImpl_TranslateAcceleratorSB(IShellBrowser *iface,
196                                                     LPMSG lpmsg,    
197                                                     WORD wID);
198
199
200 /* ICommDlgBrowser */
201
202 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_QueryInterface(ICommDlgBrowser *iface,
203                                             REFIID riid, 
204                                             LPVOID *ppvObj);
205
206 ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_AddRef(ICommDlgBrowser * iface);
207
208 ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_Release(ICommDlgBrowser * iface);
209
210 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(ICommDlgBrowser *iface,
211                                                                   IShellView *ppshv);
212
213 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnStateChange(ICommDlgBrowser *iface,
214                                                                IShellView *ppshv,
215                                                                ULONG uChange);
216
217 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface, 
218                                                                IShellView * ppshv,
219                                                                LPCITEMIDLIST pidl);
220
221
222 LPITEMIDLIST GetPidlFromDataObject ( IDataObject *doSelected, UINT nPidlIndex);
223 UINT GetNumSelected(IDataObject *doSelected);
224
225 /* pidl handling */
226 BOOL IsPidlFolder (LPSHELLFOLDER psf, LPITEMIDLIST pidl);
227
228 /* Functions used by the EDIT box */
229 void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd);
230 int FILEDLG95_FILENAME_GetFileNames (HWND hwnd, LPSTR * lpstrFileList, UINT * sizeUsed);
231
232 #endif /*SHBROWSER_H*/