*/
// INTERNAL INCLUDES
-#include <dali-toolkit/internal/visuals/visual-impl.h>
+#include <dali-toolkit/internal/visuals/visual-base-impl.h>
// EXTERNAL INCLUDES
#include <dali/public-api/images/image.h>
#include <dali/public-api/images/image-operations.h>
-#include <dali/public-api/images/nine-patch-image.h>
+#include <dali/devel-api/images/nine-patch-image.h>
#include <dali/public-api/rendering/geometry.h>
#include <dali/public-api/rendering/sampler.h>
#include <dali/public-api/rendering/shader.h>
* | borderOnly | BOOLEAN
*
*/
-class NPatchVisual: public Visual
+class NPatchVisual: public Visual::Base
{
public:
NPatchVisual( VisualFactoryCache& factoryCache );
/**
+ * @brief Constructor which creates an N-patch visual using an image URL.
+ *
+ * The visual will load the image synchronously when the associated actor is put on stage, and destroy the image when it is off stage
+ *
+ * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+ * @param[in] imageUrl The URL to 9 patch image resource to use
+ * @param[in] borderOnly A Flag to indicate if the image should omit the centre of the n-patch and only render the border
+ */
+ NPatchVisual( VisualFactoryCache& factoryCache, const std::string& imageUrl, bool borderOnly = false );
+
+ /**
+ * @brief Constructor which creates an N-patch viusal with a NinePatchImage resource.
+ *
+ * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+ * @param[in] image The NinePatchImage to use
+ * @param[in] borderOnly A Flag to indicate if the image should omit the centre of the n-patch and only render the border
+ */
+ NPatchVisual( VisualFactoryCache& factoryCache, NinePatchImage image, bool borderOnly = false );
+
+ /**
* @brief A reference counted object may only be deleted by calling Unreference().
*/
~NPatchVisual();
public: // from Visual
/**
- * @copydoc Visual::GetNaturalSize
+ * @copydoc Visual::Base::GetNaturalSize
*/
virtual void GetNaturalSize( Vector2& naturalSize ) const;
/**
- * @copydoc Visual::SetClipRect
+ * @copydoc Visual::Base::CreatePropertyMap
*/
- virtual void SetClipRect( const Rect<int>& clipRect );
+ virtual void DoCreatePropertyMap( Property::Map& map ) const;
/**
- * @copydoc Visual::SetOffset
+ * @copydoc Visual::Base::DoSetProperty
*/
- virtual void SetOffset( const Vector2& offset );
+ virtual void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue );
/**
- * @copydoc Visual::CreatePropertyMap
+ * @copydoc Visual::Base::DoGetProperty
*/
- virtual void DoCreatePropertyMap( Property::Map& map ) const;
+ virtual Dali::Property::Value DoGetProperty( Dali::Property::Index index );
protected:
/**
- * @copydoc Visual::DoInitialize
+ * @copydoc Visual::Base::DoInitialize
*/
virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
/**
- * @copydoc Visual::DoSetOnStage
+ * @copydoc Visual::Base::DoSetOnStage
*/
virtual void DoSetOnStage( Actor& actor );
/**
- * @copydoc Visual::DoSetOffStage
+ * @copydoc Visual::Base::DoSetOffStage
*/
virtual void DoSetOffStage( Actor& actor );
-public:
-
- /**
- * @brief Sets the 9 patch image of this visual to the resource at imageUrl
- * The visual will load the image synchronously when the associated actor is put on stage, and destroy the image when it is off stage
- *
- * @param[in] imageUrl The URL to 9 patch image resource to use
- * @param[in] borderOnly A Flag to indicate if the image should omit the centre of the n-patch and only render the border
- */
- void SetImage( const std::string& imageUrl, bool borderOnly = false );
-
- /**
- * @brief Sets the 9 patch image of this viusal to the 9 patch image
- *
- * @param[in] image The NinePatchImage to use
- * @param[in] borderOnly A Flag to indicate if the image should omit the centre of the n-patch and only render the border
- */
- void SetImage( NinePatchImage image, bool borderOnly = false );
-
private:
/**