X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fnpatch%2Fnpatch-visual.h;h=b3d2815eaeda692f0410cd2996741ac3862fd008;hp=e178eb868a134fce0ee3e26a348aef3a011ab222;hb=25b212f44160ea19465962203f604cdbc6623871;hpb=44835162f4c0107591223e60557ee62b79cab35a diff --git a/dali-toolkit/internal/visuals/npatch/npatch-visual.h b/dali-toolkit/internal/visuals/npatch/npatch-visual.h index e178eb8..b3d2815 100644 --- a/dali-toolkit/internal/visuals/npatch/npatch-visual.h +++ b/dali-toolkit/internal/visuals/npatch/npatch-visual.h @@ -18,10 +18,8 @@ * */ -// INTERNAL INCLUDES -#include - // EXTERNAL INCLUDES +#include #include #include #include @@ -29,6 +27,9 @@ #include #include +// INTERNAL INCLUDES +#include + namespace Dali { @@ -38,6 +39,9 @@ namespace Toolkit namespace Internal { +class NPatchVisual; +typedef IntrusivePtr< NPatchVisual > NPatchVisualPtr; + /** * The visual which renders an 9 patch image to the control's quad * @@ -54,36 +58,22 @@ class NPatchVisual: public Visual::Base public: /** - * @brief Constructor. - * - * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object - */ - NPatchVisual( VisualFactoryCache& factoryCache ); - - /** - * @brief Constructor which creates an N-patch visual using an image URL. + * @brief Create 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 ); + static NPatchVisualPtr New( VisualFactoryCache& factoryCache, const std::string& imageUrl ); /** - * @brief Constructor which creates an N-patch viusal with a NinePatchImage resource. + * @brief Create an N-patch visual 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(); + static NPatchVisualPtr New( VisualFactoryCache& factoryCache, NinePatchImage image ); public: // from Visual @@ -110,9 +100,21 @@ public: // from Visual protected: /** - * @copydoc Visual::Base::DoInitialize + * @brief Constructor. + * + * @param[in] factoryCache Reference to the VisualFactoryCache object */ - virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ); + NPatchVisual( VisualFactoryCache& factoryCache ); + + /** + * @brief A reference counted object may only be deleted by calling Unreference(). + */ + virtual ~NPatchVisual(); + + /** + * @copydoc Visual::Base::DoSetProperties + */ + virtual void DoSetProperties( const Property::Map& propertyMap ); /** * @copydoc Visual::Base::DoSetOnStage @@ -124,6 +126,11 @@ protected: */ virtual void DoSetOffStage( Actor& actor ); + /** + * @copydoc Visual::Base::OnSetTransform + */ + virtual void OnSetTransform(); + private: /**