X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fvisual-url.h;h=827dfce7989b3387270e6d54b2f5ea1e53016515;hb=3c6245ad032678461d6df519db63240016f43ed7;hp=96bd6353bb2c4f85b29b095135493f34ef83ed7c;hpb=e9333cfe318586fd503495e28b0d71c0dac4888a;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/visuals/visual-url.h b/dali-toolkit/internal/visuals/visual-url.h index 96bd635..827dfce 100644 --- a/dali-toolkit/internal/visuals/visual-url.h +++ b/dali-toolkit/internal/visuals/visual-url.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_VISUAL_URL_H /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,17 +21,13 @@ namespace Dali { - namespace Toolkit { - namespace Internal { - class VisualUrl { public: - /** * The type of the URL based on the string contents */ @@ -40,10 +36,13 @@ public: REGULAR_IMAGE, N_PATCH, SVG, - GIF + GIF, + WEBP, + JSON, + RIVE }; - enum Location + enum ProtocolType { LOCAL, ///< file in local file system TEXTURE, ///< texture uploaded to texture manager @@ -61,19 +60,19 @@ public: * Determines type of visual and whether the url is local or remote * @param[in] url The URL to store and resolve */ - VisualUrl( const std::string& url ); + VisualUrl(const std::string& url); /** * Copy constructor * @param[in] url The VisualUrl to copy */ - VisualUrl( const VisualUrl& url ); + VisualUrl(const VisualUrl& url); /** * Assignment operator * @param[in] url The VisualUrl to copy */ - VisualUrl& operator=( const VisualUrl& url ); + VisualUrl& operator=(const VisualUrl& url); /** * Get the full URL @@ -91,7 +90,7 @@ public: * Is the URL is local to the device, or remote? * @return the location of the resource */ - Location GetLocation() const; + ProtocolType GetProtocolType() const; /** * Is the URL valid? @@ -104,13 +103,24 @@ public: */ bool IsLocalResource() const; + /** + * @return the location part of the url + */ + std::string GetLocation() const; + + /** + * Helper to create a URL of type TEXTURE + * @param location the location of the texture + * @return the Url + */ + static std::string CreateTextureUrl(const std::string& location); + private: - std::string mUrl; - Type mType; - Location mLocation; + std::string mUrl; + Type mType; + ProtocolType mLocation; }; - } // namespace Internal } // namespace Toolkit