X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fimage-loader%2Fasync-image-loader.h;h=6f73dd05839de1da3191128bcf11b8c10ca19832;hb=1de9cb6e0d9afd29e17819a6ed4b13f010faf8c3;hp=3472fc056ce9c339d94106ec3f7e43d884a68ca4;hpb=5f58a4de80835daf8db03a9e6b9c04cf5f556831;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/public-api/image-loader/async-image-loader.h b/dali-toolkit/public-api/image-loader/async-image-loader.h index 3472fc0..6f73dd0 100644 --- a/dali-toolkit/public-api/image-loader/async-image-loader.h +++ b/dali-toolkit/public-api/image-loader/async-image-loader.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_ASYNC_IMAGE_LOADER_H /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,10 +18,13 @@ */ // EXTERNAL INCLUDES -#include -#include #include +#include #include +#include + +// INTERNAL INCLUDES +#include namespace Dali { @@ -29,13 +32,17 @@ class PixelData; namespace Toolkit { - namespace Internal DALI_INTERNAL { class AsyncImageLoader; } /** + * @addtogroup dali_toolkit_image_loader + * @{ + */ + +/** * @brief The AsyncImageLoader is used to load pixel data from a URL asynchronously. * * The images are loaded in a worker thread to avoid blocking the main event thread. @@ -87,14 +94,12 @@ class AsyncImageLoader; * * @endcode */ -class DALI_IMPORT_API AsyncImageLoader : public BaseHandle +class DALI_TOOLKIT_API AsyncImageLoader : public BaseHandle { public: - - typedef Signal< void( uint32_t, PixelData ) > ImageLoadedSignalType; ///< Image loaded signal type @SINCE_1_2_14 + typedef Signal ImageLoadedSignalType; ///< Image loaded signal type @SINCE_1_2_14 public: - /** * @brief Constructor which creates an empty AsyncImageLoader handle. * @SINCE_1_2_14 @@ -104,7 +109,7 @@ public: AsyncImageLoader(); /** - * @brief Destructor + * @brief Destructor. * @SINCE_1_2_14 * * This is non-virtual since derived Handle types must not contain data or virtual methods. @@ -117,7 +122,15 @@ public: * * @param[in] handle A reference to the copied handle */ - AsyncImageLoader( const AsyncImageLoader& handle ); + AsyncImageLoader(const AsyncImageLoader& handle); + + /** + * @brief Move constructor + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + AsyncImageLoader(AsyncImageLoader&& rhs); /** * @brief This assignment operator is required for (smart) pointer semantics. @@ -126,30 +139,38 @@ public: * @param[in] handle A reference to the copied handle * @return A reference to this */ - AsyncImageLoader& operator=( const AsyncImageLoader& handle ); + AsyncImageLoader& operator=(const AsyncImageLoader& handle); /** - * @brief Create a new loader to load the image asynchronously in a worker thread. + * @brief Move assignment + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + AsyncImageLoader& operator=(AsyncImageLoader&& rhs); + + /** + * @brief Creates a new loader to load the image asynchronously in a worker thread. * @SINCE_1_2_14 * - * @return The image loader. + * @return The image loader */ static AsyncImageLoader New(); /** - * @brief Downcast a handle to AsyncImageLoader handle. + * @brief Downcasts a handle to AsyncImageLoader handle. * - * If the handle points to an AsyncImageLoader object the downcast produces - * a valid handle. If not, the returned handle is left uninitialized. + * If the handle points to an AsyncImageLoader object, the downcast produces a valid handle. + * If not, the returned handle is left uninitialized. * * @SINCE_1_2_14 * @param[in] handle A handle to an object * @return A handle to a AsyncImageLoader object or an uninitialized handle */ - static AsyncImageLoader DownCast( BaseHandle handle ); + static AsyncImageLoader DownCast(BaseHandle handle); /** - * @brief Start an image loading task. + * @brief Starts an image loading task. * Note: When using this method, the following defaults will be used: * fittingMode = FittingMode::DEFAULT * samplingMode = SamplingMode::BOX_THEN_LINEAR @@ -158,14 +179,13 @@ public: * @SINCE_1_2_14 * @REMARK_INTERNET * @REMARK_STORAGE - * - * @param[in] url The URL of the image file to load. - * @return The loading task id. + * @param[in] url The URL of the image file to load + * @return The loading task id */ - uint32_t Load( const std::string& url ); + uint32_t Load(const std::string& url); /** - * @brief Start an image loading task. + * @brief Starts an image loading task. * Note: When using this method, the following defaults will be used: * fittingMode = FittingMode::DEFAULT * samplingMode = SamplingMode::BOX_THEN_LINEAR @@ -174,76 +194,73 @@ public: * @SINCE_1_2_14 * @REMARK_INTERNET * @REMARK_STORAGE - * - * @param[in] url The URL of the image file to load. - * @param[in] dimensions The width and height to fit the loaded image to. - * @return The loading task id. + * @param[in] url The URL of the image file to load + * @param[in] dimensions The width and height to fit the loaded image to + * @return The loading task id */ - uint32_t Load( const std::string& url, ImageDimensions dimensions ); + uint32_t Load(const std::string& url, ImageDimensions dimensions); /** - * @brief Start an image loading task. + * @brief Starts an image loading task. * @SINCE_1_2_14 * @REMARK_INTERNET * @REMARK_STORAGE - * - * @param[in] url The URL of the image file to load. - * @param[in] dimensions The width and height to fit the loaded image to. - * @param[in] fittingMode The method used to fit the shape of the image before loading to the shape defined by the size parameter. - * @param[in] samplingMode The filtering method used when sampling pixels from the input image while fitting it to desired size. - * @param[in] orientationCorrection Reorient the image to respect any orientation metadata in its header. - * @return The loading task id. + * @param[in] url The URL of the image file to load + * @param[in] dimensions The width and height to fit the loaded image to + * @param[in] fittingMode The method used to fit the shape of the image before loading to the shape defined by the size parameter + * @param[in] samplingMode The filtering method used when sampling pixels from the input image while fitting it to desired size + * @param[in] orientationCorrection Reorient the image to respect any orientation metadata in its header + * @return The loading task id */ - uint32_t Load( const std::string& url, - ImageDimensions dimensions, - FittingMode::Type fittingMode, - SamplingMode::Type samplingMode, - bool orientationCorrection ); + uint32_t Load(const std::string& url, + ImageDimensions dimensions, + FittingMode::Type fittingMode, + SamplingMode::Type samplingMode, + bool orientationCorrection); /** - * @brief Cancel a image loading task if it is still queueing in the work thread. + * @brief Cancels an image loading task if it is still queueing in the work thread. * @SINCE_1_2_14 * * @param[in] loadingTaskId The task id returned when invoking the load call. * @return If true, the loading task is removed from the queue, otherwise the loading is already implemented and unable to cancel anymore */ - bool Cancel( uint32_t loadingTaskId ); + bool Cancel(uint32_t loadingTaskId); /** - * @brief Cancel all the loading tasks in the queue + * @brief Cancels all the loading tasks in the queue. * @SINCE_1_2_14 */ void CancelAll(); /** - * @brief Signal emit for connected callback functions to get access to the loaded pixel data. + * @brief Signal emitted for connected callback functions to get access to the loaded pixel data. * * A callback of the following type may be connected: * @code * void YourCallbackName( uint32_t id, PixelData pixelData ); * @endcode * @SINCE_1_2_14 - * - * @return A reference to a signal object to Connect() with. + * @return A reference to a signal object to Connect() with */ ImageLoadedSignalType& ImageLoadedSignal(); public: // Not intended for developer use - /// @cond internal /** * @brief Allows the creation of a AsyncImageLoader handle from an internal pointer. * * @note Not intended for application developers * @SINCE_1_2_14 - * - * @param[in] impl A pointer to the object. + * @param[in] impl A pointer to the object */ - explicit DALI_INTERNAL AsyncImageLoader( Internal::AsyncImageLoader* impl ); + explicit DALI_INTERNAL AsyncImageLoader(Internal::AsyncImageLoader* impl); /// @endcond - }; +/** + * @} + */ } // namespace Toolkit } // namespace Dali