Frameworks/libpurple.framework/Versions/0.6.2/Headers/userlist.h
author Zachary West <zacw@adium.im>
Fri Aug 21 13:25:11 2009 -0700 (2009-08-21)
changeset 2592 e8d15275025e
parent 2489 Frameworks/libpurple.framework/Versions/0.6.0/Headers/userlist.h@56d91bf40dd8
permissions -rw-r--r--
im.pidgin.adium.1-4 at 267c6165e02e34318a1823960bd04c0639952f73
     1 /**
     2  * @file userlist.h MSN user list support
     3  *
     4  * purple
     5  *
     6  * Purple is the legal property of its developers, whose names are too numerous
     7  * to list here.  Please refer to the COPYRIGHT file distributed with this
     8  * source distribution.
     9  *
    10  * This program is free software; you can redistribute it and/or modify
    11  * it under the terms of the GNU General Public License as published by
    12  * the Free Software Foundation; either version 2 of the License, or
    13  * (at your option) any later version.
    14  *
    15  * This program is distributed in the hope that it will be useful,
    16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    18  * GNU General Public License for more details.
    19  *
    20  * You should have received a copy of the GNU General Public License
    21  * along with this program; if not, write to the Free Software
    22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
    23  */
    24 #ifndef _MSN_USERLIST_H_
    25 #define _MSN_USERLIST_H_
    26 
    27 typedef struct _MsnUserList MsnUserList;
    28 
    29 #include "user.h"
    30 #include "group.h"
    31 
    32 typedef enum
    33 {
    34 	MSN_LIST_FL,
    35 	MSN_LIST_AL,
    36 	MSN_LIST_BL,
    37 	MSN_LIST_RL,
    38 	MSN_LIST_PL
    39 
    40 } MsnListId;
    41 
    42 
    43 struct _MsnUserList
    44 {
    45 	MsnSession *session;
    46 
    47 	GList *users; /* Contains MsnUsers */
    48 	GList *groups; /* Contains MsnGroups */
    49 
    50 	GQueue *buddy_icon_requests;
    51 	int buddy_icon_window;
    52 	guint buddy_icon_request_timer;
    53 
    54 };
    55 
    56 gboolean msn_userlist_user_is_in_group(MsnUser *user, const char * group_id);
    57 gboolean msn_userlist_user_is_in_list(MsnUser *user, MsnListId list_id);
    58 
    59 void msn_got_lst_user(MsnSession *session, MsnUser *user,
    60 					  int list_op, GSList *group_ids);
    61 
    62 MsnUserList *msn_userlist_new(MsnSession *session);
    63 void msn_userlist_destroy(MsnUserList *userlist);
    64 
    65 void msn_userlist_add_user(MsnUserList *userlist, MsnUser *user);
    66 void msn_userlist_remove_user(MsnUserList *userlist, MsnUser *user);
    67 
    68 MsnUser * msn_userlist_find_user(MsnUserList *userlist, const char *passport);
    69 MsnUser * msn_userlist_find_add_user(MsnUserList *userlist,
    70 				const char *passport, const char *userName);
    71 MsnUser * msn_userlist_find_user_with_id(MsnUserList *userlist, const char *uid);
    72 MsnUser * msn_userlist_find_user_with_mobile_phone(MsnUserList *userlist, const char *number);
    73 
    74 void msn_userlist_add_group(MsnUserList *userlist, MsnGroup *group);
    75 void msn_userlist_remove_group(MsnUserList *userlist, MsnGroup *group);
    76 MsnGroup *msn_userlist_find_group_with_id(MsnUserList *userlist, const char *id);
    77 MsnGroup *msn_userlist_find_group_with_name(MsnUserList *userlist, const char *name);
    78 const char * msn_userlist_find_group_id(MsnUserList *userlist,
    79 					const char *group_name);
    80 const char *msn_userlist_find_group_name(MsnUserList *userlist, const char *group_id);
    81 void msn_userlist_rename_group_id(MsnUserList *userlist, const char *group_id,
    82 				  const char *new_name);
    83 void msn_userlist_remove_group_id(MsnUserList *userlist, const char *group_id);
    84 
    85 void msn_userlist_rem_buddy(MsnUserList *userlist, const char *who);
    86 void msn_userlist_add_buddy(MsnUserList *userlist,
    87 			    const char *who, const char *group_name);
    88 void msn_userlist_move_buddy(MsnUserList *userlist, const char *who,
    89 						    const char *old_group_name,
    90 						    const char *new_group_name);
    91 
    92 gboolean msn_userlist_add_buddy_to_group(MsnUserList *userlist, const char *who,
    93 					 const char *group_name);
    94 gboolean msn_userlist_rem_buddy_from_group(MsnUserList *userlist,
    95 					   const char *who,
    96 					   const char *group_name);
    97 
    98 void msn_userlist_add_buddy_to_list(MsnUserList *userlist, const char *who,
    99 				    MsnListId list_id);
   100 void msn_userlist_rem_buddy_from_list(MsnUserList *userlist, const char *who,
   101 				      MsnListId list_id);
   102 
   103 void msn_userlist_load(MsnSession *session);
   104 
   105 #endif /* _MSN_USERLIST_H_ */