X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fvisual-url.h;h=63ad5e47e22af4f0ad406b431f9fc062b5f0c9b7;hb=ef15505c94dffeb0639c91d9d3cd374918c21c4f;hp=d9ed48a8a2a10b833b139069d30a8afbaa92c994;hpb=8cfc7965881ba756bca7bdde98b548200a649bd4;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 d9ed48a..63ad5e4 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) 2020 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. @@ -40,13 +40,16 @@ public: REGULAR_IMAGE, N_PATCH, SVG, - GIF + GIF, + WEBP, + JSON }; - enum Location + enum ProtocolType { - LOCAL, - REMOTE + LOCAL, ///< file in local file system + TEXTURE, ///< texture uploaded to texture manager + REMOTE ///< remote image }; /** @@ -90,7 +93,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? @@ -99,14 +102,26 @@ public: bool IsValid() const; /** - * @return true if the location is LOCAL + * @return true if the location is LOCAL, i.e. is loadable from local file system */ - bool IsLocal() const; + 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; + ProtocolType mLocation; };