X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Ftexture-manager-impl.h;h=8685ec6aa260c764e599052455e7027846ccf16a;hp=5b6a98e010baca79f04e4fb39d2c371c67d861c1;hb=b5dfb0468ead331593b706bb116d6a6aed97d88c;hpb=24754c36dd4d11af5b927511580fdeb2514e9d1c diff --git a/dali-toolkit/internal/visuals/texture-manager-impl.h b/dali-toolkit/internal/visuals/texture-manager-impl.h index 5b6a98e..8685ec6 100644 --- a/dali-toolkit/internal/visuals/texture-manager-impl.h +++ b/dali-toolkit/internal/visuals/texture-manager-impl.h @@ -136,6 +136,18 @@ public: }; using MaskingDataPointer = std::unique_ptr; + + /** + * Class to provide lifecycle event on destruction of texture manager. + */ + struct LifecycleObserver + { + /** + * Called shortly before the texture manager is destroyed. + */ + virtual void TextureManagerDestroyed() = 0; + }; + /** * Constructor. */ @@ -144,8 +156,7 @@ public: /** * Destructor. */ - ~TextureManager() = default; - + ~TextureManager(); // TextureManager Main API: @@ -329,6 +340,19 @@ public: */ TextureSet RemoveExternalTexture( const std::string& url ); + /** + * Add an observer to the object. + * @param[in] observer The observer to add. + */ + void AddObserver( TextureManager::LifecycleObserver& observer ); + + /** + * Remove an observer from the object + * @pre The observer has already been added. + * @param[in] observer The observer to remove. + */ + void RemoveObserver( TextureManager::LifecycleObserver& observer ); + private: /** @@ -710,6 +734,7 @@ private: // Member Variables: RoundRobinContainerView< AsyncLoadingHelper > mAsyncLocalLoaders; ///< The Asynchronous image loaders used to provide all local async loads RoundRobinContainerView< AsyncLoadingHelper > mAsyncRemoteLoaders; ///< The Asynchronous image loaders used to provide all remote async loads std::vector< ExternalTextureInfo > mExternalTextures; ///< Externally provided textures + Dali::Vector mLifecycleObservers; ///< Lifecycle observers of texture manager TextureId mCurrentTextureId; ///< The current value used for the unique Texture Id generation };