blob: 49d72b5a1c6e4cc70c7c8a47f64bc3fc74cce97e [file] [log] [blame]
[email protected]5cc4c422011-02-19 00:09:221// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]51e8d9352010-10-06 22:21:172// 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]ee5f36e42010-12-03 22:40:378#include <string>
9
[email protected]51e8d9352010-10-06 22:21:1710#include "printing/printing_context.h"
11
[email protected]f3a1c642011-07-12 19:15:0312namespace base {
13class DictionaryValue;
14}
15
[email protected]51e8d9352010-10-06 22:21:1716namespace printing {
17
[email protected]7d7489902011-04-11 21:54:0618class Metafile;
[email protected]eaa389e2011-04-11 04:58:2019class PrintDialogGtkInterface;
20
[email protected]51e8d9352010-10-06 22:21:1721class PrintingContextCairo : public PrintingContext {
22 public:
[email protected]ee5f36e42010-12-03 22:40:3723 explicit PrintingContextCairo(const std::string& app_locale);
[email protected]3690ebe02011-05-25 09:08:1924 virtual ~PrintingContextCairo();
[email protected]51e8d9352010-10-06 22:21:1725
[email protected]5cc4c422011-02-19 00:09:2226#if !defined(OS_CHROMEOS)
[email protected]eaa389e2011-04-11 04:58:2027 // Sets the function that creates the print dialog.
28 static void SetCreatePrintDialogFunction(
29 PrintDialogGtkInterface* (*create_dialog_func)(
30 PrintingContextCairo* context));
[email protected]5cc4c422011-02-19 00:09:2231
32 // Prints the document contained in |metafile|.
[email protected]7d7489902011-04-11 21:54:0633 void PrintDocument(const Metafile* metafile);
[email protected]5cc4c422011-02-19 00:09:2234#endif
35
[email protected]51e8d9352010-10-06 22:21:1736 // 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]f3a1c642011-07-12 19:15:0342 virtual Result UpdatePrintSettings(const base::DictionaryValue& job_settings,
[email protected]89f5aa8c2011-03-21 20:58:4443 const PageRanges& ranges);
[email protected]51e8d9352010-10-06 22:21:1744 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]51e8d9352010-10-06 22:21:1750 virtual void ReleaseContext();
51 virtual gfx::NativeDrawingContext context() const;
52
53 private:
[email protected]5cc4c422011-02-19 00:09:2254#if !defined(OS_CHROMEOS)
55 string16 document_name_;
[email protected]eaa389e2011-04-11 04:58:2056 PrintDialogGtkInterface* print_dialog_;
[email protected]5cc4c422011-02-19 00:09:2257#endif
58
[email protected]51e8d9352010-10-06 22:21:1759 DISALLOW_COPY_AND_ASSIGN(PrintingContextCairo);
60};
61
62} // namespace printing
63
64#endif // PRINTING_PRINTING_CONTEXT_CAIRO_H_