// EXTERNAL INCLUDES
#include <dali/public-api/images/image.h>
#include <dali/public-api/images/image-operations.h>
+#include <dali/public-api/images/resource-image.h>
namespace Dali
{
* "default"
*
*/
-class ImageRenderer: public ControlRenderer
+class ImageRenderer: public ControlRenderer, public ConnectionTracker
{
public:
/**
* @brief Constructor.
+ *
+ * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
*/
- ImageRenderer();
+ ImageRenderer( RendererFactoryCache& factoryCache );
/**
* @brief A reference counted object may only be deleted by calling Unreference().
~ImageRenderer();
public: // from ControlRenderer
- /**
- * @copydoc ControlRenderer::Initialize
- */
- virtual void Initialize( RendererFactoryCache& factoryCache, const Property::Map& propertyMap );
/**
* @copydoc ControlRenderer::SetSize
virtual void SetSize( const Vector2& size );
/**
+ * @copydoc ControlRenderer::GetNaturalSize
+ */
+ virtual void GetNaturalSize( Vector2& naturalSize ) const;
+
+ /**
* @copydoc ControlRenderer::SetClipRect
*/
virtual void SetClipRect( const Rect<int>& clipRect );
*/
virtual void SetOffset( const Vector2& offset );
+ /**
+ * @copydoc ControlRenderer::CreatePropertyMap
+ */
+ virtual void DoCreatePropertyMap( Property::Map& map ) const;
+
protected:
/**
+ * @copydoc ControlRenderer::DoInitialize
+ */
+ virtual void DoInitialize( const Property::Map& propertyMap );
+
+ /**
* @copydoc ControlRenderer::DoSetOnStage
*/
virtual void DoSetOnStage( Actor& actor );
*/
virtual void DoSetOffStage( Actor& actor );
+ /**
+ * @copydoc ControlRenderer::InitializeRenderer
+ */
+ virtual void InitializeRenderer( Renderer& renderer );
+
public:
/**
*/
void SetImage( Image image );
+ /**
+ * @brief Gets the image this renderer uses
+ *
+ * @return The image this renderer uses, which may be null if the image is set from a URL string and the renderer is not set as onstage
+ */
+ Image GetImage() const;
+
private:
/**
*/
void ApplyImageToSampler();
+ /**
+ * Callback function of image resource loading succeed
+ * @param[in] image The Image content that we attempted to load from mImageUrl
+ */
+ void OnImageLoaded( ResourceImage image );
+
private:
Image mImage;