#ifndef PRINTING_BACKEND_PRINT_BACKEND_H_
#define PRINTING_BACKEND_PRINT_BACKEND_H_
#include <stdint.h>
#include <map>
#include <optional>
#include <string>
#include <vector>
#include "base/component_export.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_refptr.h"
#include "build/build_config.h"
#include "printing/mojom/print.mojom.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#if BUILDFLAG(IS_WIN)
#include "base/types/expected.h"
#endif
namespace printing {
PrinterBasicInfoOptions;
struct COMPONENT_EXPORT(PRINT_BACKEND) PrinterBasicInfo { … };
PrinterList;
#if BUILDFLAG(IS_CHROMEOS)
struct COMPONENT_EXPORT(PRINT_BACKEND) AdvancedCapabilityValue {
AdvancedCapabilityValue();
AdvancedCapabilityValue(const std::string& name,
const std::string& display_name);
AdvancedCapabilityValue(const AdvancedCapabilityValue& other);
~AdvancedCapabilityValue();
bool operator==(const AdvancedCapabilityValue& other) const;
std::string name;
std::string display_name;
};
struct COMPONENT_EXPORT(PRINT_BACKEND) AdvancedCapability {
enum class Type : uint8_t { kBoolean, kFloat, kInteger, kString };
AdvancedCapability();
AdvancedCapability(const std::string& name, AdvancedCapability::Type type);
AdvancedCapability(const std::string& name,
const std::string& display_name,
AdvancedCapability::Type type,
const std::string& default_value,
const std::vector<AdvancedCapabilityValue>& values);
AdvancedCapability(const AdvancedCapability& other);
~AdvancedCapability();
bool operator==(const AdvancedCapability& other) const;
std::string name;
std::string display_name;
AdvancedCapability::Type type;
std::string default_value;
std::vector<AdvancedCapabilityValue> values;
};
using AdvancedCapabilities = std::vector<AdvancedCapability>;
#endif
#if BUILDFLAG(IS_WIN)
struct COMPONENT_EXPORT(PRINT_BACKEND) PageOutputQualityAttribute {
PageOutputQualityAttribute();
PageOutputQualityAttribute(const std::string& display_name,
const std::string& name);
~PageOutputQualityAttribute();
bool operator==(const PageOutputQualityAttribute& other) const;
bool operator<(const PageOutputQualityAttribute& other) const;
std::string display_name;
std::string name;
};
using PageOutputQualityAttributes = std::vector<PageOutputQualityAttribute>;
struct COMPONENT_EXPORT(PRINT_BACKEND) PageOutputQuality {
PageOutputQuality();
PageOutputQuality(PageOutputQualityAttributes qualities,
std::optional<std::string> default_quality);
PageOutputQuality(const PageOutputQuality& other);
~PageOutputQuality();
PageOutputQualityAttributes qualities;
std::optional<std::string> default_quality;
};
#if defined(UNIT_TEST)
COMPONENT_EXPORT(PRINT_BACKEND)
bool operator==(const PageOutputQuality& quality1,
const PageOutputQuality& quality2);
#endif
struct COMPONENT_EXPORT(PRINT_BACKEND) XpsCapabilities {
XpsCapabilities();
XpsCapabilities(const XpsCapabilities&) = delete;
XpsCapabilities& operator=(const XpsCapabilities&) = delete;
XpsCapabilities(XpsCapabilities&& other) noexcept;
XpsCapabilities& operator=(XpsCapabilities&& other) noexcept;
~XpsCapabilities();
std::optional<PageOutputQuality> page_output_quality;
};
#endif
struct COMPONENT_EXPORT(PRINT_BACKEND) PrinterSemanticCapsAndDefaults { … };
#if defined(UNIT_TEST)
COMPONENT_EXPORT(PRINT_BACKEND)
bool operator==(const PrinterSemanticCapsAndDefaults& caps1,
const PrinterSemanticCapsAndDefaults& caps2);
#endif
struct COMPONENT_EXPORT(PRINT_BACKEND) PrinterCapsAndDefaults { … };
class COMPONENT_EXPORT(PRINT_BACKEND) PrintBackend
: public base::RefCountedThreadSafe<PrintBackend> { … };
}
#endif