RCTImageResponseObserverProxy.h 832 B

12345678910111213141516171819202122232425262728293031323334
  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. #import "RCTImageResponseDelegate.h"
  9. #include <react/imagemanager/ImageResponseObserver.h>
  10. NS_ASSUME_NONNULL_BEGIN
  11. namespace facebook {
  12. namespace react {
  13. class RCTImageResponseObserverProxy final : public ImageResponseObserver {
  14. public:
  15. RCTImageResponseObserverProxy(id<RCTImageResponseDelegate> delegate = nil);
  16. void didReceiveImage(ImageResponse const &imageResponse) const override;
  17. void didReceiveProgress(float progress) const override;
  18. void didReceiveFailure() const override;
  19. private:
  20. __weak id<RCTImageResponseDelegate> delegate_;
  21. };
  22. } // namespace react
  23. } // namespace facebook
  24. NS_ASSUME_NONNULL_END