|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectAbstractItemObj
BuddyItem
An SSI item object representing a buddy on the user's buddy list. A buddy
item contains a set of buddy alert flags (for the different types of alerts),
an alert sound filename, a buddy comment, and (though WinAIM does not yet
support it) an "alias" or "display name" for the buddy.
Note that this class is only used to store data and that changes to this
object are not reflected on the server without sending the changes to the
server with a ModifyItemsCmd
.
Field Summary | |
static int |
MASK_ACTION_PLAY_SOUND
An alert action flag indicating that a sound should be played when the buddy alert is activated. |
static int |
MASK_ACTION_POPUP
An alert action flag indicating that a window should be popped up when the buddy alert is activated. |
static int |
MASK_WHEN_ONLINE
An alert flag indicating that the buddy's alert should be activated when he or she signs on. |
static int |
MASK_WHEN_UNAWAY
An alert flag indicating that the buddy's alert should be activated when he or she comes back from being away. |
static int |
MASK_WHEN_UNIDLE
An alert flag indicating that the buddy's alert should be activated when he or she comes back from being idle. |
Constructor Summary | |
BuddyItem(BuddyItem other)
Creates a buddy item object with the same properties as the given object. |
|
BuddyItem(SsiItem item)
Creates a new buddy item object from the given SSI item. |
|
BuddyItem(java.lang.String sn,
int groupid,
int id)
Creates a new buddy item with the given screenname, group ID, and buddy ID. |
|
BuddyItem(java.lang.String sn,
int groupid,
int id,
java.lang.String alias,
java.lang.String comment,
int alertWhenMask,
int alertActionMask,
java.lang.String alertSound)
Creates a new buddy item object with the given properties. |
|
BuddyItem(java.lang.String sn,
int groupid,
int id,
java.lang.String alias,
java.lang.String comment,
int alertWhenMask,
int alertActionMask,
java.lang.String alertSound,
TlvChain extraTlvs)
Creates a new buddy item object with the given properties. |
Method Summary | |
int |
getAlertActionMask()
Returns a bit mask describing what should happen when a buddy alert is activated for this buddy. |
java.lang.String |
getAlertSound()
Returns the name of a sound file that should be played when this buddy's alert is activated. |
int |
getAlertWhenMask()
Returns a bit mask describing when a buddy alert for this user should be activated. |
java.lang.String |
getAlias()
Returns this buddy's "alias" or "display name." |
java.lang.String |
getBuddyComment()
Returns this buddy's "buddy comment." |
int |
getGroupId()
Returns the ID of the group in which this buddy resides. |
int |
getId()
Returns the ID of this buddy in its parent group. |
java.lang.String |
getScreenname()
Returns this buddy's screenname. |
void |
setAlertActionMask(int alertActionMask)
Sets this buddy's "alert action mask." |
void |
setAlertSound(java.lang.String alertSound)
Sets the "alert sound" filename for this buddy. |
void |
setAlertWhenMask(int alertWhenMask)
Sets this buddy's "alert criteria mask." |
void |
setAlias(java.lang.String alias)
Sets this buddy's "alias" or "display name." |
void |
setComment(java.lang.String comment)
Sets this buddy's "buddy comment." |
SsiItem |
toSsiItem()
Returns an SsiItem that represents this item object. |
java.lang.String |
toString()
|
Methods inherited from class AbstractItemObj |
addExtraTlvs, copyExtraTlvs, generateItem, generateSsiItems, getExtraTlvs |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int MASK_ACTION_POPUP
public static final int MASK_ACTION_PLAY_SOUND
getAlertSound
.
public static final int MASK_WHEN_ONLINE
public static final int MASK_WHEN_UNIDLE
public static final int MASK_WHEN_UNAWAY
Constructor Detail |
public BuddyItem(SsiItem item)
item
- a "buddy" (type SsiItem.TYPE_BUDDY
) SSI itempublic BuddyItem(BuddyItem other)
other
- a buddy item object to copypublic BuddyItem(java.lang.String sn, int groupid, int id)
null
or 0
depending on the field's type.
sn
- the buddy's screennamegroupid
- the ID of the group in which this buddy residesid
- the buddy's buddy IDpublic BuddyItem(java.lang.String sn, int groupid, int id, java.lang.String alias, java.lang.String comment, int alertWhenMask, int alertActionMask, java.lang.String alertSound)
sn
, groupid
, and id
can be either 0
or null
(depending on type) to
indicate that the given field should not be sent.
sn
- the buddy's screennamegroupid
- the ID of the group in which this buddy residesid
- the buddy's buddy IDalias
- an "alias" or "display name" for this buddy (only supported
by joscar and gaim)comment
- a "buddy comment" for this buddyalertWhenMask
- a set of bit flags indicating when a buddy alert
should be activated (see the MASK_WHEN_*
constants)alertActionMask
- a set of bit flags indicating what should happen
when a buddy alert is activated (see the MASK_ACTION_*
constants)alertSound
- the name of a sound file to play when an alert is
activated (normally stored without a full path or an extension,
like "moo")public BuddyItem(java.lang.String sn, int groupid, int id, java.lang.String alias, java.lang.String comment, int alertWhenMask, int alertActionMask, java.lang.String alertSound, TlvChain extraTlvs)
sn
, groupid
, and id
can be either 0
or null
(depending on type) to
indicate that the given field should not be sent.
sn
- the buddy's screennamegroupid
- the ID of the group in which this buddy residesid
- the buddy's buddy IDalias
- an "alias" or "display name" for this buddy (only supported
by joscar and gaim)comment
- a "buddy comment" for this buddyalertWhenMask
- a set of bit flags indicating when a buddy alert
should be activated (see the MASK_WHEN_*
constants)alertActionMask
- a set of bit flags indicating what should happen
when a buddy alert is activated (see the MASK_ACTION_*
constants)alertSound
- the name of a sound file to play when an alert is
activated (normally stored without a full path or an extension,
like "moo")extraTlvs
- a set of extra TLV's to store in this itemMethod Detail |
public final java.lang.String getScreenname()
public final int getGroupId()
public final int getId()
public final java.lang.String getAlias()
null
if
this buddy has no aliaspublic final java.lang.String getBuddyComment()
null
if this buddy
has no buddy commentpublic final int getAlertActionMask()
MASK_ACTION_POPUP
and MASK_ACTION_PLAY_SOUND
. One can test
for a given value using code resembling the following:
if ((buddyItem.getAlertActionMask() & BuddyItem.MASK_ACTION_POPUP) != 0) { // popup alert box }
public final int getAlertWhenMask()
MASK_WHEN_ONLINE
,
MASK_WHEN_UNAWAY
, and MASK_WHEN_UNIDLE
. One can test
for a given value using code resembling the following:
if ((buddyItem.getAlertWhenMask() & BuddyItem.MASK_WHEN_ONLINE) != 0) { System.out.println("An alert should be triggered when " + buddyItem.getScreenname() + " signs on!"); }
public final java.lang.String getAlertSound()
MASK_ACTION_PLAY_SOUND
. The filename is normally stored without a full
path or file extension, like "moo"
to represent
C:\Program Files\AIM95\Sounds\moo.wav
.
null
if none is stored for
this buddygetAlertActionMask()
public final void setAlias(java.lang.String alias)
alias
- this buddy's new "alias" or "display name," or
null
to erase this buddy's aliaspublic final void setComment(java.lang.String comment)
comment
- this buddy's new "buddy comment," or null
to
erase this buddy's commentpublic final void setAlertActionMask(int alertActionMask)
MASK_ACTION_POPUP
and MASK_ACTION_PLAY_SOUND
.
alertActionMask
- a new "alert action mask" for this buddypublic final void setAlertWhenMask(int alertWhenMask)
MASK_WHEN_ONLINE
, MASK_WHEN_UNAWAY
, and MASK_WHEN_UNIDLE
.
alertWhenMask
- a new "alert criteria mask" for this buddypublic final void setAlertSound(java.lang.String alertSound)
"moo"
to represent
C:\Program Files\AIM95\Sounds\moo.wav
.
alertSound
- the buddy's "alert sound filename," or
null
to erase any alert sound file currently stored
in this itempublic SsiItem toSsiItem()
SsiItemObj
SsiItem
that represents this item object.
SsiItem
that represents this item objectpublic java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |