kpilot/lib
pilotUser.h00001 #ifndef _KPILOT_PILOTUSER_H
00002 #define _KPILOT_PILOTUSER_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #include <stdlib.h>
00033 #include <string.h>
00034 #include <time.h>
00035
00036 #include <pi-dlp.h>
00037
00038 #include "pilot.h"
00039
00040 class KPilotUser
00041 {
00042 public:
00044 KPilotUser()
00045 {
00046 ::memset(&fUser,0,sizeof(struct PilotUser));
00047 }
00051 KPilotUser(const PilotUser *user)
00052 {
00053 fUser = *user;
00054 }
00055
00057 PilotUser *pilotUser()
00058 {
00059 return &fUser;
00060 }
00061
00063 const char* getUserName() const
00064 {
00065 return fUser.username;
00066 }
00070 void setUserName( const QString &name)
00071 {
00072 Pilot::toPilot( name, fUser.username, sizeof(fUser.username) );
00073 }
00074
00078 const int getPasswordLength() const
00079 {
00080 return fUser.passwordLength;
00081 }
00083 const char* getPassword() const
00084 {
00085 return fUser.password;
00086 }
00090 void setPassword( const QString &password )
00091 {
00092 Pilot::toPilot( password, fUser.password, sizeof(fUser.password) );
00093 }
00094
00099 unsigned long getUserID() const
00100 {
00101 return fUser.userID;
00102 }
00107 unsigned long getViewerID() const
00108 {
00109 return fUser.viewerID;
00110 }
00111
00116 unsigned long getLastSyncPC() const
00117 {
00118 return fUser.lastSyncPC;
00119 }
00124 void setLastSyncPC(unsigned long pc)
00125 {
00126 fUser.lastSyncPC = pc;
00127 }
00128
00132 time_t getLastSuccessfulSyncDate()
00133 {
00134 return fUser.successfulSyncDate;
00135 }
00137 void setLastSuccessfulSyncDate(time_t when)
00138 {
00139 fUser.successfulSyncDate = when;
00140 }
00141
00143 time_t getLastSyncDate()
00144 {
00145 return fUser.lastSyncDate;
00146 }
00148 void setLastSyncDate(time_t when)
00149 {
00150 fUser.lastSyncDate = when;
00151 }
00152
00153 private:
00154 struct PilotUser fUser;
00155 };
00156
00157 #endif
|