OLD | NEW |
---|---|
1 // Copyright (c) 2010 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.h" | 11 #include "base/callback.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 class DictionaryValue; | |
17 | |
16 namespace printing { | 18 namespace printing { |
17 | 19 |
18 // An abstraction of a printer context, implemented by objects that describe the | 20 // An abstraction of a printer context, implemented by objects that describe the |
19 // user selected printing context. This includes the OS-dependent UI to ask the | 21 // user selected printing context. This includes the OS-dependent UI to ask the |
20 // user about the print settings. Concrete implementations directly talk to the | 22 // user about the print settings. Concrete implementations directly talk to the |
21 // printer and manage the document and page breaks. | 23 // printer and manage the document and page breaks. |
22 class PrintingContext { | 24 class PrintingContext { |
23 public: | 25 public: |
24 // Tri-state result for user behavior-dependent functions. | 26 // Tri-state result for user behavior-dependent functions. |
25 enum Result { | 27 enum Result { |
(...skipping 17 matching lines...) Expand all Loading... | |
43 bool has_selection, | 45 bool has_selection, |
44 PrintSettingsCallback* callback) = 0; | 46 PrintSettingsCallback* callback) = 0; |
45 | 47 |
46 // Selects the user's default printer and format. Updates the context with the | 48 // Selects the user's default printer and format. Updates the context with the |
47 // default device settings. | 49 // default device settings. |
48 virtual Result UseDefaultSettings() = 0; | 50 virtual Result UseDefaultSettings() = 0; |
49 | 51 |
50 // Initializes with predefined settings. | 52 // Initializes with predefined settings. |
51 virtual Result InitWithSettings(const PrintSettings& settings) = 0; | 53 virtual Result InitWithSettings(const PrintSettings& settings) = 0; |
52 | 54 |
55 // Update print settings. | |
56 virtual Result UpdatePrintSettings(const DictionaryValue* job_settings, | |
Lei Zhang
2011/02/18 05:21:42
Why do you have |job_settings| that's unused in al
kmadhusu
2011/02/21 01:30:26
Removed that argument.
| |
57 const PageRanges& ranges) = 0; | |
58 | |
53 // Does platform specific setup of the printer before the printing. Signal the | 59 // Does platform specific setup of the printer before the printing. Signal the |
54 // printer that a document is about to be spooled. | 60 // printer that a document is about to be spooled. |
55 // Warning: This function enters a message loop. That may cause side effects | 61 // Warning: This function enters a message loop. That may cause side effects |
56 // like IPC message processing! Some printers have side-effects on this call | 62 // like IPC message processing! Some printers have side-effects on this call |
57 // like virtual printers that ask the user for the path of the saved document; | 63 // like virtual printers that ask the user for the path of the saved document; |
58 // for example a PDF printer. | 64 // for example a PDF printer. |
59 virtual Result NewDocument(const string16& document_name) = 0; | 65 virtual Result NewDocument(const string16& document_name) = 0; |
60 | 66 |
61 // Starts a new page. | 67 // Starts a new page. |
62 virtual Result NewPage() = 0; | 68 virtual Result NewPage() = 0; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 | 120 |
115 // The application locale. | 121 // The application locale. |
116 std::string app_locale_; | 122 std::string app_locale_; |
117 | 123 |
118 DISALLOW_COPY_AND_ASSIGN(PrintingContext); | 124 DISALLOW_COPY_AND_ASSIGN(PrintingContext); |
119 }; | 125 }; |
120 | 126 |
121 } // namespace printing | 127 } // namespace printing |
122 | 128 |
123 #endif // PRINTING_PRINTING_CONTEXT_H_ | 129 #endif // PRINTING_PRINTING_CONTEXT_H_ |
OLD | NEW |