printing_restrictions.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Copyright 2018 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_BACKEND_PRINTING_RESTRICTIONS_H_
  5. #define PRINTING_BACKEND_PRINTING_RESTRICTIONS_H_
  6. #include "base/component_export.h"
  7. #include "build/build_config.h"
  8. #if BUILDFLAG(IS_CHROMEOS)
  9. #include "printing/mojom/print.mojom.h"
  10. #endif
  11. namespace printing {
  12. #if BUILDFLAG(IS_CHROMEOS)
  13. // Allowed printing modes as a bitmask.
  14. // This is used in pref file and crosapi. It should never change.
  15. using ColorModeRestriction = mojom::ColorModeRestriction;
  16. // Allowed duplex modes as a bitmask.
  17. // This is used in pref file and crosapi. It should never change.
  18. using DuplexModeRestriction = mojom::DuplexModeRestriction;
  19. // Allowed PIN printing modes.
  20. // This is used in pref file and should never change.
  21. using PinModeRestriction = mojom::PinModeRestriction;
  22. // Dictionary key for printing policies.
  23. // Must coincide with the name of field in `print_preview.Policies` in
  24. // chrome/browser/resources/print_preview/data/destination.ts
  25. COMPONENT_EXPORT(PRINT_BACKEND) extern const char kAllowedColorModes[];
  26. COMPONENT_EXPORT(PRINT_BACKEND) extern const char kAllowedDuplexModes[];
  27. COMPONENT_EXPORT(PRINT_BACKEND) extern const char kAllowedPinModes[];
  28. COMPONENT_EXPORT(PRINT_BACKEND) extern const char kDefaultColorMode[];
  29. COMPONENT_EXPORT(PRINT_BACKEND) extern const char kDefaultDuplexMode[];
  30. COMPONENT_EXPORT(PRINT_BACKEND) extern const char kDefaultPinMode[];
  31. #endif // BUILDFLAG(IS_CHROMEOS)
  32. // Allowed background graphics modes.
  33. // This is used in pref file and should never change.
  34. enum class BackgroundGraphicsModeRestriction {
  35. kUnset = 0,
  36. kEnabled = 1,
  37. kDisabled = 2,
  38. };
  39. // Dictionary keys to be used with `kPrintingPaperSizeDefault` policy.
  40. COMPONENT_EXPORT(PRINT_BACKEND) extern const char kPaperSizeName[];
  41. COMPONENT_EXPORT(PRINT_BACKEND) extern const char kPaperSizeNameCustomOption[];
  42. COMPONENT_EXPORT(PRINT_BACKEND) extern const char kPaperSizeCustomSize[];
  43. COMPONENT_EXPORT(PRINT_BACKEND) extern const char kPaperSizeWidth[];
  44. COMPONENT_EXPORT(PRINT_BACKEND) extern const char kPaperSizeHeight[];
  45. } // namespace printing
  46. #endif // PRINTING_BACKEND_PRINTING_RESTRICTIONS_H_