Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: printing/print_dialog_gtk_interface.h

Issue 7348010: Added Header and Footer support using Skia (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Changes based on Kausalya's comments Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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; 13 class Metafile;
14 14
15 // An interface for GTK printing dialogs. Classes that live outside of 15 // An interface for GTK printing dialogs. Classes that live outside of
16 // printing/ can implement this interface and get threading requirements 16 // printing/ can implement this interface and get threading requirements
17 // correct without exposing those requirements to printing/. 17 // correct without exposing those requirements to printing/.
18 class PrintDialogGtkInterface { 18 class PrintDialogGtkInterface {
19 public: 19 public:
20 // Tell the dialog to use the default print setting. 20 // Tell the dialog to use the default print setting.
21 virtual void UseDefaultSettings() = 0; 21 virtual void UseDefaultSettings() = 0;
22 22
23 // Update the dialog to use |settings| and |ranges|, where |settings| is a 23 // Update the dialog to use |settings|, |ranges| and |header_footer_info|,
24 // dictionary of settings with possible keys from 24 // where |settings| is a dictionary of settings with possible keys from
25 // printing/print_job_constants.h. Only used when printing without the system 25 // printing/print_job_constants.h. |header_footer_info| contains the header
26 // print dialog. E.g. for Print Preview. Returns false on error. 26 // and footer strings to be printed if requested by the user.
27 virtual bool UpdateSettings(const base::DictionaryValue& settings, 27 // Only used when printing without the system print dialog. E.g. for Print
28 const PageRanges& ranges) = 0; 28 // Preview. Returns false on error.
29 virtual bool UpdateSettings(
30 const base::DictionaryValue& settings,
31 const PageRanges& ranges,
32 const base::DictionaryValue& header_footer_info) = 0;
29 33
30 // Shows the dialog and handles the response with |callback|. Only used when 34 // Shows the dialog and handles the response with |callback|. Only used when
31 // printing with the native print dialog. 35 // printing with the native print dialog.
32 virtual void ShowDialog( 36 virtual void ShowDialog(
33 PrintingContextCairo::PrintSettingsCallback* callback) = 0; 37 PrintingContextCairo::PrintSettingsCallback* callback) = 0;
34 38
35 // Prints the document named |document_name| contained in |metafile|. 39 // Prints the document named |document_name| contained in |metafile|.
36 // Called from the print worker thread. Once called, the 40 // Called from the print worker thread. Once called, the
37 // PrintDialogGtkInterface instance should not be reused. 41 // PrintDialogGtkInterface instance should not be reused.
38 virtual void PrintDocument(const Metafile* metafile, 42 virtual void PrintDocument(const Metafile* metafile,
39 const string16& document_name) = 0; 43 const string16& document_name) = 0;
40 44
41 // Same as AddRef/Release, but with different names since 45 // Same as AddRef/Release, but with different names since
42 // PrintDialogGtkInterface does not inherit from RefCounted. 46 // PrintDialogGtkInterface does not inherit from RefCounted.
43 virtual void AddRefToDialog() = 0; 47 virtual void AddRefToDialog() = 0;
44 virtual void ReleaseDialog() = 0; 48 virtual void ReleaseDialog() = 0;
45 49
46 protected: 50 protected:
47 virtual ~PrintDialogGtkInterface() {} 51 virtual ~PrintDialogGtkInterface() {}
48 }; 52 };
49 53
50 } // namespace printing 54 } // namespace printing
51 55
52 #endif // PRINTING_PRINT_DIALOG_GTK_INTERFACE_H_ 56 #endif // PRINTING_PRINT_DIALOG_GTK_INTERFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698