X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fimages%2Fresource-image-impl.h;h=ce1d227bbf804034a8b95816e578fea7ed3f7914;hb=65bb67c665fe465e388e8510eeb5fadda45cf202;hp=a537d3ea19642f1efd7008893a832a0f27c84c6c;hpb=e7267cff159c0ea2f919cbbe8c809f22226148d9;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/images/resource-image-impl.h b/dali/internal/event/images/resource-image-impl.h index a537d3e..ce1d227 100644 --- a/dali/internal/event/images/resource-image-impl.h +++ b/dali/internal/event/images/resource-image-impl.h @@ -24,7 +24,7 @@ // INTERNAL INCLUDES #include #include -#include +#include #include // For DALI_LOG_OBJECT_STRING_DECLARATION namespace Dali @@ -33,10 +33,6 @@ namespace Dali namespace Internal { -typedef Dali::ResourceImage::LoadPolicy LoadPolicy; - -const LoadPolicy IMAGE_LOAD_POLICY_DEFAULT = Dali::ResourceImage::IMMEDIATE; - class ResourceImage; typedef IntrusivePtr ResourceImagePtr; @@ -59,24 +55,15 @@ public: * @param [in] url The URL of the image file. * @param [in] attributes requested parameters for loading (size, scaling etc.) * if width or height is specified as 0, the natural size will be used. - * @param [in] loadPol controls time of loading a resource from the filesystem (default: load when Image is created). - * @param [in] releasePol optionally relase memory when image is not visible on screen (default: keep image data until Image object is alive). * @return a pointer to a newly created object. */ static ResourceImagePtr New( const std::string& url, - const ImageAttributes& attributes, - LoadPolicy loadPol = IMAGE_LOAD_POLICY_DEFAULT, - ReleasePolicy releasePol = IMAGE_RELEASE_POLICY_DEFAULT ); + const ImageAttributes& attributes ); /** * @copydoc Dali::ResourceImage::GetLoadingState() */ - Dali::LoadingState GetLoadingState() const { return mTicket ? mTicket->GetLoadingState() : ResourceLoading; } - - /** - * @copydoc Dali::ResourceImage::GetLoadPolicy() - */ - LoadPolicy GetLoadPolicy () const { return mLoadPolicy; } + Dali::LoadingState GetLoadingState() const { return mLoadingState; } /** * @copydoc Dali::ResourceImage::LoadingFinishedSignal() @@ -84,17 +71,6 @@ public: Dali::ResourceImage::ResourceImageSignal& LoadingFinishedSignal() { return mLoadingFinished; } /** - * Connects a callback function with the object's signals. - * @param[in] object The object providing the signal. - * @param[in] tracker Used to disconnect the signal. - * @param[in] signalName The signal to connect to. - * @param[in] functor A newly allocated FunctorDelegate. - * @return True if the signal was connected. - * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor. - */ - static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ); - - /** * Get the attributes of the image. * Only to be used after the image has finished loading. * (Ticket's LoadingSucceeded callback was called) @@ -106,8 +82,9 @@ public: /** * @copydoc Dali::ResourceImage::GetUrl() + * virtual so deriving class can override it */ - const std::string& GetUrl() const; + virtual const std::string& GetUrl() const; /** * @copydoc Dali::ResourceImage::Reload() @@ -129,27 +106,6 @@ public: */ virtual Vector2 GetNaturalSize() const; - /** - * Indicates that the image is used. - */ - virtual void Connect(); - - /** - * Indicates that the image is not used anymore. - */ - virtual void Disconnect(); - -public: // From ResourceTicketObserver - - /** - * @copydoc Dali::Internal::ResourceTicketObserver::ResourceLoadingFailed() - */ - virtual void ResourceLoadingFailed(const ResourceTicket& ticket); - - /** - * @copydoc Dali::Internal::ResourceTicketObserver::ResourceLoadingSucceeded() - */ - virtual void ResourceLoadingSucceeded(const ResourceTicket& ticket); protected: @@ -161,33 +117,18 @@ protected: /** * Constructor, with default parameters */ - ResourceImage( LoadPolicy loadPol = IMAGE_LOAD_POLICY_DEFAULT, ReleasePolicy releasePol = IMAGE_RELEASE_POLICY_DEFAULT ); - -private: + ResourceImage(); /** - * Helper method to determine if the filename indicates that the image has a 9 patch border. - * @param [in] url The URL of the image file. - * @return true if it is a 9 patch image + * Constructor, with url and attributes */ - static bool IsNinePatch( const std::string& url ); - - /** - * Helper method to set new resource ticket. Stops observing current ticket if any, and starts observing - * the new one or just resets the intrusive pointer. - * @param[in] ticket pointer to new resource Ticket or NULL. - */ - void SetTicket( ResourceTicket* ticket ); + ResourceImage( const std::string& url, const ImageAttributes& attributes); private: - - ImageFactory& mImageFactory; - - ImageFactoryCache::RequestPtr mRequest; ///< contains the initially requested attributes for image. Request is reissued when memory was released. - Dali::ResourceImage::ResourceImageSignal mLoadingFinished; - - LoadPolicy mLoadPolicy : 2; ///< 2 bits is enough space + ImageAttributes mAttributes; + std::string mUrl; + Dali::LoadingState mLoadingState; // Changes scope, should be at end of class DALI_LOG_OBJECT_STRING_DECLARATION;