• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
2 // reserved. Use of this source code is governed by a BSD-style license that
3 // can be found in the LICENSE file.
4 
5 #ifndef CEF_LIBCEF_BROWSER_PRINT_SETTINGS_IMPL_H_
6 #define CEF_LIBCEF_BROWSER_PRINT_SETTINGS_IMPL_H_
7 #pragma once
8 
9 #include "include/cef_print_settings.h"
10 #include "libcef/common/value_base.h"
11 
12 #include "printing/print_settings.h"
13 
14 // CefPrintSettings implementation
15 class CefPrintSettingsImpl
16     : public CefValueBase<CefPrintSettings, printing::PrintSettings> {
17  public:
18   CefPrintSettingsImpl(std::unique_ptr<printing::PrintSettings> settings,
19                        bool read_only);
20 
21   // CefPrintSettings methods.
22   bool IsValid() override;
23   bool IsReadOnly() override;
24   void SetOrientation(bool landscape) override;
25   bool IsLandscape() override;
26   void SetPrinterPrintableArea(const CefSize& physical_size_device_units,
27                                const CefRect& printable_area_device_units,
28                                bool landscape_needs_flip) override;
29   void SetDeviceName(const CefString& name) override;
30   CefString GetDeviceName() override;
31   void SetDPI(int dpi) override;
32   int GetDPI() override;
33   void SetPageRanges(const PageRangeList& ranges) override;
34   size_t GetPageRangesCount() override;
35   void GetPageRanges(PageRangeList& ranges) override;
36   void SetSelectionOnly(bool selection_only) override;
37   bool IsSelectionOnly() override;
38   void SetCollate(bool collate) override;
39   bool WillCollate() override;
40   void SetColorModel(ColorModel model) override;
41   ColorModel GetColorModel() override;
42   void SetCopies(int copies) override;
43   int GetCopies() override;
44   void SetDuplexMode(DuplexMode mode) override;
45   DuplexMode GetDuplexMode() override;
46 
47   std::unique_ptr<printing::PrintSettings> TakeOwnership() WARN_UNUSED_RESULT;
48 
49  private:
50   std::unique_ptr<printing::PrintSettings> settings_;
51 
52   DISALLOW_COPY_AND_ASSIGN(CefPrintSettingsImpl);
53 };
54 
55 #endif  // CEF_LIBCEF_BROWSER_PRINT_SETTINGS_IMPL_H_
56