Moo
MooUser Class Referenceabstract

the current application User

More...

#include <moouser.h>

Public Types

enum  { kFileSendFinished = 1000 }
 asynchronous operations as passed to the operation parameter for the callback
 
enum  mooUserInfoType {
  kUserInfoInvalid = 0, kUserInfoLanguage, kUserInfoLocation, kUserInfoInstruments,
  kUserInfoSkills, kUserInfoGenre, kUserInfoAbout, kUserInfoBand
}
 user infos More...
 
enum  {
  kLoginNotAuthorized = 1, kLoginNoUserNameOrPassword, kLoginWrongUserNameOrPassword, kLoginNoConnection,
  kLoginNetworkError, kLoginFails, kLoginInternalError, kLoginProtocolError,
  kLoginSSLError, kFileSendError = 1000, kFileReceiveError
}
 Error codes.
 

Public Member Functions

 MooUser ()
 MooUser manages the local user only.
 
virtual mooInt signIn (const mooChar *username, const mooChar *password)=0
 
virtual mooInt logIn (const mooChar *username, const mooChar *password)=0
 
virtual mooBool isLoggedIn ()=0
 
virtual void logOut ()=0
 
virtual mooUInt getID ()=0
 
virtual const mooChargetUserName ()=0
 
virtual const mooCharerrorToString (mooInt errorCode)=0
 
virtual void setCallback (mooUserCallback callback, void *reference)=0
 
virtual mooBool sendUserPictureFile (const mooChar *localPath)=0
 
virtual const mooChargetUserPictureFile ()=0
 obtain this user's picture, zero if none found
 
virtual mooBool sendUserAudioFile (const mooChar *localPath)=0
 
virtual const mooChargetUserAudioFile ()=0
 obtain this user's audio file, zero if none found
 
virtual const mooChargetInfo (mooUserInfoType which)=0
 obtain this user's info as per type, null if none given
 
virtual mooBool setInfo (mooUserInfoType which, const mooChar *info)=0
 

Detailed Description

the current application User


MooUser

Member Enumeration Documentation

◆ mooUserInfoType

user infos

get and set general information for this user (optional). user infos are just strings describing various properties of the user. info types

Member Function Documentation

◆ errorToString()

virtual const mooChar* MooUser::errorToString ( mooInt  errorCode)
pure virtual

get

Parameters
errorCodeas text provides a readable error description for the passed errorCode

◆ getID()

virtual mooUInt MooUser::getID ( )
pure virtual

get the currently logged in user ID. negative or zero are invalid IDs. IDs are important throughout the entire Moo SDK and are always unique.

◆ getUserName()

virtual const mooChar* MooUser::getUserName ( )
pure virtual

get moo user name obtain the users name,

Returns
NULL when not logged in

◆ isLoggedIn()

virtual mooBool MooUser::isLoggedIn ( )
pure virtual

Get logged in state returns

Returns
true when user is logged in,
false otherwise

◆ logIn()

virtual mooInt MooUser::logIn ( const mooChar username,
const mooChar password 
)
pure virtual

Login with

Parameters
usernameand
password.Check return code for errors
usernamemust be all lower case and not exceed 80 characters.
passwordmust not exceed 80 characters and may contain any ascii character except the escape character ("\")

◆ logOut()

virtual void MooUser::logOut ( )
pure virtual

Logout. Also automatically called when Moo is destroyed All actions are ignored and return an error when the user is not logged in with the exception of signIn

◆ sendUserAudioFile()

virtual mooBool MooUser::sendUserAudioFile ( const mooChar localPath)
pure virtual

send an audio file (demo) for this user all moo audio files are wav or flac. This audio file must not exceed 5 MB in file size the provided file will be copied to the Moo user folder. If it already exists and not changed, nothing happens note that all file transfer actions are asynchronous. If the file doesn't exist or is otherwise inaccessible, false is returned; however a return value of true does not indicate a successful transfer yet. When a transfer has finished (successfully or not), your mooUserCallback (if provided) is invoked with operation code kMooUserCallbackWriteFileFinished

◆ sendUserPictureFile()

virtual mooBool MooUser::sendUserPictureFile ( const mooChar localPath)
pure virtual

send a picture for this user. user must be logged in. this can be jpg or png and must not exceed 5 MB in file size the provided file will be copied to the Moo user folder. If it already exists and has not changed, nothing happens note that all file transfer actions are asynchronous. If the file doesn't exist or is otherwise inaccessible, false is returned; however a return value of true does not indicate a successful transfer yet. When a transfer has finished (successfully or not), your mooUserCallback (if provided) is invoked with operation code kMooUserCallbackWriteFileFinished

◆ setCallback()

virtual void MooUser::setCallback ( mooUserCallback  callback,
void *  reference 
)
pure virtual

set your

Parameters
callback.the
referenceparameter passed to setCallback is passed to the callback for your own use, Moo does not touch this.

◆ setInfo()

virtual mooBool MooUser::setInfo ( mooUserInfoType  which,
const mooChar info 
)
pure virtual

set this user's info Note that none of these strings must contain any of the following characters: <, >, {, }, &, and @ also the respective length is restricted to a maximum of 80 characters each.

◆ signIn()

virtual mooInt MooUser::signIn ( const mooChar username,
const mooChar password 
)
pure virtual

Sign in with

Parameters
usernameand
password.Check return code for errors
usernamemust be all lower case and not exceed 80 characters. Upper case chars will be replaced with lower case.
passwordmust not exceed 80 characters and may contain any ascii character except the escape character ("\")

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