| 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" |
| 11 #include "base/callback_old.h" | 11 #include "base/callback_old.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "printing/print_settings.h" | 13 #include "printing/print_settings.h" |
| 14 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
| 15 | 15 |
| 16 namespace base { |
| 16 class DictionaryValue; | 17 class DictionaryValue; |
| 18 } |
| 17 | 19 |
| 18 namespace printing { | 20 namespace printing { |
| 19 | 21 |
| 20 // An abstraction of a printer context, implemented by objects that describe the | 22 // An abstraction of a printer context, implemented by objects that describe the |
| 21 // user selected printing context. This includes the OS-dependent UI to ask the | 23 // user selected printing context. This includes the OS-dependent UI to ask the |
| 22 // user about the print settings. Concrete implementations directly talk to the | 24 // user about the print settings. Concrete implementations directly talk to the |
| 23 // printer and manage the document and page breaks. | 25 // printer and manage the document and page breaks. |
| 24 class PrintingContext { | 26 class PrintingContext { |
| 25 public: | 27 public: |
| 26 // Tri-state result for user behavior-dependent functions. | 28 // Tri-state result for user behavior-dependent functions. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 44 int max_pages, | 46 int max_pages, |
| 45 bool has_selection, | 47 bool has_selection, |
| 46 PrintSettingsCallback* callback) = 0; | 48 PrintSettingsCallback* callback) = 0; |
| 47 | 49 |
| 48 // Selects the user's default printer and format. Updates the context with the | 50 // Selects the user's default printer and format. Updates the context with the |
| 49 // default device settings. | 51 // default device settings. |
| 50 virtual Result UseDefaultSettings() = 0; | 52 virtual Result UseDefaultSettings() = 0; |
| 51 | 53 |
| 52 // Updates print settings. |job_settings| contains all print job settings | 54 // Updates print settings. |job_settings| contains all print job settings |
| 53 // information. |ranges| has the new page range settings. | 55 // information. |ranges| has the new page range settings. |
| 54 virtual Result UpdatePrintSettings(const DictionaryValue& job_settings, | 56 virtual Result UpdatePrintSettings(const base::DictionaryValue& job_settings, |
| 55 const PageRanges& ranges) = 0; | 57 const PageRanges& ranges) = 0; |
| 56 | 58 |
| 57 // Initializes with predefined settings. | 59 // Initializes with predefined settings. |
| 58 virtual Result InitWithSettings(const PrintSettings& settings) = 0; | 60 virtual Result InitWithSettings(const PrintSettings& settings) = 0; |
| 59 | 61 |
| 60 // Does platform specific setup of the printer before the printing. Signal the | 62 // Does platform specific setup of the printer before the printing. Signal the |
| 61 // printer that a document is about to be spooled. | 63 // printer that a document is about to be spooled. |
| 62 // Warning: This function enters a message loop. That may cause side effects | 64 // Warning: This function enters a message loop. That may cause side effects |
| 63 // like IPC message processing! Some printers have side-effects on this call | 65 // like IPC message processing! Some printers have side-effects on this call |
| 64 // like virtual printers that ask the user for the path of the saved document; | 66 // like virtual printers that ask the user for the path of the saved document; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 123 |
| 122 // The application locale. | 124 // The application locale. |
| 123 std::string app_locale_; | 125 std::string app_locale_; |
| 124 | 126 |
| 125 DISALLOW_COPY_AND_ASSIGN(PrintingContext); | 127 DISALLOW_COPY_AND_ASSIGN(PrintingContext); |
| 126 }; | 128 }; |
| 127 | 129 |
| 128 } // namespace printing | 130 } // namespace printing |
| 129 | 131 |
| 130 #endif // PRINTING_PRINTING_CONTEXT_H_ | 132 #endif // PRINTING_PRINTING_CONTEXT_H_ |
| OLD | NEW |