00001 /*************************************************************************** 00002 contact.h - description 00003 ------------------- 00004 begin : mer mar 22 2006 00005 copyright : (C) 2006 by 00006 - Sylvain Archenault <sylvain.archenault@laposte.net> 00007 - Yves Houpert <yves.houpert@insa-rouen.fr> 00008 ***************************************************************************/ 00009 00010 /*************************************************************************** 00011 * * 00012 * This program is free software; you can redistribute it and/or modify * 00013 * it under the terms of the GNU General Public License as published by * 00014 * the Free Software Foundation; either version 2 of the License, or * 00015 * (at your option) any later version. * 00016 * * 00017 ***************************************************************************/ 00018 #ifndef CONTACT_H 00019 #define CONTACT_H 00020 #include <string> 00021 00027 class Contact 00028 { 00029 public: 00030 00032 enum Status {Offline, 00033 Online, 00034 Busy, 00035 Away 00036 }; 00037 00039 Contact(); 00040 00046 Contact(int ID,const std::string& address,const std::string& pseudo, const Status status); 00047 00049 ~Contact(); 00050 00055 const std::string& getAdresse() const { return m_sAdresse; } 00056 00059 void setAdresse(const std::string& address) { m_sAdresse = address; } 00060 00064 void setID(const int iID) { m_iID = iID; } 00065 00068 int getID() const { return m_iID; } 00069 00072 const std::string& getPseudo() const { return m_sPseudo; } 00073 00076 void setPseudo(const std::string& pseudo ) { m_sPseudo = pseudo; } 00077 00080 const Status getStatus() const { return m_Status; } 00081 00084 void setStatus(const Status status) { m_Status = status; } 00085 00090 std::string toString() const; 00091 00096 static Status getStatus(const int statusID); 00097 00102 static std::string getStatusAsString(const Status status); 00103 00109 bool operator==(const Contact& contact) const; 00110 00116 bool operator>=(const Contact& contact) const; 00117 00123 bool operator>(const Contact& contact) const; 00124 00130 bool operator<(const Contact& contact) const; 00131 00137 bool operator<=(const Contact& contact) const; 00138 00139 private: //private members 00141 int m_iID; 00142 00144 std::string m_sAdresse; 00145 00147 std::string m_sPseudo; 00148 00150 Status m_Status; 00151 00152 public : //public members 00154 static const char* ROOT_NODE; 00156 static const char* CONTACTID_NODE; 00158 static const char* USERNAME_NODE; 00160 static const char* ADDRESS_NODE; 00162 static const char* STATE_NODE; 00163 00164 }; 00165 00166 #endif
1.4.6