OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 PRINTING_PRINTING_CONTEXT_H_ | 5 #ifndef PRINTING_PRINTING_CONTEXT_H_ |
6 #define PRINTING_PRINTING_CONTEXT_H_ | 6 #define PRINTING_PRINTING_CONTEXT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 Delegate() {}; | 31 Delegate() {}; |
32 virtual ~Delegate() {}; | 32 virtual ~Delegate() {}; |
33 | 33 |
34 // Returns parent view to use for modal dialogs. | 34 // Returns parent view to use for modal dialogs. |
35 virtual gfx::NativeView GetParentView() = 0; | 35 virtual gfx::NativeView GetParentView() = 0; |
36 | 36 |
37 // Returns application locale. | 37 // Returns application locale. |
38 virtual std::string GetAppLocale() = 0; | 38 virtual std::string GetAppLocale() = 0; |
39 }; | 39 }; |
40 | 40 |
41 // Tri-state result for user behavior-dependent functions. | 41 // Result for user behavior-dependent functions. |
42 enum Result { | 42 enum Result { |
43 OK, | 43 OK, |
44 CANCEL, | 44 CANCEL, |
45 FAILED, | 45 FAILED, |
| 46 SYSTEM_DIALOG_DONE, |
46 }; | 47 }; |
47 | 48 |
48 virtual ~PrintingContext(); | 49 virtual ~PrintingContext(); |
49 | 50 |
50 // Callback of AskUserForSettings, used to notify the PrintJobWorker when | 51 // Callback of AskUserForSettings, used to notify the PrintJobWorker when |
51 // print settings are available. | 52 // print settings are available. |
52 typedef base::Callback<void(Result)> PrintSettingsCallback; | 53 typedef base::Callback<void(Result)> PrintSettingsCallback; |
53 | 54 |
54 // Asks the user what printer and format should be used to print. Updates the | 55 // Asks the user what printer and format should be used to print. Updates the |
55 // context with the select device settings. The result of the call is returned | 56 // context with the select device settings. The result of the call is returned |
56 // in the callback. This is necessary for Linux, which only has an | 57 // in the callback. This is necessary for Linux, which only has an |
57 // asynchronous printing API. | 58 // asynchronous printing API. |
| 59 // TODO: doc |
58 virtual void AskUserForSettings(int max_pages, | 60 virtual void AskUserForSettings(int max_pages, |
59 bool has_selection, | 61 bool has_selection, |
| 62 bool is_scripted, |
60 const PrintSettingsCallback& callback) = 0; | 63 const PrintSettingsCallback& callback) = 0; |
61 | 64 |
62 // Selects the user's default printer and format. Updates the context with the | 65 // Selects the user's default printer and format. Updates the context with the |
63 // default device settings. | 66 // default device settings. |
64 virtual Result UseDefaultSettings() = 0; | 67 virtual Result UseDefaultSettings() = 0; |
65 | 68 |
66 // Updates the context with PDF printer settings. | 69 // Updates the context with PDF printer settings. |
67 Result UsePdfSettings(); | 70 Result UsePdfSettings(); |
68 | 71 |
69 // Returns paper size to be used for PDF or Cloud Print in device units. | 72 // Returns paper size to be used for PDF or Cloud Print in device units. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // Did the user cancel the print job. | 147 // Did the user cancel the print job. |
145 volatile bool abort_printing_; | 148 volatile bool abort_printing_; |
146 | 149 |
147 private: | 150 private: |
148 DISALLOW_COPY_AND_ASSIGN(PrintingContext); | 151 DISALLOW_COPY_AND_ASSIGN(PrintingContext); |
149 }; | 152 }; |
150 | 153 |
151 } // namespace printing | 154 } // namespace printing |
152 | 155 |
153 #endif // PRINTING_PRINTING_CONTEXT_H_ | 156 #endif // PRINTING_PRINTING_CONTEXT_H_ |
OLD | NEW |