OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_COMMON_WIN_UTIL_H_ | 5 #ifndef CHROME_COMMON_WIN_UTIL_H_ |
6 #define CHROME_COMMON_WIN_UTIL_H_ | 6 #define CHROME_COMMON_WIN_UTIL_H_ |
7 | 7 |
8 #include <objbase.h> | 8 #include <objbase.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // Prompt the user for location to save a file. | 167 // Prompt the user for location to save a file. |
168 // Callers should provide the filter string, and also a filter index. | 168 // Callers should provide the filter string, and also a filter index. |
169 // The parameter |index| indicates the initial index of filter description | 169 // The parameter |index| indicates the initial index of filter description |
170 // and filter pattern for the dialog box. If |index| is zero or greater than | 170 // and filter pattern for the dialog box. If |index| is zero or greater than |
171 // the number of total filter types, the system uses the first filter in the | 171 // the number of total filter types, the system uses the first filter in the |
172 // |filter| buffer. |index| is used to specify the initial selected extension, | 172 // |filter| buffer. |index| is used to specify the initial selected extension, |
173 // and when done contains the extension the user chose. The parameter | 173 // and when done contains the extension the user chose. The parameter |
174 // |final_name| returns the file name which contains the drive designator, | 174 // |final_name| returns the file name which contains the drive designator, |
175 // path, file name, and extension of the user selected file name. |def_ext| is | 175 // path, file name, and extension of the user selected file name. |def_ext| is |
176 // the default extension to give to the file if the user did not enter an | 176 // the default extension to give to the file if the user did not enter an |
177 // extension. | 177 // extension. If |ignore_suggested_ext| is true, any file extension contained in |
| 178 // |suggested_name| will not be used to generate the file name. This is useful |
| 179 // in the case of saving web pages, where we know the extension type already and |
| 180 // where |suggested_name| may contain a '.' character as a valid part of the |
| 181 // name, thus confusing our extension detection code. |
178 bool SaveFileAsWithFilter(HWND owner, | 182 bool SaveFileAsWithFilter(HWND owner, |
179 const std::wstring& suggested_name, | 183 const std::wstring& suggested_name, |
180 const std::wstring& filter, | 184 const std::wstring& filter, |
181 const std::wstring& def_ext, | 185 const std::wstring& def_ext, |
| 186 bool ignore_suggested_ext, |
182 unsigned* index, | 187 unsigned* index, |
183 std::wstring* final_name); | 188 std::wstring* final_name); |
184 | 189 |
185 // This function takes the output of a SaveAs dialog: a filename, a filter and | 190 // This function takes the output of a SaveAs dialog: a filename, a filter and |
186 // the extension originally suggested to the user (shown in the dialog box) and | 191 // the extension originally suggested to the user (shown in the dialog box) and |
187 // returns back the filename with the appropriate extension tacked on. For | 192 // returns back the filename with the appropriate extension tacked on. For |
188 // example, if you pass in 'foo' as filename with filter '*.jpg' this function | 193 // example, if you pass in 'foo' as filename with filter '*.jpg' this function |
189 // will return 'foo.jpg'. It respects MIME types, so if you pass in 'foo.jpeg' | 194 // will return 'foo.jpg'. It respects MIME types, so if you pass in 'foo.jpeg' |
190 // with filer '*.jpg' it will return 'foo.jpeg' (will not append .jpg). | 195 // with filer '*.jpg' it will return 'foo.jpeg' (will not append .jpg). |
191 // |filename| should contain the filename selected in the SaveAs dialog box and | 196 // |filename| should contain the filename selected in the SaveAs dialog box and |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 const std::wstring& text, | 270 const std::wstring& text, |
266 const std::wstring& caption, | 271 const std::wstring& caption, |
267 UINT flags); | 272 UINT flags); |
268 | 273 |
269 // Returns the system set window title font. | 274 // Returns the system set window title font. |
270 ChromeFont GetWindowTitleFont(); | 275 ChromeFont GetWindowTitleFont(); |
271 | 276 |
272 } // namespace win_util | 277 } // namespace win_util |
273 | 278 |
274 #endif // CHROME_COMMON_WIN_UTIL_H_ | 279 #endif // CHROME_COMMON_WIN_UTIL_H_ |
OLD | NEW |