blob: 695a5e3b3bdb53685fcd1b627b63faf8b00edc01 [file] [log] [blame]
[email protected]437f9d82012-02-14 03:58:061// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]eaa389e2011-04-11 04:58:202// 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_PRINT_DIALOG_GTK_INTERFACE_H_
6#define PRINTING_PRINT_DIALOG_GTK_INTERFACE_H_
7
[email protected]896d161f2013-06-11 22:52:248#include "base/strings/string16.h"
[email protected]d53002f42014-01-14 16:08:569#include "printing/printing_context_linux.h"
[email protected]e368b672012-05-24 02:30:5210#include "ui/gfx/native_widget_types.h"
[email protected]eaa389e2011-04-11 04:58:2011
12namespace printing {
13
vitalybuka5d1290582014-09-12 09:19:5914class MetafilePlayer;
[email protected]1c23b4e82011-10-15 22:30:4815class PrintSettings;
[email protected]7d7489902011-04-11 21:54:0616
[email protected]eaa389e2011-04-11 04:58:2017// An interface for GTK printing dialogs. Classes that live outside of
18// printing/ can implement this interface and get threading requirements
19// correct without exposing those requirements to printing/.
20class PrintDialogGtkInterface {
21 public:
[email protected]2ed86fdf2011-04-19 20:57:0322 // Tell the dialog to use the default print setting.
23 virtual void UseDefaultSettings() = 0;
24
[email protected]e5324b52013-10-29 03:16:3725 // Updates the dialog to use |settings|. Only used when printing without the
26 // system print dialog. E.g. for Print Preview. Returns false on error.
[email protected]4c9054b2013-11-04 18:34:2927 virtual bool UpdateSettings(PrintSettings* settings) = 0;
[email protected]2ed86fdf2011-04-19 20:57:0328
29 // Shows the dialog and handles the response with |callback|. Only used when
30 // printing with the native print dialog.
[email protected]eaa389e2011-04-11 04:58:2031 virtual void ShowDialog(
[email protected]e368b672012-05-24 02:30:5232 gfx::NativeView parent_view,
[email protected]437f9d82012-02-14 03:58:0633 bool has_selection,
Vladislav Kuzkokov48ceab22018-02-14 16:29:2834 PrintingContextLinux::PrintSettingsCallback callback) = 0;
[email protected]eaa389e2011-04-11 04:58:2035
36 // Prints the document named |document_name| contained in |metafile|.
37 // Called from the print worker thread. Once called, the
38 // PrintDialogGtkInterface instance should not be reused.
vitalybuka5d1290582014-09-12 09:19:5939 virtual void PrintDocument(const MetafilePlayer& metafile,
[email protected]b5fa4ee2013-10-01 07:19:0740 const base::string16& document_name) = 0;
[email protected]eaa389e2011-04-11 04:58:2041
42 // Same as AddRef/Release, but with different names since
43 // PrintDialogGtkInterface does not inherit from RefCounted.
44 virtual void AddRefToDialog() = 0;
45 virtual void ReleaseDialog() = 0;
46
47 protected:
48 virtual ~PrintDialogGtkInterface() {}
49};
50
51} // namespace printing
52
53#endif // PRINTING_PRINT_DIALOG_GTK_INTERFACE_H_