+private:
+
+ /**
+ * @brief Helper class to keep the relation between AsyncImageLoader and corresponding LoadingInfo container
+ */
+ class AsyncLoadingHelper : public ConnectionTracker
+ {
+ public:
+ /**
+ * @brief Create an AsyncLoadingHelper.
+ * @param[in] textureManager Reference to the texture manager
+ */
+ AsyncLoadingHelper(TextureManager& textureManager);
+
+ /**
+ * @brief Load a new texture.
+ * @param[in] textureId TextureId to reference the texture that will be loaded
+ * @param[in] url The URL of the image to load
+ * @param[in] desiredSize The size the image is likely to appear at. This can be set to 0,0 for automatic
+ * @param[in] fittingMode The FittingMode to use
+ * @param[in] samplingMode The SamplingMode to use
+ * @param[in] orientationCorrection Whether to use image metadata to rotate or flip the image, e.g., from portrait to landscape
+ */
+ void Load(TextureId textureId,
+ const VisualUrl& url,
+ ImageDimensions desiredSize,
+ FittingMode::Type fittingMode,
+ SamplingMode::Type samplingMode,
+ bool orientationCorrection);
+
+ public:
+ AsyncLoadingHelper(const AsyncLoadingHelper&) = delete;
+ AsyncLoadingHelper& operator=(const AsyncLoadingHelper&) = delete;
+
+ AsyncLoadingHelper(AsyncLoadingHelper&& rhs);
+ AsyncLoadingHelper& operator=(AsyncLoadingHelper&&rhs) = delete;
+
+ private:
+ /**
+ * @brief Main constructor that used by all other constructors
+ */
+ AsyncLoadingHelper(Toolkit::AsyncImageLoader loader,
+ TextureManager& textureManager,
+ AsyncLoadingInfoContainerType&& loadingInfoContainer);
+
+ /**
+ * @brief Callback to be called when texture loading is complete, it passes the pixel buffer on to texture manager.
+ * @param[in] id Loader id
+ * @param[in] pixelBuffer Image data
+ */
+ void AsyncLoadComplete(uint32_t id, Devel::PixelBuffer pixelBuffer);
+
+ private:
+ Toolkit::AsyncImageLoader mLoader;
+ TextureManager& mTextureManager;
+ AsyncLoadingInfoContainerType mLoadingInfoContainer;
+ };