00001 #ifndef __msn_buddy_h__
00002 #define __msn_buddy_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 #include <string>
00027 #include <list>
00028 #include <msn/passport.h>
00029
00030 namespace MSN
00031 {
00035 enum BuddyStatus
00036 {
00037 STATUS_AVAILABLE,
00038 STATUS_BUSY,
00039 STATUS_IDLE,
00040 STATUS_BERIGHTBACK,
00041 STATUS_AWAY,
00042 STATUS_ONTHEPHONE,
00043 STATUS_OUTTOLUNCH,
00044 STATUS_INVISIBLE
00045 };
00046
00047 std::string buddyStatusToString(BuddyStatus s);
00048 BuddyStatus buddyStatusFromString(std::string s);
00049
00050 class Group;
00051
00062 class Buddy
00063 {
00065 public:
00069 class PhoneNumber
00070 {
00071 public:
00077 std::string title;
00078
00080 std::string number;
00081
00083 bool enabled;
00084
00085 PhoneNumber(std::string title_, std::string number_, bool enabled_=true)
00086 : title(title_), number(number_), enabled(enabled_) {};
00087 };
00088
00090 Passport userName;
00091
00093 std::string friendlyName;
00094
00096 std::list<Buddy::PhoneNumber> phoneNumbers;
00097
00099 std::list<Group *> groups;
00100
00101 Buddy(Passport userName_, std::string friendlyName_) :
00102 userName(userName_), friendlyName(friendlyName_) {};
00103 bool const operator==(const Buddy &other) { return userName == other.userName; }
00104 };
00105
00111 class Group
00112 {
00113 public:
00114 int groupID;
00115 std::string name;
00116 std::list<Buddy *> buddies;
00117
00118 Group(int groupID_, std::string name_)
00119 : groupID(groupID_), name(name_) {};
00120
00121 Group() : groupID(-1), name("INVALID") {};
00122 };
00123 }
00124
00125 #endif