[email protected] | 5cc4c42 | 2011-02-19 00:09:22 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
[email protected] | 51e8d935 | 2010-10-06 22:21:17 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #ifndef PRINTING_PRINTING_CONTEXT_CAIRO_H_ | ||||
6 | #define PRINTING_PRINTING_CONTEXT_CAIRO_H_ | ||||
7 | |||||
[email protected] | ee5f36e4 | 2010-12-03 22:40:37 | [diff] [blame] | 8 | #include <string> |
9 | |||||
[email protected] | 51e8d935 | 2010-10-06 22:21:17 | [diff] [blame] | 10 | #include "printing/printing_context.h" |
11 | |||||
[email protected] | f3a1c64 | 2011-07-12 19:15:03 | [diff] [blame^] | 12 | namespace base { |
13 | class DictionaryValue; | ||||
14 | } | ||||
15 | |||||
[email protected] | 51e8d935 | 2010-10-06 22:21:17 | [diff] [blame] | 16 | namespace printing { |
17 | |||||
[email protected] | 7d748990 | 2011-04-11 21:54:06 | [diff] [blame] | 18 | class Metafile; |
[email protected] | eaa389e | 2011-04-11 04:58:20 | [diff] [blame] | 19 | class PrintDialogGtkInterface; |
20 | |||||
[email protected] | 51e8d935 | 2010-10-06 22:21:17 | [diff] [blame] | 21 | class PrintingContextCairo : public PrintingContext { |
22 | public: | ||||
[email protected] | ee5f36e4 | 2010-12-03 22:40:37 | [diff] [blame] | 23 | explicit PrintingContextCairo(const std::string& app_locale); |
[email protected] | 3690ebe0 | 2011-05-25 09:08:19 | [diff] [blame] | 24 | virtual ~PrintingContextCairo(); |
[email protected] | 51e8d935 | 2010-10-06 22:21:17 | [diff] [blame] | 25 | |
[email protected] | 5cc4c42 | 2011-02-19 00:09:22 | [diff] [blame] | 26 | #if !defined(OS_CHROMEOS) |
[email protected] | eaa389e | 2011-04-11 04:58:20 | [diff] [blame] | 27 | // Sets the function that creates the print dialog. |
28 | static void SetCreatePrintDialogFunction( | ||||
29 | PrintDialogGtkInterface* (*create_dialog_func)( | ||||
30 | PrintingContextCairo* context)); | ||||
[email protected] | 5cc4c42 | 2011-02-19 00:09:22 | [diff] [blame] | 31 | |
32 | // Prints the document contained in |metafile|. | ||||
[email protected] | 7d748990 | 2011-04-11 21:54:06 | [diff] [blame] | 33 | void PrintDocument(const Metafile* metafile); |
[email protected] | 5cc4c42 | 2011-02-19 00:09:22 | [diff] [blame] | 34 | #endif |
35 | |||||
[email protected] | 51e8d935 | 2010-10-06 22:21:17 | [diff] [blame] | 36 | // PrintingContext implementation. |
37 | virtual void AskUserForSettings(gfx::NativeView parent_view, | ||||
38 | int max_pages, | ||||
39 | bool has_selection, | ||||
40 | PrintSettingsCallback* callback); | ||||
41 | virtual Result UseDefaultSettings(); | ||||
[email protected] | f3a1c64 | 2011-07-12 19:15:03 | [diff] [blame^] | 42 | virtual Result UpdatePrintSettings(const base::DictionaryValue& job_settings, |
[email protected] | 89f5aa8c | 2011-03-21 20:58:44 | [diff] [blame] | 43 | const PageRanges& ranges); |
[email protected] | 51e8d935 | 2010-10-06 22:21:17 | [diff] [blame] | 44 | virtual Result InitWithSettings(const PrintSettings& settings); |
45 | virtual Result NewDocument(const string16& document_name); | ||||
46 | virtual Result NewPage(); | ||||
47 | virtual Result PageDone(); | ||||
48 | virtual Result DocumentDone(); | ||||
49 | virtual void Cancel(); | ||||
[email protected] | 51e8d935 | 2010-10-06 22:21:17 | [diff] [blame] | 50 | virtual void ReleaseContext(); |
51 | virtual gfx::NativeDrawingContext context() const; | ||||
52 | |||||
53 | private: | ||||
[email protected] | 5cc4c42 | 2011-02-19 00:09:22 | [diff] [blame] | 54 | #if !defined(OS_CHROMEOS) |
55 | string16 document_name_; | ||||
[email protected] | eaa389e | 2011-04-11 04:58:20 | [diff] [blame] | 56 | PrintDialogGtkInterface* print_dialog_; |
[email protected] | 5cc4c42 | 2011-02-19 00:09:22 | [diff] [blame] | 57 | #endif |
58 | |||||
[email protected] | 51e8d935 | 2010-10-06 22:21:17 | [diff] [blame] | 59 | DISALLOW_COPY_AND_ASSIGN(PrintingContextCairo); |
60 | }; | ||||
61 | |||||
62 | } // namespace printing | ||||
63 | |||||
64 | #endif // PRINTING_PRINTING_CONTEXT_CAIRO_H_ |