| 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 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // the user canceling or closing the selection dialog box, for example). | 61 // the user canceling or closing the selection dialog box, for example). |
| 62 // |params| is contextual passed to SelectFile. | 62 // |params| is contextual passed to SelectFile. |
| 63 virtual void FileSelectionCanceled(void* params) {}; | 63 virtual void FileSelectionCanceled(void* params) {}; |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 // Creates a dialog box helper. This object is ref-counted, but the returned | 66 // Creates a dialog box helper. This object is ref-counted, but the returned |
| 67 // object will have no reference (refcount is 0). | 67 // object will have no reference (refcount is 0). |
| 68 static SelectFileDialog* Create(Listener* listener); | 68 static SelectFileDialog* Create(Listener* listener); |
| 69 | 69 |
| 70 // Selects a file. This will start displaying the dialog box. This will also | 70 // Selects a file. This will start displaying the dialog box. This will also |
| 71 // block the calling HWND until the dialog box is complete. The listener | 71 // block the calling window until the dialog box is complete. The listener |
| 72 // associated with this object will be notified when the selection is | 72 // associated with this object will be notified when the selection is |
| 73 // complete. | 73 // complete. |
| 74 // |type| is the type of file dialog to be shown, see Type enumeration above. | 74 // |type| is the type of file dialog to be shown, see Type enumeration above. |
| 75 // |title| is the title to be displayed in the dialog. If this string is | 75 // |title| is the title to be displayed in the dialog. If this string is |
| 76 // empty, the default title is used. | 76 // empty, the default title is used. |
| 77 // |default_path| is the default path and suggested file name to be shown in | 77 // |default_path| is the default path and suggested file name to be shown in |
| 78 // the dialog. This only works for SELECT_SAVEAS_FILE and SELECT_OPEN_FILE. | 78 // the dialog. This only works for SELECT_SAVEAS_FILE and SELECT_OPEN_FILE. |
| 79 // Can be an empty string to indicate Windows should choose the default to | 79 // Can be an empty string to indicate Windows should choose the default to |
| 80 // show. | 80 // show. |
| 81 // |filter| is a null (\0) separated list of alternating filter description | 81 // |filter| is a null (\0) separated list of alternating filter description |
| 82 // and filters and terminated with two nulls. | 82 // and filters and terminated with two nulls. |
| 83 // |owning_hwnd| is the window the dialog is modal to, or NULL for a modeless | 83 // |owning_window| is the window the dialog is modal to, or NULL for a |
| 84 // dialog. | 84 // modeless dialog. |
| 85 // |default_extension| is the default extension to add to the file if the | 85 // |default_extension| is the default extension to add to the file if the |
| 86 // user doesn't type one. This should NOT include the '.'. If you specify | 86 // user doesn't type one. This should NOT include the '.'. If you specify |
| 87 // this you must also specify a filter. | 87 // this you must also specify a filter. |
| 88 // |params| is data from the calling context which will be passed through to | 88 // |params| is data from the calling context which will be passed through to |
| 89 // the listener. Can be NULL. | 89 // the listener. Can be NULL. |
| 90 // NOTE: only one instance of any shell dialog can be shown per owning_hwnd | 90 // NOTE: only one instance of any shell dialog can be shown per owning_window |
| 91 // at a time (for obvious reasons). | 91 // at a time (for obvious reasons). |
| 92 virtual void SelectFile(Type type, | 92 virtual void SelectFile(Type type, |
| 93 const std::wstring& title, | 93 const std::wstring& title, |
| 94 const std::wstring& default_path, | 94 const std::wstring& default_path, |
| 95 const std::wstring& filter, | 95 const std::wstring& filter, |
| 96 const std::wstring& default_extension, | 96 const std::wstring& default_extension, |
| 97 gfx::NativeView owning_window, | 97 gfx::NativeView owning_window, |
| 98 void* params) = 0; | 98 void* params) = 0; |
| 99 }; | 99 }; |
| 100 | 100 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 126 static SelectFontDialog* Create(Listener* listener); | 126 static SelectFontDialog* Create(Listener* listener); |
| 127 | 127 |
| 128 // Selects a font. This will start displaying the dialog box. This will also | 128 // Selects a font. This will start displaying the dialog box. This will also |
| 129 // block the calling window until the dialog box is complete. The listener | 129 // block the calling window until the dialog box is complete. The listener |
| 130 // associated with this object will be notified when the selection is | 130 // associated with this object will be notified when the selection is |
| 131 // complete. | 131 // complete. |
| 132 // |owning_window| is the window the dialog is modal to, or NULL for a | 132 // |owning_window| is the window the dialog is modal to, or NULL for a |
| 133 // modeless dialog. | 133 // modeless dialog. |
| 134 // |params| is data from the calling context which will be passed through to | 134 // |params| is data from the calling context which will be passed through to |
| 135 // the listener. Can be NULL. | 135 // the listener. Can be NULL. |
| 136 // NOTE: only one instance of any shell dialog can be shown per owning_hwnd | 136 // NOTE: only one instance of any shell dialog can be shown per owning_window |
| 137 // at a time (for obvious reasons). | 137 // at a time (for obvious reasons). |
| 138 // TODO(beng): support specifying the default font selected in the list when | 138 // TODO(beng): support specifying the default font selected in the list when |
| 139 // the dialog appears. | 139 // the dialog appears. |
| 140 virtual void SelectFont(gfx::NativeView owning_window, | 140 virtual void SelectFont(gfx::NativeView owning_window, |
| 141 void* params) = 0; | 141 void* params) = 0; |
| 142 | 142 |
| 143 // Same as above - also support specifying the default font selected in the | 143 // Same as above - also support specifying the default font selected in the |
| 144 // list when the dialog appears. | 144 // list when the dialog appears. |
| 145 virtual void SelectFont(gfx::NativeView owning_window, | 145 virtual void SelectFont(gfx::NativeView owning_window, |
| 146 void* params, | 146 void* params, |
| 147 const std::wstring& font_name, | 147 const std::wstring& font_name, |
| 148 int font_size) = 0; | 148 int font_size) = 0; |
| 149 }; | 149 }; |
| 150 | 150 |
| 151 #endif // CHROME_BROWSER_SHELL_DIALOGS_H_ | 151 #endif // CHROME_BROWSER_SHELL_DIALOGS_H_ |
| OLD | NEW |