Enable chrome with aura for tizen
[platform/framework/web/chromium-efl.git] / printing / print_dialog_linux_interface.h
1 // Copyright 2012 The Chromium Authors
2 // 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_LINUX_INTERFACE_H_
6 #define PRINTING_PRINT_DIALOG_LINUX_INTERFACE_H_
7
8 #include <memory>
9 #include <string>
10
11 #include "printing/printing_context_linux.h"
12 #include "ui/gfx/native_widget_types.h"
13
14 namespace printing {
15
16 class MetafilePlayer;
17 class PrintSettings;
18
19 // An interface for Linux 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/.
22 class PrintDialogLinuxInterface {
23  public:
24   // Tell the dialog to use the default print setting.
25   virtual void UseDefaultSettings() = 0;
26
27   // Updates the dialog to use `settings`. Only used when printing without the
28   // system print dialog. E.g. for Print Preview.
29   virtual void UpdateSettings(std::unique_ptr<PrintSettings> settings) = 0;
30
31   // Shows the dialog and handles the response with `callback`. Only used when
32   // printing with the native print dialog.
33   virtual void ShowDialog(
34       gfx::NativeView parent_view,
35       bool has_selection,
36       PrintingContextLinux::PrintSettingsCallback callback) = 0;
37
38   // Prints the document named `document_name` contained in `metafile`.
39   // Called from the print worker thread. Once called, the
40   // PrintDialogLinuxInterface instance should not be reused.
41   virtual void PrintDocument(const MetafilePlayer& metafile,
42                              const std::u16string& document_name) = 0;
43
44   // Releases the caller's ownership of the PrintDialogLinuxInterface. When
45   // called, the caller must not access the PrintDialogLinuxInterface
46   // afterwards, and vice versa.
47   virtual void ReleaseDialog() = 0;
48
49  protected:
50   virtual ~PrintDialogLinuxInterface() = default;
51 };
52
53 }  // namespace printing
54
55 #endif  // PRINTING_PRINT_DIALOG_LINUX_INTERFACE_H_