ImageInstrumentation.h 956 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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 <react/core/ReactPrimitives.h>
  9. namespace facebook {
  10. namespace react {
  11. /*
  12. * A base class for performing image loading instrumentation.
  13. * The actual instrumentation is app, platform, and image loader-specific.
  14. */
  15. class ImageInstrumentation {
  16. public:
  17. virtual ~ImageInstrumentation() noexcept = default;
  18. /**
  19. * Mark that the image content is set on the native image component on screen.
  20. */
  21. virtual void didSetImage() const = 0;
  22. /**
  23. * Mark that the image view starts to be visible on screen.
  24. */
  25. virtual void didEnterVisibilityRange() const = 0;
  26. /**
  27. * Mark that the image view is no longer visible on screen.
  28. */
  29. virtual void didExitVisibilityRange() const = 0;
  30. };
  31. } // namespace react
  32. } // namespace facebook