Add animated vector image visual
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / visual-url.h
index d9ed48a..f3af2e0 100644 (file)
@@ -40,13 +40,15 @@ public:
     REGULAR_IMAGE,
     N_PATCH,
     SVG,
-    GIF
+    GIF,
+    JSON
   };
 
-  enum Location
+  enum ProtocolType
   {
-    LOCAL,
-    REMOTE
+    LOCAL,   ///< file in local file system
+    TEXTURE, ///< texture uploaded to texture manager
+    REMOTE   ///< remote image
   };
 
   /**
@@ -90,7 +92,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 +101,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;
 };