[M120 Migration][VD] Remove accessing oom_score_adj in zygote process
[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 #if BUILDFLAG(ENABLE_OOP_PRINTING_NO_OOP_BASIC_PRINT_DIALOG)
32   // Updates the dialog to use system print dialog settings saved in `settings`.
33   virtual void LoadPrintSettings(const PrintSettings& settings) = 0;
34 #endif
35
36   // Shows the dialog and handles the response with `callback`. Only used when
37   // printing with the native print dialog.
38   virtual void ShowDialog(
39       gfx::NativeView parent_view,
40       bool has_selection,
41       PrintingContextLinux::PrintSettingsCallback callback) = 0;
42
43   // Prints the document named `document_name` contained in `metafile`.
44   // Called from the print worker thread. Once called, the
45   // PrintDialogLinuxInterface instance should not be reused.
46   virtual void PrintDocument(const MetafilePlayer& metafile,
47                              const std::u16string& document_name) = 0;
48
49   // Releases the caller's ownership of the PrintDialogLinuxInterface. When
50   // called, the caller must not access the PrintDialogLinuxInterface
51   // afterwards, and vice versa.
52   virtual void ReleaseDialog() = 0;
53
54  protected:
55   virtual ~PrintDialogLinuxInterface() = default;
56 };
57
58 }  // namespace printing
59
60 #endif  // PRINTING_PRINT_DIALOG_LINUX_INTERFACE_H_