Moo
MooFriends Class Referenceabstract

MooFriend container and management

More...

#include <moofriends.h>

Public Types

enum  {
  kFriendsChanged = 2000, kSearchedUsersChanged, kFriendChanged, kFriendAdded,
  kFriendRemoved, kSearchedUserChanged, kSearchedUserAdded, kSearchedUserRemoved,
  kFriendMessage, kFriendOnlineStateChanged, kMooFriendsErrorNotLoggedIn = 2000, kMooFriendsErrorUnspecifiedError
}
 asynchronous operations as passed to the operation parameter for the callback More...
 

Public Member Functions

virtual MooFriend ** getFriends (mooInt &count)=0
 
virtual MooFriendgetFriend (mooUInt iD)=0
 get friend by ID
 
virtual void searchUsers (const mooChar *searchText)=0
 
virtual MooFriend ** getSearchedUsers (mooInt &count)=0
 
virtual void setCallback (mooFriendsCallback callback, void *reference)=0
 
virtual const mooChargetLastError ()=0
 for unspecified errors (see kMooFriendsErrorUnspecifiedError below), get error string
 

Detailed Description

MooFriend container and management


MooFriends

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

asynchronous operations as passed to the operation parameter for the callback

Enumerator
kFriendChanged 

with id

kFriendAdded 

new in the list with id

kFriendRemoved 

with id

kSearchedUserChanged 

with id

kSearchedUserAdded 

new in the list with id

kSearchedUserRemoved 

with id

kFriendMessage 

with id, result is message ID, see MooFriend getMessage ()

kFriendOnlineStateChanged 

with id, result 0: offline, 1 : online

Member Function Documentation

◆ getFriends()

virtual MooFriend** MooFriends::getFriends ( mooInt count)
pure virtual

obtain a list of all friends. Note that members of the MooFriend array may be null, which happens when a friend becomes unfriended. this also means that the returned count value includes removed friends (which are null in the list) this may also happen from outside, then your callback is beeing invoked. This ensures that list indices are never changed. accordingly, new users may have been added which possibly increases the size of the list (count parameter). the list is first populated when the user is successfully logged in, otherwise NULL is returned. note that the list may change dynamically, for instance when a friend confirms a friendship request. In that case, your callback will be invoked, so you should call getFriends once after login, and then in you callback to refresh your own representation. See MooFriend for further actions on users or friends returned in the according lists.

◆ getSearchedUsers()

virtual MooFriend** MooFriends::getSearchedUsers ( mooInt count)
pure virtual

obtain a list of users found by searchUsers. call this in your callback when kSerachedUsersChanged is passed. the list may be invalid or even corrupted if you call it after you called searchUsers and before your callback is invoked. it is valid until the next call to searchUsers. "friends" in this list are usually not friends, but you may refer to them (their id) when inviting one. See MooFriend for further actions on users or friends returned in the according lists.

◆ searchUsers()

virtual void MooFriends::searchUsers ( const mooChar searchText)
pure virtual

obtain a list of users by search string. This will search by name and all properties (skills, instruments etc). this method returns nothing, as it may take a while until the list is populated by the server. your callback will be invoked with kSerachedUsersChanged when the operation has finished. do not call getSearchUsers after a call to searchUsers before your callback has been called.

◆ setCallback()

virtual void MooFriends::setCallback ( mooFriendsCallback  callback,
void *  reference 
)
pure virtual

the reference parameter passed to setCallback is passed to the callback for your own use, Moo does not touch this. currently this callback is only invoked when either the friends, or search list has changed.


The documentation for this class was generated from the following file: