Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

buddy.h

Go to the documentation of this file.
00001 #ifndef __msn_buddy_h__
00002 #define __msn_buddy_h__
00003 
00004 /*
00005  * buddy.h
00006  * libmsn
00007  *
00008  * Created by Mark Rowe on Mon Apr 19 2004.
00009  * Copyright (c) 2004 Mark Rowe. All rights reserved.
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 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 General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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

Generated on Sun Feb 6 19:59:40 2005 for libmsn by  doxygen 1.4.1