Moo
moouser.h
Go to the documentation of this file.
1 
4 
5 #ifndef __moouser__
6 #define __moouser__
7 
8 #include "mooplatform.h"
9 
10 //-----------------------------------------------------------------------------
12 class MooUser;
13 
14 //-----------------------------------------------------------------------------
25 typedef void (*mooUserCallback) (MooUser* user, mooInt operation, mooInt result, const mooChar* path, void* refence);
26 
31 
32 //-----------------------------------------------------------------------------
33 class MooUser
34 {
35 public:
37  MooUser () {}
38  virtual ~MooUser () {}
39 
43  virtual mooInt signIn (const mooChar* username, const mooChar* password) = 0;
44 
48  virtual mooInt logIn (const mooChar* username, const mooChar* password) = 0;
51  virtual mooBool isLoggedIn () = 0;
52 
56  virtual void logOut () = 0;
57 
60  virtual mooUInt getID () = 0;
61 
64  virtual const mooChar* getUserName () = 0;
65 
68  virtual const mooChar* errorToString (mooInt errorCode) = 0;
69 
72  virtual void setCallback (mooUserCallback callback, void* reference) = 0;
73 
75  enum
76  {
77  kFileSendFinished = 1000
78  };
79 
86  virtual mooBool sendUserPictureFile (const mooChar* localPath) = 0;
88  virtual const mooChar* getUserPictureFile () = 0;
89 
96  virtual mooBool sendUserAudioFile (const mooChar* localPath) = 0;
98  virtual const mooChar* getUserAudioFile () = 0;
99 
101 
104 
107  {
108  kUserInfoInvalid = 0,
109  kUserInfoLanguage,
110  kUserInfoLocation,
111  kUserInfoInstruments,
112  kUserInfoSkills,
113  kUserInfoGenre,
114  kUserInfoAbout,
115  kUserInfoBand
116  };
117 
119  virtual const mooChar* getInfo (mooUserInfoType which) = 0;
120 
125  virtual mooBool setInfo (mooUserInfoType which, const mooChar* info) = 0;
126 
127  //-----------------------------------------------------------------------------
129  enum
130  {
131  kLoginNotAuthorized = 1,
132  kLoginNoUserNameOrPassword,
133  kLoginWrongUserNameOrPassword,
134  kLoginNoConnection,
135  kLoginNetworkError,
136  kLoginFails,
137  kLoginInternalError,
138  kLoginProtocolError,
139  kLoginSSLError,
140 
141  kFileSendError = 1000,
142  kFileReceiveError
143  };
144 };
145 
146 #endif
virtual const mooChar * getUserAudioFile()=0
obtain this user's audio file, zero if none found
unsigned short mooChar
Definition: mooplatform.h:35
mooUserInfoType
user infos
Definition: moouser.h:106
virtual const mooChar * errorToString(mooInt errorCode)=0
virtual void setCallback(mooUserCallback callback, void *reference)=0
virtual mooBool setInfo(mooUserInfoType which, const mooChar *info)=0
virtual mooBool sendUserPictureFile(const mooChar *localPath)=0
__int64 mooInt
All signed ints are 64 bit wide.
Definition: mooplatform.h:41
virtual void logOut()=0
unsigned __int64 mooUInt
All unsigned ints are 64 bit wide.
Definition: mooplatform.h:50
virtual mooUInt getID()=0
bool mooBool
just a bool
Definition: mooplatform.h:63
virtual mooInt logIn(const mooChar *username, const mooChar *password)=0
virtual mooBool isLoggedIn()=0
void(* mooUserCallback)(MooUser *user, mooInt operation, mooInt result, const mooChar *path, void *refence)
callback function most Moo functions are asynchronous and will not return a result immediately...
Definition: moouser.h:25
virtual const mooChar * getUserName()=0
virtual const mooChar * getInfo(mooUserInfoType which)=0
obtain this user's info as per type, null if none given
virtual mooInt signIn(const mooChar *username, const mooChar *password)=0
virtual mooBool sendUserAudioFile(const mooChar *localPath)=0
virtual const mooChar * getUserPictureFile()=0
obtain this user's picture, zero if none found
the current application User
Definition: moouser.h:33
MooUser()
MooUser manages the local user only.
Definition: moouser.h:37