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_BROWSER_SHELL_DIALOGS_H_ | 5 #ifndef CHROME_BROWSER_SHELL_DIALOGS_H_ |
6 #define CHROME_BROWSER_SHELL_DIALOGS_H_ | 6 #define CHROME_BROWSER_SHELL_DIALOGS_H_ |
7 | 7 |
8 // TODO(maruel): Remove once HWND is typedef. | 8 // TODO(maruel): Remove once HWND is typedef. |
9 #include <windows.h> | 9 #include <windows.h> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // block the calling HWND until the dialog box is complete. The listener | 66 // block the calling HWND until the dialog box is complete. The listener |
67 // associated with this object will be notified when the selection is | 67 // associated with this object will be notified when the selection is |
68 // complete. | 68 // complete. |
69 // |type| is the type of file dialog to be shown, see Type enumeration above. | 69 // |type| is the type of file dialog to be shown, see Type enumeration above. |
70 // |title| is the title to be displayed in the dialog. If this string is | 70 // |title| is the title to be displayed in the dialog. If this string is |
71 // empty, the default title is used. | 71 // empty, the default title is used. |
72 // |default_path| is the default path and suggested file name to be shown in | 72 // |default_path| is the default path and suggested file name to be shown in |
73 // the dialog. This only works for SELECT_SAVEAS_FILE and SELECT_OPEN_FILE. | 73 // the dialog. This only works for SELECT_SAVEAS_FILE and SELECT_OPEN_FILE. |
74 // Can be an empty string to indicate Windows should choose the default to | 74 // Can be an empty string to indicate Windows should choose the default to |
75 // show. | 75 // show. |
| 76 // |filter| is a null (\0) separated list of alternating filter description |
| 77 // and filters and terminated with two nulls. |
76 // |owning_hwnd| is the window the dialog is modal to, or NULL for a modeless | 78 // |owning_hwnd| is the window the dialog is modal to, or NULL for a modeless |
77 // dialog. | 79 // dialog. |
78 // |params| is data from the calling context which will be passed through to | 80 // |params| is data from the calling context which will be passed through to |
79 // the listener. Can be NULL. | 81 // the listener. Can be NULL. |
80 // NOTE: only one instance of any shell dialog can be shown per owning_hwnd | 82 // NOTE: only one instance of any shell dialog can be shown per owning_hwnd |
81 // at a time (for obvious reasons). | 83 // at a time (for obvious reasons). |
| 84 // TODO: convert all callers to this and rip out the old. |
82 virtual void SelectFile(Type type, | 85 virtual void SelectFile(Type type, |
83 const std::wstring& title, | 86 const std::wstring& title, |
84 const std::wstring& default_path, | 87 const std::wstring& default_path, |
| 88 const std::wstring& filter, |
85 HWND owning_hwnd, | 89 HWND owning_hwnd, |
86 void* params) = 0; | 90 void* params) = 0; |
| 91 |
| 92 void SelectFile(Type type, |
| 93 const std::wstring& title, |
| 94 const std::wstring& default_path, |
| 95 HWND owning_hwnd, |
| 96 void* params) { |
| 97 SelectFile(type, title, default_path, std::wstring(), |
| 98 owning_hwnd, params); |
| 99 } |
87 }; | 100 }; |
88 | 101 |
89 // Shows a dialog box for selecting a font. | 102 // Shows a dialog box for selecting a font. |
90 class SelectFontDialog | 103 class SelectFontDialog |
91 : public base::RefCountedThreadSafe<SelectFileDialog>, | 104 : public base::RefCountedThreadSafe<SelectFileDialog>, |
92 public BaseShellDialog { | 105 public BaseShellDialog { |
93 public: | 106 public: |
94 virtual ~SelectFontDialog() {} | 107 virtual ~SelectFontDialog() {} |
95 | 108 |
96 // An interface implemented by a Listener object wishing to know about the | 109 // An interface implemented by a Listener object wishing to know about the |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 143 |
131 // Same as above - also support specifying the default font selected in the | 144 // Same as above - also support specifying the default font selected in the |
132 // list when the dialog appears. | 145 // list when the dialog appears. |
133 virtual void SelectFont(HWND owning_hwnd, | 146 virtual void SelectFont(HWND owning_hwnd, |
134 void* params, | 147 void* params, |
135 const std::wstring& font_name, | 148 const std::wstring& font_name, |
136 int font_size) = 0; | 149 int font_size) = 0; |
137 }; | 150 }; |
138 | 151 |
139 #endif // #ifndef CHROME_BROWSER_SHELL_DIALOGS_H_ | 152 #endif // #ifndef CHROME_BROWSER_SHELL_DIALOGS_H_ |
140 | |
OLD | NEW |