2014-07-10 17:41:30 +02:00
|
|
|
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
|
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef CEF_LIBCEF_BROWSER_PRINT_SETTINGS_IMPL_H_
|
|
|
|
#define CEF_LIBCEF_BROWSER_PRINT_SETTINGS_IMPL_H_
|
|
|
|
#pragma once
|
|
|
|
|
2024-04-30 17:45:07 +02:00
|
|
|
#include "cef/include/cef_print_settings.h"
|
|
|
|
#include "cef/libcef/common/value_base.h"
|
2014-07-10 17:41:30 +02:00
|
|
|
#include "printing/print_settings.h"
|
|
|
|
|
|
|
|
// CefPrintSettings implementation
|
|
|
|
class CefPrintSettingsImpl
|
|
|
|
: public CefValueBase<CefPrintSettings, printing::PrintSettings> {
|
|
|
|
public:
|
2019-10-01 15:55:16 +02:00
|
|
|
CefPrintSettingsImpl(std::unique_ptr<printing::PrintSettings> settings,
|
2014-07-10 17:41:30 +02:00
|
|
|
bool read_only);
|
|
|
|
|
2021-12-06 21:40:25 +01:00
|
|
|
CefPrintSettingsImpl(const CefPrintSettingsImpl&) = delete;
|
|
|
|
CefPrintSettingsImpl& operator=(const CefPrintSettingsImpl&) = delete;
|
|
|
|
|
2014-07-10 17:41:30 +02:00
|
|
|
// CefPrintSettings methods.
|
2014-11-12 20:25:15 +01:00
|
|
|
bool IsValid() override;
|
|
|
|
bool IsReadOnly() override;
|
|
|
|
void SetOrientation(bool landscape) override;
|
|
|
|
bool IsLandscape() override;
|
2017-05-17 11:29:28 +02:00
|
|
|
void SetPrinterPrintableArea(const CefSize& physical_size_device_units,
|
|
|
|
const CefRect& printable_area_device_units,
|
|
|
|
bool landscape_needs_flip) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void SetDeviceName(const CefString& name) override;
|
|
|
|
CefString GetDeviceName() override;
|
|
|
|
void SetDPI(int dpi) override;
|
|
|
|
int GetDPI() override;
|
|
|
|
void SetPageRanges(const PageRangeList& ranges) override;
|
|
|
|
size_t GetPageRangesCount() override;
|
|
|
|
void GetPageRanges(PageRangeList& ranges) override;
|
|
|
|
void SetSelectionOnly(bool selection_only) override;
|
|
|
|
bool IsSelectionOnly() override;
|
|
|
|
void SetCollate(bool collate) override;
|
|
|
|
bool WillCollate() override;
|
|
|
|
void SetColorModel(ColorModel model) override;
|
|
|
|
ColorModel GetColorModel() override;
|
|
|
|
void SetCopies(int copies) override;
|
|
|
|
int GetCopies() override;
|
|
|
|
void SetDuplexMode(DuplexMode mode) override;
|
|
|
|
DuplexMode GetDuplexMode() override;
|
2014-07-10 17:41:30 +02:00
|
|
|
|
2022-02-21 23:23:40 +01:00
|
|
|
[[nodiscard]] std::unique_ptr<printing::PrintSettings> TakeOwnership();
|
2014-07-10 17:41:30 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_PRINT_SETTINGS_IMPL_H_
|