ImageResponse.h 644 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #pragma once
  8. #include <memory>
  9. namespace facebook {
  10. namespace react {
  11. /*
  12. * Represents retrieved image bitmap and any associated platform-specific info.
  13. */
  14. class ImageResponse final {
  15. public:
  16. enum class Status {
  17. Loading,
  18. Completed,
  19. Failed,
  20. };
  21. ImageResponse(const std::shared_ptr<void> &image);
  22. std::shared_ptr<void> getImage() const;
  23. private:
  24. std::shared_ptr<void> image_{};
  25. };
  26. } // namespace react
  27. } // namespace facebook