chromium/printing/backend/print_backend_test_constants.h

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef PRINTING_BACKEND_PRINT_BACKEND_TEST_CONSTANTS_H_
#define PRINTING_BACKEND_PRINT_BACKEND_TEST_CONSTANTS_H_

#include <stdint.h>

#include <optional>
#include <vector>

#include "build/build_config.h"
#include "printing/backend/mojom/print_backend.mojom-forward.h"
#include "printing/backend/print_backend.h"
#include "ui/gfx/geometry/size.h"

namespace printing {

// Sample capabilities used to set optional fields in
// GenerateSamplePrinterSemanticCapsAndDefaults().
struct OptionalSampleCapabilities {};

inline const PrinterSemanticCapsAndDefaults::Paper kPaperA3{};
inline const PrinterSemanticCapsAndDefaults::Paper kPaperA4{};
inline const PrinterSemanticCapsAndDefaults::Paper kPaperLetter{};
inline const PrinterSemanticCapsAndDefaults::Paper kPaperLedger{};
inline const PrinterSemanticCapsAndDefaults::Paper kPaperCustom{};

inline const PrinterSemanticCapsAndDefaults::MediaType kMediaTypePlain{};
inline const PrinterSemanticCapsAndDefaults::MediaType kMediaTypePhoto{};

#if BUILDFLAG(IS_CHROMEOS)
inline const AdvancedCapability kAdvancedCapability1(
    /*name=*/"advanced_cap_bool",
    /*display_name=*/"Advanced Capability #1 (bool)",
    /*type=*/AdvancedCapability::Type::kBoolean,
    /*default_value=*/"true",
    /*values=*/{});
inline const AdvancedCapability kAdvancedCapability2(
    /*name=*/"advanced_cap_double",
    /*display_name=*/"Advanced Capability #2 (double)",
    /*type=*/AdvancedCapability::Type::kFloat,
    /*default_value=*/"3.14159",
    /*values=*/
    {
        AdvancedCapabilityValue(
            /*name=*/"adv_cap_val_1",
            /*display_name=*/"Advanced Capability #1"),
        AdvancedCapabilityValue(
            /*name=*/"adv_cap_val_2",
            /*display_name=*/"Advanced Capability #2"),
        AdvancedCapabilityValue(
            /*name=*/"adv_cap_val_3",
            /*display_name=*/"Advanced Capability #3"),
    });
inline const AdvancedCapabilities kAdvancedCapabilities{kAdvancedCapability1,
                                                        kAdvancedCapability2};
#endif  // BUILDFLAG(IS_CHROMEOS)

#if BUILDFLAG(IS_WIN)
inline const PageOutputQualityAttribute kPageOutputQualityAttribute1(
    /*display_name=*/"Normal",
    /*name=*/"ns000:Normal");
inline const PageOutputQualityAttribute kPageOutputQualityAttribute2(
    /*display_name=*/"Draft",
    /*name=*/"ns000:Draft");
inline const PageOutputQualityAttribute kPageOutputQualityAttribute3(
    /*display_name=*/"Advance",
    /*name=*/"ns000:Advance");
inline const PageOutputQualityAttributes kPageOutputQualityAttributes{
    kPageOutputQualityAttribute1, kPageOutputQualityAttribute2,
    kPageOutputQualityAttribute3};
inline const PageOutputQuality kPageOutputQuality(
    kPageOutputQualityAttributes,
    /*default_quality=*/std::nullopt);
inline constexpr char kDefaultQuality[] = "ns000:Draft";
#endif  // BUILDFLAG(IS_WIN)

inline constexpr bool kCollateCapable =;
inline constexpr bool kCollateDefault =;
inline constexpr int32_t kCopiesMax =;
inline const std::vector<mojom::DuplexMode> kDuplexModes{};
inline constexpr mojom::DuplexMode kDuplexDefault =;
inline constexpr bool kColorChangeable =;
inline constexpr bool kColorDefault =;
inline constexpr mojom::ColorModel kColorModel =;
inline constexpr mojom::ColorModel kBwModel =;
inline const PrinterSemanticCapsAndDefaults::Papers kPapers{};
inline const PrinterSemanticCapsAndDefaults::Papers kUserDefinedPapers{};
inline const PrinterSemanticCapsAndDefaults::Paper kDefaultPaper =;
inline constexpr gfx::Size kDpi600(600, 600);
inline constexpr gfx::Size kDpi1200(1200, 1200);
inline constexpr gfx::Size kDpi1200x600(1200, 600);
inline const std::vector<gfx::Size> kDpis{};
inline constexpr gfx::Size kDefaultDpi =;
inline const PrinterSemanticCapsAndDefaults::MediaTypes kMediaTypes{};
inline const PrinterSemanticCapsAndDefaults::MediaType kDefaultMediaType =;
#if BUILDFLAG(IS_CHROMEOS)
inline constexpr bool kPinSupported = true;
#endif

#if BUILDFLAG(IS_CHROMEOS)
OptionalSampleCapabilities SampleWithPinAndAdvancedCapabilities();
#endif  // BUILDFLAG(IS_CHROMEOS)

#if BUILDFLAG(IS_WIN)
OptionalSampleCapabilities SampleWithPageOutputQuality();
#endif  // BUILDFLAG(IS_WIN)

PrinterSemanticCapsAndDefaults GenerateSamplePrinterSemanticCapsAndDefaults(
    OptionalSampleCapabilities sample_capabilities);

}  // namespace printing

#endif  // PRINTING_BACKEND_PRINT_BACKEND_TEST_CONSTANTS_H_