blob: 439c04b7072cbdb677b733080dd96594de9622d8 [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
Vladislav Kuzkokov19998222019-08-12 14:26:098#include <memory>
9
[email protected]896d161f2013-06-11 22:52:2410#include "base/strings/string16.h"
[email protected]d53002f42014-01-14 16:08:5611#include "printing/printing_context_linux.h"
[email protected]e368b672012-05-24 02:30:5212#include "ui/gfx/native_widget_types.h"
[email protected]eaa389e2011-04-11 04:58:2013
14namespace printing {
15
vitalybuka5d1290582014-09-12 09:19:5916class MetafilePlayer;
[email protected]1c23b4e82011-10-15 22:30:4817class PrintSettings;
[email protected]7d7489902011-04-11 21:54:0618
[email protected]eaa389e2011-04-11 04:58:2019// An interface for GTK printing dialogs. Classes that live outside of
20// printing/ can implement this interface and get threading requirements
21// correct without exposing those requirements to printing/.
22class PrintDialogGtkInterface {
23 public:
[email protected]2ed86fdf2011-04-19 20:57:0324 // Tell the dialog to use the default print setting.
25 virtual void UseDefaultSettings() = 0;
26
[email protected]e5324b52013-10-29 03:16:3727 // Updates the dialog to use |settings|. Only used when printing without the
Lei Zhang5cea78b2018-05-04 17:37:1628 // system print dialog. E.g. for Print Preview.
Vladislav Kuzkokov19998222019-08-12 14:26:0929 virtual void UpdateSettings(std::unique_ptr<PrintSettings> settings) = 0;
[email protected]2ed86fdf2011-04-19 20:57:0330
31 // Shows the dialog and handles the response with |callback|. Only used when
32 // printing with the native print dialog.
[email protected]eaa389e2011-04-11 04:58:2033 virtual void ShowDialog(
[email protected]e368b672012-05-24 02:30:5234 gfx::NativeView parent_view,
[email protected]437f9d82012-02-14 03:58:0635 bool has_selection,
Vladislav Kuzkokov48ceab22018-02-14 16:29:2836 PrintingContextLinux::PrintSettingsCallback callback) = 0;
[email protected]eaa389e2011-04-11 04:58:2037
38 // Prints the document named |document_name| contained in |metafile|.
39 // Called from the print worker thread. Once called, the
40 // PrintDialogGtkInterface instance should not be reused.
vitalybuka5d1290582014-09-12 09:19:5941 virtual void PrintDocument(const MetafilePlayer& metafile,
[email protected]b5fa4ee2013-10-01 07:19:0742 const base::string16& document_name) = 0;
[email protected]eaa389e2011-04-11 04:58:2043
44 // Same as AddRef/Release, but with different names since
45 // PrintDialogGtkInterface does not inherit from RefCounted.
46 virtual void AddRefToDialog() = 0;
47 virtual void ReleaseDialog() = 0;
48
49 protected:
50 virtual ~PrintDialogGtkInterface() {}
51};
52
53} // namespace printing
54
55#endif // PRINTING_PRINT_DIALOG_GTK_INTERFACE_H_