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 CefPrintSettingsImpl(const CefPrintSettingsImpl&) = delete; 22 CefPrintSettingsImpl& operator=(const CefPrintSettingsImpl&) = delete; 23 24 // CefPrintSettings methods. 25 bool IsValid() override; 26 bool IsReadOnly() override; 27 void SetOrientation(bool landscape) override; 28 bool IsLandscape() override; 29 void SetPrinterPrintableArea(const CefSize& physical_size_device_units, 30 const CefRect& printable_area_device_units, 31 bool landscape_needs_flip) override; 32 void SetDeviceName(const CefString& name) override; 33 CefString GetDeviceName() override; 34 void SetDPI(int dpi) override; 35 int GetDPI() override; 36 void SetPageRanges(const PageRangeList& ranges) override; 37 size_t GetPageRangesCount() override; 38 void GetPageRanges(PageRangeList& ranges) override; 39 void SetSelectionOnly(bool selection_only) override; 40 bool IsSelectionOnly() override; 41 void SetCollate(bool collate) override; 42 bool WillCollate() override; 43 void SetColorModel(ColorModel model) override; 44 ColorModel GetColorModel() override; 45 void SetCopies(int copies) override; 46 int GetCopies() override; 47 void SetDuplexMode(DuplexMode mode) override; 48 DuplexMode GetDuplexMode() override; 49 50 std::unique_ptr<printing::PrintSettings> TakeOwnership() WARN_UNUSED_RESULT; 51 }; 52 53 #endif // CEF_LIBCEF_BROWSER_PRINT_SETTINGS_IMPL_H_ 54