blob: f905e6d96917223f101774cf7670ed710d944534 [file] [log] [blame]
vitalybukaf9d0c0c2014-09-09 19:53:331// Copyright 2014 The Chromium Authors. All rights reserved.
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_PRINTING_CONTEXT_SYSTEM_DIALOG_WIN_H_
6#define PRINTING_PRINTING_CONTEXT_SYSTEM_DIALOG_WIN_H_
7
Lei Zhang01a1d3c02019-05-21 04:59:108#include <ocidl.h> // NOLINT(build/include_order)
9
10#include <commdlg.h> // Must come after ocidl.h.
vitalybukaf9d0c0c2014-09-09 19:53:3311
12#include <string>
13
14#include "printing/printing_context_win.h"
15#include "ui/gfx/native_widget_types.h"
16
17namespace printing {
18
thestige85e6b62016-08-25 00:00:0619class PRINTING_EXPORT PrintingContextSystemDialogWin
vitalybukaf9d0c0c2014-09-09 19:53:3320 : public PrintingContextWin {
21 public:
thestige85e6b62016-08-25 00:00:0622 explicit PrintingContextSystemDialogWin(Delegate* delegate);
Lei Zhangdd3e9b02020-08-19 23:04:4223 PrintingContextSystemDialogWin(const PrintingContextSystemDialogWin&) =
24 delete;
25 PrintingContextSystemDialogWin& operator=(
26 const PrintingContextSystemDialogWin&) = delete;
thestige85e6b62016-08-25 00:00:0627 ~PrintingContextSystemDialogWin() override;
vitalybukaf9d0c0c2014-09-09 19:53:3328
29 // PrintingContext implementation.
Vladislav Kuzkokov48ceab22018-02-14 16:29:2830 void AskUserForSettings(int max_pages,
31 bool has_selection,
32 bool is_scripted,
33 PrintSettingsCallback callback) override;
vitalybukaf9d0c0c2014-09-09 19:53:3334
35 private:
36 friend class MockPrintingContextWin;
37
38 virtual HRESULT ShowPrintDialog(PRINTDLGEX* options);
39
40 // Reads the settings from the selected device context. Updates settings_ and
41 // its margins.
mgiuca8ca59182015-07-08 02:10:2142 bool InitializeSettingsWithRanges(const DEVMODE& dev_mode,
43 const std::wstring& new_device_name,
44 const PRINTPAGERANGE* ranges,
45 int number_ranges,
46 bool selection_only);
vitalybukaf9d0c0c2014-09-09 19:53:3347
48 // Parses the result of a PRINTDLGEX result.
49 Result ParseDialogResultEx(const PRINTDLGEX& dialog_options);
vitalybukaf9d0c0c2014-09-09 19:53:3350};
51
52} // namespace printing
53
54#endif // PRINTING_PRINTING_CONTEXT_SYSTEM_DIALOG_WIN_H_