aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/service/replacement/directimage/DirectImageReplacementService.java
diff options
context:
space:
mode:
authorhristoterezov <hristo@jitsi.org>2013-09-30 13:46:09 +0300
committerhristoterezov <hristo@jitsi.org>2013-09-30 13:46:09 +0300
commita16097f5cd159d446963f91b0491ee87d4a23f9e (patch)
tree00e3bae1f46ff5c1c660b52c81a2b2200566f2ba /src/net/java/sip/communicator/service/replacement/directimage/DirectImageReplacementService.java
parentf02a12d22dbd330904622eb0cec42d7e3c8186a7 (diff)
downloadjitsi-a16097f5cd159d446963f91b0491ee87d4a23f9e.zip
jitsi-a16097f5cd159d446963f91b0491ee87d4a23f9e.tar.gz
jitsi-a16097f5cd159d446963f91b0491ee87d4a23f9e.tar.bz2
Adds check for image size and content type for the image replacement of links. Adds "show preview" link next to the image link if the preview of the images is disabled. Patch provided by Marin Dzhigarov on dev mailing list (subject: "PATCH: Replacement of Image/Video links").
Diffstat (limited to 'src/net/java/sip/communicator/service/replacement/directimage/DirectImageReplacementService.java')
-rw-r--r--src/net/java/sip/communicator/service/replacement/directimage/DirectImageReplacementService.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/service/replacement/directimage/DirectImageReplacementService.java b/src/net/java/sip/communicator/service/replacement/directimage/DirectImageReplacementService.java
new file mode 100644
index 0000000..a8d48d3
--- /dev/null
+++ b/src/net/java/sip/communicator/service/replacement/directimage/DirectImageReplacementService.java
@@ -0,0 +1,34 @@
+/*
+ * Jitsi, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.replacement.directimage;
+
+import net.java.sip.communicator.service.replacement.*;
+
+/**
+ *
+ * @author Marin Dzhigarov
+ *
+ */
+public interface DirectImageReplacementService
+ extends ReplacementService
+{
+ /**
+ * Returns the size of the image in bytes.
+ * @param sourceString the image link.
+ * @return the file size in bytes of the image link provided; -1 if the size
+ * isn't available or exceeds the max allowed image size.
+ */
+ public long getImageSize(String sourceString);
+
+ /**
+ * Checks if the resource pointed by sourceString is an image.
+ * @param sourceString the image link.
+ * @return true if the content type of the resource
+ * pointed by sourceString is an image.
+ */
+ public boolean isDirectImage(String sourceString);
+}