kpilot Library API Documentation

pilotUser.h

00001 #ifndef _KPILOT_PILOTUSER_H 00002 #define _KPILOT_PILOTUSER_H 00003 /* pilotUser.h KPilot 00004 ** 00005 ** Copyright (C) 1998-2001 by Dan Pilone 00006 ** 00007 ** See the .cc file for an explanation of what this file is for. 00008 */ 00009 00010 /* 00011 ** This program is free software; you can redistribute it and/or modify 00012 ** it under the terms of the GNU Lesser General Public License as published by 00013 ** the Free Software Foundation; either version 2.1 of the License, or 00014 ** (at your option) any later version. 00015 ** 00016 ** This program is distributed in the hope that it will be useful, 00017 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 ** GNU Lesser General Public License for more details. 00020 ** 00021 ** You should have received a copy of the GNU Lesser General Public License 00022 ** along with this program in a file called COPYING; if not, write to 00023 ** the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 00024 ** MA 02111-1307, USA. 00025 */ 00026 00027 /* 00028 ** Bug reports and questions can be sent to kde-pim@kde.org 00029 */ 00030 00031 #include <stdlib.h> 00032 #include <string.h> 00033 #include <time.h> 00034 00035 #ifndef _PILOT_DLP_H_ 00036 #include <pi-dlp.h> 00037 #endif 00038 00039 class KPilotUser 00040 { 00041 public: 00042 KPilotUser() { ::memset(&fUser,0,sizeof(struct PilotUser)); } 00043 KPilotUser(const PilotUser* user) { fUser = *user; } 00044 00045 PilotUser *pilotUser() { return &fUser; } 00046 00051 void boundsCheck() 00052 { 00053 } 00054 00055 const char* getUserName() const { return fUser.username; } 00056 void setUserName(const char* name) 00057 { 00058 ::strncpy(fUser.username, name,sizeof(fUser.username)-1); 00059 boundsCheck(); 00060 } 00061 00062 const int getPasswordLength() const { return fUser.passwordLength; } 00063 const char* getPassword() const { return fUser.password; } 00064 void setPassword(char* password) 00065 { 00066 ::memset(&fUser.password, 0, sizeof(fUser.password)); 00067 ::strncpy(fUser.password, password,sizeof(fUser.password)-1); 00068 boundsCheck(); 00069 fUser.passwordLength = ::strlen(fUser.password); 00070 } 00071 00072 unsigned long getUserID() const { return fUser.userID; } 00073 unsigned long getViewerID() const { return fUser.viewerID; } 00074 00075 unsigned long getLastSyncPC() const { return fUser.lastSyncPC; } 00076 void setLastSyncPC(unsigned long pc) { fUser.lastSyncPC = pc; } 00077 00078 time_t getLastSuccessfulSyncDate() { return fUser.successfulSyncDate; } 00079 void setLastSuccessfulSyncDate(time_t when) 00080 { fUser.successfulSyncDate = when; } 00081 00082 time_t getLastSyncDate() { return fUser.lastSyncDate; } 00083 void setLastSyncDate(time_t when) { fUser.lastSyncDate = when; } 00084 00085 private: 00086 struct PilotUser fUser; 00087 }; 00088 00089 #endif
KDE Logo
This file is part of the documentation for kpilot Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jul 28 23:57:49 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003