1 // Copyright 2014 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.
5 #ifndef PRINTING_PRINTING_CONTEXT_SYSTEM_DIALOG_WIN_H_
6 #define PRINTING_PRINTING_CONTEXT_SYSTEM_DIALOG_WIN_H_
8 #include <ocidl.h> // NOLINT(build/include_order)
10 #include <commdlg.h> // Must come after ocidl.h.
14 #include "printing/mojom/print.mojom.h"
15 #include "printing/printing_context_win.h"
16 #include "ui/gfx/native_widget_types.h"
20 class COMPONENT_EXPORT(PRINTING) PrintingContextSystemDialogWin
21 : public PrintingContextWin {
23 explicit PrintingContextSystemDialogWin(Delegate* delegate);
24 PrintingContextSystemDialogWin(const PrintingContextSystemDialogWin&) =
26 PrintingContextSystemDialogWin& operator=(
27 const PrintingContextSystemDialogWin&) = delete;
28 ~PrintingContextSystemDialogWin() override;
30 // PrintingContext implementation.
31 void AskUserForSettings(int max_pages,
34 PrintSettingsCallback callback) override;
37 friend class MockPrintingContextWin;
41 virtual HRESULT ShowPrintDialog(PRINTDLGEX* options);
43 // Reads the settings from the selected device context. Updates settings_ and
45 bool InitializeSettingsWithRanges(const DEVMODE& dev_mode,
46 const std::wstring& new_device_name,
47 const PRINTPAGERANGE* ranges,
51 // Parses the result of a PRINTDLGEX result.
52 mojom::ResultCode ParseDialogResultEx(const PRINTDLGEX& dialog_options);
55 } // namespace printing
57 #endif // PRINTING_PRINTING_CONTEXT_SYSTEM_DIALOG_WIN_H_