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_CAIRO_H_ | 5 #ifndef PRINTING_PRINTING_CONTEXT_CAIRO_H_ |
6 #define PRINTING_PRINTING_CONTEXT_CAIRO_H_ | 6 #define PRINTING_PRINTING_CONTEXT_CAIRO_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "printing/printing_context.h" | 10 #include "printing/printing_context.h" |
11 | 11 |
| 12 namespace base { |
| 13 class DictionaryValue; |
| 14 } |
| 15 |
12 namespace printing { | 16 namespace printing { |
13 | 17 |
14 class Metafile; | 18 class Metafile; |
15 class PrintDialogGtkInterface; | 19 class PrintDialogGtkInterface; |
16 | 20 |
17 class PrintingContextCairo : public PrintingContext { | 21 class PrintingContextCairo : public PrintingContext { |
18 public: | 22 public: |
19 explicit PrintingContextCairo(const std::string& app_locale); | 23 explicit PrintingContextCairo(const std::string& app_locale); |
20 virtual ~PrintingContextCairo(); | 24 virtual ~PrintingContextCairo(); |
21 | 25 |
22 #if !defined(OS_CHROMEOS) | 26 #if !defined(OS_CHROMEOS) |
23 // Sets the function that creates the print dialog. | 27 // Sets the function that creates the print dialog. |
24 static void SetCreatePrintDialogFunction( | 28 static void SetCreatePrintDialogFunction( |
25 PrintDialogGtkInterface* (*create_dialog_func)( | 29 PrintDialogGtkInterface* (*create_dialog_func)( |
26 PrintingContextCairo* context)); | 30 PrintingContextCairo* context)); |
27 | 31 |
28 // Prints the document contained in |metafile|. | 32 // Prints the document contained in |metafile|. |
29 void PrintDocument(const Metafile* metafile); | 33 void PrintDocument(const Metafile* metafile); |
30 #endif | 34 #endif |
31 | 35 |
32 // PrintingContext implementation. | 36 // PrintingContext implementation. |
33 virtual void AskUserForSettings(gfx::NativeView parent_view, | 37 virtual void AskUserForSettings(gfx::NativeView parent_view, |
34 int max_pages, | 38 int max_pages, |
35 bool has_selection, | 39 bool has_selection, |
36 PrintSettingsCallback* callback); | 40 PrintSettingsCallback* callback); |
37 virtual Result UseDefaultSettings(); | 41 virtual Result UseDefaultSettings(); |
38 virtual Result UpdatePrintSettings(const DictionaryValue& job_settings, | 42 virtual Result UpdatePrintSettings(const base::DictionaryValue& job_settings, |
39 const PageRanges& ranges); | 43 const PageRanges& ranges); |
40 virtual Result InitWithSettings(const PrintSettings& settings); | 44 virtual Result InitWithSettings(const PrintSettings& settings); |
41 virtual Result NewDocument(const string16& document_name); | 45 virtual Result NewDocument(const string16& document_name); |
42 virtual Result NewPage(); | 46 virtual Result NewPage(); |
43 virtual Result PageDone(); | 47 virtual Result PageDone(); |
44 virtual Result DocumentDone(); | 48 virtual Result DocumentDone(); |
45 virtual void Cancel(); | 49 virtual void Cancel(); |
46 virtual void ReleaseContext(); | 50 virtual void ReleaseContext(); |
47 virtual gfx::NativeDrawingContext context() const; | 51 virtual gfx::NativeDrawingContext context() const; |
48 | 52 |
49 private: | 53 private: |
50 #if !defined(OS_CHROMEOS) | 54 #if !defined(OS_CHROMEOS) |
51 string16 document_name_; | 55 string16 document_name_; |
52 PrintDialogGtkInterface* print_dialog_; | 56 PrintDialogGtkInterface* print_dialog_; |
53 #endif | 57 #endif |
54 | 58 |
55 DISALLOW_COPY_AND_ASSIGN(PrintingContextCairo); | 59 DISALLOW_COPY_AND_ASSIGN(PrintingContextCairo); |
56 }; | 60 }; |
57 | 61 |
58 } // namespace printing | 62 } // namespace printing |
59 | 63 |
60 #endif // PRINTING_PRINTING_CONTEXT_CAIRO_H_ | 64 #endif // PRINTING_PRINTING_CONTEXT_CAIRO_H_ |
OLD | NEW |