Use min/max instead of MIN/MAX.
[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     } Shell;
50
51     struct {
52         HWND hwndOwner;
53         HWND hwndView;
54         RECT rectView;
55         FOLDERSETTINGS folderSettings;
56         LPITEMIDLIST pidlAbsCurrent;
57         LPWSTR lpstrCurrentFilter;
58     } ShellInfos;
59
60     struct {
61         HWND hwndFileTypeCB;
62         HWND hwndLookInCB;
63         HWND hwndFileName;
64         HWND hwndTB;
65         HWND hwndCustomDlg;
66         DWORD dwDlgProp;
67     } DlgInfos;
68
69 } FileOpenDlgInfos;
70
71 /***********************************************************************
72  * Control ID's
73  */
74 #define IDS_ABOUTBOX                    101
75 #define IDS_DOCUMENTFOLDERS             102
76 #define IDS_PERSONAL                    103
77 #define IDS_FAVORITES                   104
78 #define IDS_PATH                        105
79 #define IDS_DESKTOP                     106
80
81 #define IDS_FONTS                       108
82 #define IDS_MYCOMPUTER                  110
83 #define IDS_SYSTEMFOLDERS               112
84 #define IDS_LOCALHARDRIVES              113
85 #define IDS_FILENOTFOUND                114
86 #define IDS_VERIFYFILE                  115
87 #define IDS_CREATEFILE                  116
88 #define IDS_CREATEFOLDER_DENIED         117
89 #define IDS_FILEOPEN_CAPTION            118
90
91 /* File Dialog Tooltips string IDs */
92
93 #define IDS_UPFOLDER                    150
94 #define IDS_NEWFOLDER                   151
95 #define IDS_LISTVIEW                    152
96 #define IDS_REPORTVIEW                  153
97
98 #define IDC_OPENREADONLY                chx1
99
100 #define IDC_TOOLBARSTATIC               stc1
101 #define IDC_FILETYPESTATIC              stc2
102 #define IDC_FILENAMESTATIC              stc3
103 #define IDC_LOOKINSTATIC                stc4
104
105 #define IDC_SHELLSTATIC                 lst1
106
107 #define IDC_FILETYPE                    cmb1
108 #define IDC_LOOKIN                      cmb2
109
110 #define IDC_FILENAME                    edt1
111
112 #define IDC_TOOLBAR                     ctl1
113
114 /***********************************************************************
115  * Prototypes for the methods of the IShellBrowserImpl class
116  */
117 /* Constructor */
118 IShellBrowser * IShellBrowserImpl_Construct(HWND hwndOwner);
119
120 /* IUnknown */
121 HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface,
122                                             REFIID riid, 
123                                             LPVOID *ppvObj);
124
125 ULONG WINAPI IShellBrowserImpl_AddRef(IShellBrowser * iface);
126
127 ULONG WINAPI IShellBrowserImpl_Release(IShellBrowser * iface);
128
129 /* IOleWindow */
130 HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface,  
131                                            HWND * phwnd);
132
133 HRESULT WINAPI IShellBrowserImpl_ContextSensitiveHelp(IShellBrowser * iface,
134                                                       BOOL fEnterMode);
135
136 /* IShellBrowser */
137
138 HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface, 
139                                           LPCITEMIDLIST pidl,   
140                                           UINT wFlags);
141
142 HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface,    
143                                               BOOL fEnable);
144                                               
145 HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface,    
146                                               UINT id,    
147                                               HWND *lphwnd);
148
149 HRESULT WINAPI IShellBrowserImpl_GetViewStateStream(IShellBrowser *iface,
150                                                 DWORD grfMode,    
151                                                 LPSTREAM *ppStrm);
152
153 HRESULT WINAPI IShellBrowserImpl_InsertMenusSB(IShellBrowser *iface,
154                                            HMENU hmenuShared,
155                                            LPOLEMENUGROUPWIDTHS lpMenuWidths);
156
157 HRESULT WINAPI IShellBrowserImpl_OnViewWindowActive(IShellBrowser *iface,
158                                                 IShellView *ppshv);
159                                               
160
161 HRESULT WINAPI IShellBrowserImpl_QueryActiveShellView(IShellBrowser *iface,
162                                                   IShellView **ppshv);
163
164 HRESULT WINAPI IShellBrowserImpl_RemoveMenusSB(IShellBrowser *iface,
165                                            HMENU hmenuShared);
166
167 HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface,    
168                                             UINT id,    
169                                             UINT uMsg,    
170                                             WPARAM wParam,    
171                                             LPARAM lParam,
172                                             LRESULT *pret);
173
174 HRESULT WINAPI IShellBrowserImpl_SetMenuSB(IShellBrowser *iface,
175                                        HMENU hmenuShared,    
176                                        HOLEMENU holemenuReserved,
177                                        HWND hwndActiveObject);
178
179 HRESULT WINAPI IShellBrowserImpl_SetStatusTextSB(IShellBrowser *iface,
180                                              LPCOLESTR lpszStatusText);
181                                                 
182
183 HRESULT WINAPI IShellBrowserImpl_SetToolbarItems(IShellBrowser *iface,
184                                              LPTBBUTTON lpButtons,    
185                                              UINT nButtons,    
186                                              UINT uFlags);
187                                               
188 HRESULT WINAPI IShellBrowserImpl_TranslateAcceleratorSB(IShellBrowser *iface,
189                                                     LPMSG lpmsg,    
190                                                     WORD wID);
191
192
193 /* ICommDlgBrowser */
194
195 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_QueryInterface(ICommDlgBrowser *iface,
196                                             REFIID riid, 
197                                             LPVOID *ppvObj);
198
199 ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_AddRef(ICommDlgBrowser * iface);
200
201 ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_Release(ICommDlgBrowser * iface);
202
203 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(ICommDlgBrowser *iface,
204                                                                   IShellView *ppshv);
205
206 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnStateChange(ICommDlgBrowser *iface,
207                                                                IShellView *ppshv,
208                                                                ULONG uChange);
209
210 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface, 
211                                                                IShellView * ppshv,
212                                                                LPCITEMIDLIST pidl);
213
214
215
216 LPITEMIDLIST GetSelectedPidl(IShellView *ppshv);
217 BOOL EnumSelectedPidls(IShellView *ppshv, UINT nPidlIndex, LPITEMIDLIST *pidlSelected);
218 UINT GetNumSelected(IShellView *ppshv);
219
220 #endif /*SHBROWSER_H*/