chromium/printing/backend/print_backend_utils.cc

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

#include "printing/backend/print_backend_utils.h"

#include <string_view>
#include <vector>

#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "printing/buildflags/buildflags.h"
#include "printing/units.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/geometry/size_conversions.h"
#include "ui/gfx/geometry/size_f.h"

#if BUILDFLAG(USE_CUPS)
#include "printing/backend/cups_printer.h"
#endif  // BUILDFLAG(USE_CUPS)

namespace printing {

namespace {

constexpr float kMmPerInch =;
constexpr float kMicronsPerInch =;

// Defines two prefixes of a special breed of media sizes not meant for
// users' eyes. CUPS incidentally returns these IPP values to us, but
// we have no use for them.
constexpr std::string_view kMediaCustomMinPrefix =;
constexpr std::string_view kMediaCustomMaxPrefix =;

bool IsValidMediaName(std::string_view& value,
                      std::vector<std::string_view>& pieces) {}

std::vector<std::string_view> GetStringPiecesIfValid(std::string_view value) {}

gfx::Size DimensionsToMicrons(std::string_view value) {}

}  // namespace

gfx::Size ParsePaperSize(std::string_view value) {}

#if BUILDFLAG(USE_CUPS)
gfx::Rect PrintableAreaFromSizeAndPwgMargins(const gfx::Size& size_um,
                                             int bottom_pwg,
                                             int left_pwg,
                                             int right_pwg,
                                             int top_pwg) {}

void PwgMarginsFromSizeAndPrintableArea(const gfx::Size& size_um,
                                        const gfx::Rect& printable_area_um,
                                        int* bottom_pwg,
                                        int* left_pwg,
                                        int* right_pwg,
                                        int* top_pwg) {}
#endif  // BUILDFLAG(USE_CUPS)

COMPONENT_EXPORT(PRINT_BACKEND)
std::string GetDisplayName(const std::string& printer_name,
                           std::string_view info) {}

COMPONENT_EXPORT(PRINT_BACKEND)
std::string_view GetPrinterDescription(std::string_view drv_info,
                                       std::string_view info) {}

}  // namespace printing