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_PRINT_DIALOG_GTK_INTERFACE_H_ | 5 #ifndef PRINTING_PRINT_DIALOG_GTK_INTERFACE_H_ |
6 #define PRINTING_PRINT_DIALOG_GTK_INTERFACE_H_ | 6 #define PRINTING_PRINT_DIALOG_GTK_INTERFACE_H_ |
7 | 7 |
8 #include "base/string16.h" | 8 #include "base/string16.h" |
9 #include "printing/printing_context_cairo.h" | 9 #include "printing/printing_context_cairo.h" |
10 | 10 |
11 namespace printing { | 11 namespace printing { |
12 | 12 |
| 13 class Metafile; |
| 14 |
13 // An interface for GTK printing dialogs. Classes that live outside of | 15 // An interface for GTK printing dialogs. Classes that live outside of |
14 // printing/ can implement this interface and get threading requirements | 16 // printing/ can implement this interface and get threading requirements |
15 // correct without exposing those requirements to printing/. | 17 // correct without exposing those requirements to printing/. |
16 class PrintDialogGtkInterface { | 18 class PrintDialogGtkInterface { |
17 public: | 19 public: |
18 // Shows the dialog and handles the response with |callback|. | 20 // Shows the dialog and handles the response with |callback|. |
19 virtual void ShowDialog( | 21 virtual void ShowDialog( |
20 PrintingContextCairo::PrintSettingsCallback* callback) = 0; | 22 PrintingContextCairo::PrintSettingsCallback* callback) = 0; |
21 | 23 |
22 // Prints the document named |document_name| contained in |metafile|. | 24 // Prints the document named |document_name| contained in |metafile|. |
23 // Called from the print worker thread. Once called, the | 25 // Called from the print worker thread. Once called, the |
24 // PrintDialogGtkInterface instance should not be reused. | 26 // PrintDialogGtkInterface instance should not be reused. |
25 virtual void PrintDocument(const NativeMetafile* metafile, | 27 virtual void PrintDocument(const Metafile* metafile, |
26 const string16& document_name) = 0; | 28 const string16& document_name) = 0; |
27 | 29 |
28 // Same as AddRef/Release, but with different names since | 30 // Same as AddRef/Release, but with different names since |
29 // PrintDialogGtkInterface does not inherit from RefCounted. | 31 // PrintDialogGtkInterface does not inherit from RefCounted. |
30 virtual void AddRefToDialog() = 0; | 32 virtual void AddRefToDialog() = 0; |
31 virtual void ReleaseDialog() = 0; | 33 virtual void ReleaseDialog() = 0; |
32 | 34 |
33 protected: | 35 protected: |
34 virtual ~PrintDialogGtkInterface() {} | 36 virtual ~PrintDialogGtkInterface() {} |
35 }; | 37 }; |
36 | 38 |
37 } // namespace printing | 39 } // namespace printing |
38 | 40 |
39 #endif // PRINTING_PRINT_DIALOG_GTK_INTERFACE_H_ | 41 #endif // PRINTING_PRINT_DIALOG_GTK_INTERFACE_H_ |
OLD | NEW |