ipp_handler_map.h 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2019 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_IPP_HANDLER_MAP_H_
  5. #define PRINTING_BACKEND_IPP_HANDLER_MAP_H_
  6. #include <map>
  7. #include "base/callback.h"
  8. #include "base/strings/string_piece.h"
  9. #include "printing/backend/print_backend.h"
  10. namespace printing {
  11. class CupsOptionProvider;
  12. // Handles IPP attribute, usually by adding 1 or more items to `caps`.
  13. using AttributeHandler =
  14. base::RepeatingCallback<void(const CupsOptionProvider& printer,
  15. const char* name,
  16. AdvancedCapabilities* caps)>;
  17. using HandlerMap = std::map<base::StringPiece, AttributeHandler>;
  18. // Produces mapping from attribute names to handlers based on their type.
  19. // Implementation is generated by //printing/backend/tools/code_generator.py
  20. // based on list provided by IANA.
  21. HandlerMap GenerateHandlers();
  22. } // namespace printing
  23. #endif // PRINTING_BACKEND_IPP_HANDLER_MAP_H_