com.skype.api
Class ContactGroup

java.lang.Object
  extended by com.skype.ipc.SidObject
      extended by com.skype.api.ContactGroup
All Implemented Interfaces:
SidGetResponding

public final class ContactGroup
extends SidObject

Collects and manages Contacts related by type, status, or some other arbitrary criteria. SkypeKit recognizes two distinct ContactGroup flavors - "hardwired" and "custom". SkypeKit both defines the criteria for and dynamically manages all "hardwired" ContactGroups. Individual users explicitly create and manage all "custom" ContactGroups. "Hardwired" groups are primarily organizational tools, for example, they enable you to display a list of all Contacts awaiting authorization by you. "Custom" groups are also organizational tools, for example, they enable you to display a list of all Contacts in a particular geographical area or belonging to a particular professional association, social clubs, and so forth. Primarily, though, "custom" groups are functional tools that enable you to establish conference calls, group chats, and so forth. "Hardwired" ContactGroups are defined for and available to all users. SkypeKit determines membership in a particular "hardwired" group dynamically whenever a user invokes Skype.GetHardwiredContactGroup for that group. Subsequent changes to a Contact's status might result in its being added to (for example, the Contact is now authorized) or removed from (for example, the Contact is now removed or blocked) one or more "hardwired" groups. SkypeKit fires OnChange events for all affected ContractGroup instances. Essentially all ContactGroup methods related to explicitly adding and removing members and conversations from the group return false, and CanAdd and CanRemove additionally return a false result. "Custom" ContactGroups can be defined by a particular Skype user through the UI. Your UI should implement Creation, deletion and filtering contact list by custom contact groups, as well as adding and removing contacts in those groups. A Contact can belong to multiple non-mutually exclusive "hardwired" groups at the same time, for example, an authorized contact is typically in your "buddy" group, but a Contact cannot belong to CONTACTS_AUTHORIZED_BY_ME if they are awaiting authorization. Similarly, a Contact can belong to multiple "custom" groups and mutual exclusivity is typically not an issue.


Nested Class Summary
static class ContactGroup.Property
          Properties of the ContactGroup class
static class ContactGroup.Type
          The list of all possible ContactGroup types.
 
Field Summary
 int mContactCount
           
 int mCustomGroupId
           
 java.lang.String mGivenDisplayName
           
 int mOnlineContactCount
           
 ContactGroup.Type mType
           
 
Fields inherited from class com.skype.ipc.SidObject
mSidCached, mSidOid, mSidRoot, mSidTimestamp
 
Constructor Summary
ContactGroup(int oid, SidRoot root)
           
 
Method Summary
 void addContact(Contact contact)
          Adds contact to a contact group.
 void addConversation(Conversation conversation)
          Adds given conversation to the ContactGroup.
 boolean canAddContact(Contact contact)
          Checks if the current user can add given contact to the ContactGroup.
 boolean canAddConversation(Conversation conversation)
          Checks if the current user can add given conversation to the ContactGroup.
 boolean canRemoveContact()
          Checks if the current user can remove given contact from the ContactGroup.
 boolean canRemoveConversation()
          Checks if the current user can remove given conversation from the ContactGroup.
 boolean delete()
          Removes the contact group.
 int getContactCount()
          Number of contacts in the group.
 Contact[] getContacts()
          Retrieves contact list.
 Conversation[] getConversations()
          Returns list of conversations in the ContactGroup.
 int getCustomGroupId()
          unique 32-bit ID for custom groups
 java.lang.String getGivenDisplayName()
          change via ContactGroup.GiveDisplayname()
 int getOnlineContactCount()
          number of contacts online in the group
 java.lang.String getPropertyAsString(ContactGroup.Property prop)
           
 java.lang.String getPropertyAsString(int prop)
           
 ContactGroup.Type getType()
          ContactGroup.TYPE
 void giveDisplayName(java.lang.String name)
          Setter for ContactGroup class GIVEN_DISPLAYNAME property.
 int moduleId()
           
 void removeContact(Contact contact)
          Removes contact from the ContactGroup.
 void removeConversation(Conversation conversation)
          Removes given conversation from the ContactGroup.
 EnumConverting sidGetEnumProperty(PropertyEnumConverting prop)
           
 int sidGetIntProperty(PropertyEnumConverting prop)
           
 java.lang.String sidGetStringProperty(PropertyEnumConverting prop)
           
 SidGetResponding sidMultiGet(ContactGroup.Property[] requested)
          generic multiget of a list of Property
static SidGetResponding[] sidMultiGet(ContactGroup.Property[] requested, ContactGroup[] objects)
          generic multiget of list of Property for a list of ContactGroup
protected  void sidOnChangedProperty(int propertyId, int value, java.lang.String svalue)
           
 void sidSetProperty(PropertyEnumConverting prop, int newValue)
           
 void sidSetProperty(PropertyEnumConverting prop, java.lang.String newValue)
           
 
Methods inherited from class com.skype.ipc.SidObject
finalize, getOid, hasCached, invalidateCache, isCached, sidDoRequest, sidGetBinaryProperty, sidGetBoolProperty, sidGetFilenameProperty, sidGetLongProperty, sidGetObject, sidGetObjectProperty, sidGetUintProperty, sidGetXmlProperty, sidMultiGet, sidMultiGet, sidMultiGet, sidMultiGet, sidRequestBinaryProperty, sidRequestBoolProperty, sidRequestEnumProperty, sidRequestFilenameProperty, sidRequestIntProperty, sidRequestObjectProperty, sidRequestProperty, sidRequestStringProperty, sidRequestUintProperty, sidRequestXmlProperty, sidSetProperty, sidSetProperty, sidSetProperty
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mType

public ContactGroup.Type mType

mCustomGroupId

public int mCustomGroupId

mGivenDisplayName

public java.lang.String mGivenDisplayName

mContactCount

public int mContactCount

mOnlineContactCount

public int mOnlineContactCount
Constructor Detail

ContactGroup

public ContactGroup(int oid,
                    SidRoot root)
Method Detail

giveDisplayName

public void giveDisplayName(java.lang.String name)
Setter for ContactGroup class GIVEN_DISPLAYNAME property. * @param name


delete

public boolean delete()
Removes the contact group. This is synced across instances logged in with the same account - which can take several minutes for the sync to happen. * @return result


getConversations

public Conversation[] getConversations()
Returns list of conversations in the ContactGroup. * @return conversations


canAddConversation

public boolean canAddConversation(Conversation conversation)
Checks if the current user can add given conversation to the ContactGroup. Returns false for most of the hardwired contact groups for example. * @param conversation Conversation to be checked.

Returns:
result Returns true if Conversation can be added to this ContactGroup.

addConversation

public void addConversation(Conversation conversation)
Adds given conversation to the ContactGroup. * @param conversation


canRemoveConversation

public boolean canRemoveConversation()
Checks if the current user can remove given conversation from the ContactGroup. Again, returns false for most hardwired contact groups. * @return result true if RemoveConversation(contact) works on this group


removeConversation

public void removeConversation(Conversation conversation)
Removes given conversation from the ContactGroup. * @param conversation


getContacts

public Contact[] getContacts()
Retrieves contact list. * @return contacts


canAddContact

public boolean canAddContact(Contact contact)
Checks if the current user can add given contact to the ContactGroup. * @param contact Contact to be checked.

Returns:
result returns true if AddContact(contact) works on this group.

addContact

public void addContact(Contact contact)
Adds contact to a contact group. This only works for non-hardwired contact groups. * @param contact


canRemoveContact

public boolean canRemoveContact()
Checks if the current user can remove given contact from the ContactGroup. * @return result true if RemoveContact(contact) works on this group


removeContact

public void removeContact(Contact contact)
Removes contact from the ContactGroup. * @param contact


sidMultiGet

public SidGetResponding sidMultiGet(ContactGroup.Property[] requested)
generic multiget of a list of Property

Parameters:
requested - the list of requested properties of ContactGroup
Returns:
SidGetResponding

sidMultiGet

public static SidGetResponding[] sidMultiGet(ContactGroup.Property[] requested,
                                             ContactGroup[] objects)
generic multiget of list of Property for a list of ContactGroup

Parameters:
requested - the list of requested properties
Returns:
SidGetResponding[] can be casted to (ContactGroup[]) if all properties are cached

getType

public ContactGroup.Type getType()
ContactGroup.TYPE


getCustomGroupId

public int getCustomGroupId()
unique 32-bit ID for custom groups


getGivenDisplayName

public java.lang.String getGivenDisplayName()
change via ContactGroup.GiveDisplayname()


getContactCount

public int getContactCount()
Number of contacts in the group. NB! The value of this property does not get updated until 5 seconds after account login. During these initial 5 seconds, the value of this property remains 0. The reason for this 5 second delay is to reduce the flurry of property update traffic that occurs during the CBL synchronization phase, following successful login. Note that if you absolutely need to have this value immediately after login, you can still get it by retrieving the contact list with ContactGroup.GetContacts method and examining its size.


getOnlineContactCount

public int getOnlineContactCount()
number of contacts online in the group


sidGetStringProperty

public java.lang.String sidGetStringProperty(PropertyEnumConverting prop)
Specified by:
sidGetStringProperty in interface SidGetResponding
Overrides:
sidGetStringProperty in class SidObject

sidGetIntProperty

public int sidGetIntProperty(PropertyEnumConverting prop)
Specified by:
sidGetIntProperty in interface SidGetResponding
Overrides:
sidGetIntProperty in class SidObject

sidGetEnumProperty

public EnumConverting sidGetEnumProperty(PropertyEnumConverting prop)
Specified by:
sidGetEnumProperty in interface SidGetResponding
Overrides:
sidGetEnumProperty in class SidObject

getPropertyAsString

public java.lang.String getPropertyAsString(int prop)

getPropertyAsString

public java.lang.String getPropertyAsString(ContactGroup.Property prop)

sidOnChangedProperty

protected void sidOnChangedProperty(int propertyId,
                                    int value,
                                    java.lang.String svalue)
Specified by:
sidOnChangedProperty in class SidObject

sidSetProperty

public void sidSetProperty(PropertyEnumConverting prop,
                           java.lang.String newValue)
Specified by:
sidSetProperty in interface SidGetResponding
Overrides:
sidSetProperty in class SidObject

sidSetProperty

public void sidSetProperty(PropertyEnumConverting prop,
                           int newValue)
Specified by:
sidSetProperty in interface SidGetResponding
Overrides:
sidSetProperty in class SidObject

moduleId

public int moduleId()
Specified by:
moduleId in class SidObject


Copyright © 2010, 2011 Skype Technologies. All Rights Reserved.