Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.protocol
Class AbstractOperationSetAvatar<T extends ProtocolProviderService>

java.lang.Object
  extended by net.java.sip.communicator.service.protocol.AbstractOperationSetAvatar<T>
All Implemented Interfaces:
OperationSet, OperationSetAvatar
Direct Known Subclasses:
OperationSetAvatarIcqImpl, OperationSetAvatarJabberImpl, OperationSetAvatarMsnImpl, OperationSetAvatarSipImpl

public abstract class AbstractOperationSetAvatar<T extends ProtocolProviderService>
extends Object
implements OperationSetAvatar

Represents a default implementation of OperationSetAvatar in order to make it easier for implementers to provide complete solutions while focusing on implementation-specific details.

Author:
Damien Roth

Constructor Summary
protected AbstractOperationSetAvatar(T parentProvider, OperationSetServerStoredAccountInfo accountInfoOpSet, int maxWidth, int maxHeight, int maxSize)
           
 
Method Summary
 void addAvatarListener(AvatarListener listener)
          Registers a listener that would receive events upon avatar changes.
protected  void fireAvatarChanged(byte[] newAvatar)
          Notifies all registered listeners of the new event.
 byte[] getAvatar()
          Returns the current avatar of this protocol.
 int getMaxHeight()
          Returns the maximum height of the avatar.
 int getMaxSize()
          Returns the maximum size of the avatar.
 int getMaxWidth()
          Returns the maximum width of the avatar.
 void removeAvatarListener(AvatarListener listener)
          Removes the specified group change listener so that it won't receive any further events.
 void setAvatar(byte[] avatar)
          Defines a new avatar for this protocol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractOperationSetAvatar

protected AbstractOperationSetAvatar(T parentProvider,
                                     OperationSetServerStoredAccountInfo accountInfoOpSet,
                                     int maxWidth,
                                     int maxHeight,
                                     int maxSize)
Method Detail

getMaxWidth

public int getMaxWidth()
Description copied from interface: OperationSetAvatar
Returns the maximum width of the avatar. This method should return 0 (zero) if there is no maximum width.

Specified by:
getMaxWidth in interface OperationSetAvatar
Returns:
the maximum width of the avatar

getMaxHeight

public int getMaxHeight()
Description copied from interface: OperationSetAvatar
Returns the maximum height of the avatar. This method should return 0 (zero) if there is no maximum height.

Specified by:
getMaxHeight in interface OperationSetAvatar
Returns:
the maximum height of the avatar

getMaxSize

public int getMaxSize()
Description copied from interface: OperationSetAvatar
Returns the maximum size of the avatar. This method should return 0 (zero) if there is no maximum size.

Specified by:
getMaxSize in interface OperationSetAvatar
Returns:
the maximum size of the avatar

getAvatar

public byte[] getAvatar()
Description copied from interface: OperationSetAvatar
Returns the current avatar of this protocol. May return null if the account has no avatar

Specified by:
getAvatar in interface OperationSetAvatar
Returns:
avatar's bytes or null if no avatar set

setAvatar

public void setAvatar(byte[] avatar)
Description copied from interface: OperationSetAvatar
Defines a new avatar for this protocol

Specified by:
setAvatar in interface OperationSetAvatar
Parameters:
avatar - the new avatar

addAvatarListener

public void addAvatarListener(AvatarListener listener)
Description copied from interface: OperationSetAvatar
Registers a listener that would receive events upon avatar changes.

Specified by:
addAvatarListener in interface OperationSetAvatar
Parameters:
listener - a AvatarListener that would receive events upon avatar changes.

removeAvatarListener

public void removeAvatarListener(AvatarListener listener)
Description copied from interface: OperationSetAvatar
Removes the specified group change listener so that it won't receive any further events.

Specified by:
removeAvatarListener in interface OperationSetAvatar
Parameters:
listener - the AvatarListener to remove

fireAvatarChanged

protected void fireAvatarChanged(byte[] newAvatar)
Notifies all registered listeners of the new event.

Parameters:
newAvatar - the new avatar

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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