Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber.extensions.thumbnail
Class ThumbnailElement

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.jabber.extensions.thumbnail.ThumbnailElement

public class ThumbnailElement
extends Object

The ThumbnailElement represents a "thumbnail" XML element, that is contained in the file element, we're sending to notify for a file transfer. The ThumbnailElement's role is to advertise a thumbnail.

Author:
Yana Stamcheva

Field Summary
static String CID
          The name of the thumbnail attribute "cid".
static String ELEMENT_NAME
          The name of the XML element used for transport of thumbnail parameters.
static String HEIGHT
          The name of the thumbnail attribute "height".
static String MIME_TYPE
          The name of the thumbnail attribute "mime-type".
static String NAMESPACE
          The names XMPP space that the thumbnail elements belong to.
static String WIDTH
          The name of the thumbnail attribute "width".
 
Constructor Summary
ThumbnailElement(String xml)
          Creates a ThumbnailElement by parsing the given xml.
ThumbnailElement(String serverAddress, byte[] thumbnailData, String mimeType, int width, int height)
          Creates a ThumbnailPacketExtension by specifying all extension attributes.
 
Method Summary
 String getCid()
          Returns the Content-ID, corresponding to this ThumbnailElement.
 int getHeight()
          Returns the height of this ThumbnailElement.
 String getMimeType()
          Returns the mime type of this ThumbnailElement.
 int getWidth()
          Returns the width of this ThumbnailElement.
 void setCid(String cid)
          Sets the content-ID of this ThumbnailElement.
 void setHeight(int height)
          Sets the height of the thumbnail
 void setMimeType(String mimeType)
          Sets the mime type of the thumbnail.
 void setWidth(int width)
          Sets the width of the thumbnail
 String toXML()
          Returns the XML representation of this PacketExtension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ELEMENT_NAME

public static final String ELEMENT_NAME
The name of the XML element used for transport of thumbnail parameters.

See Also:
Constant Field Values

NAMESPACE

public static final String NAMESPACE
The names XMPP space that the thumbnail elements belong to.

See Also:
Constant Field Values

CID

public static final String CID
The name of the thumbnail attribute "cid".

See Also:
Constant Field Values

MIME_TYPE

public static final String MIME_TYPE
The name of the thumbnail attribute "mime-type".

See Also:
Constant Field Values

WIDTH

public static final String WIDTH
The name of the thumbnail attribute "width".

See Also:
Constant Field Values

HEIGHT

public static final String HEIGHT
The name of the thumbnail attribute "height".

See Also:
Constant Field Values
Constructor Detail

ThumbnailElement

public ThumbnailElement(String serverAddress,
                        byte[] thumbnailData,
                        String mimeType,
                        int width,
                        int height)
Creates a ThumbnailPacketExtension by specifying all extension attributes.

Parameters:
serverAddress - the Jabber address of the destination contact
thumbnailData - the byte array containing the thumbnail data
mimeType - the mime type attribute
width - the width of the thumbnail
height - the height of the thumbnail

ThumbnailElement

public ThumbnailElement(String xml)
Creates a ThumbnailElement by parsing the given xml.

Parameters:
xml - the XML from which we obtain the needed information to create this ThumbnailElement
Method Detail

toXML

public String toXML()
Returns the XML representation of this PacketExtension.

Returns:
the packet extension as XML.

getCid

public String getCid()
Returns the Content-ID, corresponding to this ThumbnailElement.

Returns:
the Content-ID, corresponding to this ThumbnailElement

getMimeType

public String getMimeType()
Returns the mime type of this ThumbnailElement.

Returns:
the mime type of this ThumbnailElement

getWidth

public int getWidth()
Returns the width of this ThumbnailElement.

Returns:
the width of this ThumbnailElement

getHeight

public int getHeight()
Returns the height of this ThumbnailElement.

Returns:
the height of this ThumbnailElement

setCid

public void setCid(String cid)
Sets the content-ID of this ThumbnailElement.

Parameters:
cid - the content-ID to set

setMimeType

public void setMimeType(String mimeType)
Sets the mime type of the thumbnail.

Parameters:
mimeType - the mime type of the thumbnail

setWidth

public void setWidth(int width)
Sets the width of the thumbnail

Parameters:
width - the width of the thumbnail

setHeight

public void setHeight(int height)
Sets the height of the thumbnail

Parameters:
height - the height of the thumbnail

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.