print_mojom_traits.h 761 B

123456789101112131415161718192021222324
  1. // Copyright 2022 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef PRINTING_MOJOM_PRINT_MOJOM_TRAITS_H_
  5. #define PRINTING_MOJOM_PRINT_MOJOM_TRAITS_H_
  6. #include "printing/mojom/print.mojom.h"
  7. #include "printing/page_range.h"
  8. namespace mojo {
  9. template <>
  10. struct StructTraits<printing::mojom::PageRangeDataView, printing::PageRange> {
  11. static uint32_t from(const printing::PageRange& r) { return r.from; }
  12. static uint32_t to(const printing::PageRange& r) { return r.to; }
  13. static bool Read(printing::mojom::PageRangeDataView data,
  14. printing::PageRange* out);
  15. };
  16. } // namespace mojo
  17. #endif // PRINTING_MOJOM_PRINT_MOJOM_TRAITS_H_