1 #ifndef __msn_buddy_h__
2 #define __msn_buddy_h__
8 * Created by Mark Rowe on Mon Apr 19 2004.
9 * Copyright (c) 2004 Mark Rowe. All rights reserved.
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #include <msn/passport.h>
32 /** The online state of a buddy.
47 std::string
buddyStatusToString(BuddyStatus s
);
48 BuddyStatus
buddyStatusFromString(std::string s
);
52 /** The Buddy class contains information about a member of a buddy list.
54 * Each Buddy is made up of their passport address (@a userName),
55 * user-visible display name (@a friendlyName), zero or more @a phoneNumbers,
56 * and zero or more @a groups on the buddy list that they belong to.
58 * It is only currently used during MSN::ext::gotBuddyListInfo to
59 * store contact information about a buddy that was retrieved during
60 * the buddy list synchronisation process.
64 /** @todo BPR's need to be handled at any time, not just when syncing. */
66 /** The PhoneNumber class contains information about a single phone number
67 * that is retrieved during the buddy list synchronisation process.
72 /** The name of this phone number.
74 * @todo Should this be an enumeration containing the possible
75 * types of phone number?
79 /** The phone number */
82 /** @todo Document me! */
85 PhoneNumber(std::string title_
, std::string number_
, bool enabled_
=true)
86 : title(title_
), number(number_
), enabled(enabled_
) {};
89 /** Their passport address */
92 /** Their friendly name */
93 std::string friendlyName
;
95 /** A list of phone numbers related to this buddy */
96 std::list
<Buddy::PhoneNumber
> phoneNumbers
;
98 /** A list of Group's that this buddy is a member of */
99 std::list
<Group
*> groups
;
101 Buddy(Passport userName_
, std::string friendlyName_
) :
102 userName(userName_
), friendlyName(friendlyName_
) {};
103 bool const operator==(const Buddy
&other
) { return userName
== other
.userName
; }
106 /** The Group class represents a group of contacts on the buddy list.
108 * Each group is represented by a @a groupID and has a user-visible
116 std::list
<Buddy
*> buddies
;
118 Group(int groupID_
, std::string name_
)
119 : groupID(groupID_
), name(name_
) {};
121 Group() : groupID(-1), name("INVALID") {};