Frameworks/libpurple.framework/Versions/2.10.12r8d2874a79747/Headers/userlist.h
branchadium-1.5.11
changeset 6014 fcb71cb71a3d
parent 5941 307f53385811
parent 6013 f8d0dc659e3f
child 6016 325e2ab3406f
equal deleted inserted replaced
5941:307f53385811 6014:fcb71cb71a3d
     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 typedef enum
       
    30 {
       
    31 	MSN_LIST_FL, /**< Forward list */
       
    32 	MSN_LIST_AL, /**< Allow list */
       
    33 	MSN_LIST_BL, /**< Block list */
       
    34 	MSN_LIST_RL, /**< Reverse list */
       
    35 	MSN_LIST_PL  /**< Pending list */
       
    36 } MsnListId;
       
    37 
       
    38 typedef enum
       
    39 {
       
    40 	MSN_LIST_FL_OP = 0x01,
       
    41 	MSN_LIST_AL_OP = 0x02,
       
    42 	MSN_LIST_BL_OP = 0x04,
       
    43 	MSN_LIST_RL_OP = 0x08,
       
    44 	MSN_LIST_PL_OP = 0x10
       
    45 } MsnListOp;
       
    46 #define MSN_LIST_OP_MASK	0x07
       
    47 
       
    48 #include "group.h"
       
    49 #include "msn.h"
       
    50 #include "user.h"
       
    51 
       
    52 struct _MsnUserList
       
    53 {
       
    54 	MsnSession *session;
       
    55 
       
    56 	GList *users; /* Contains MsnUsers */
       
    57 	GList *groups; /* Contains MsnGroups */
       
    58 
       
    59 	GQueue *buddy_icon_requests;
       
    60 	int buddy_icon_window;
       
    61 	guint buddy_icon_request_timer;
       
    62 
       
    63 };
       
    64 
       
    65 void msn_got_lst_user(MsnSession *session, MsnUser *user,
       
    66 					  MsnListOp list_op, GSList *group_ids);
       
    67 
       
    68 MsnUserList *msn_userlist_new(MsnSession *session);
       
    69 void msn_userlist_destroy(MsnUserList *userlist);
       
    70 
       
    71 void msn_userlist_add_user(MsnUserList *userlist, MsnUser *user);
       
    72 void msn_userlist_remove_user(MsnUserList *userlist, MsnUser *user);
       
    73 
       
    74 MsnUser * msn_userlist_find_user(MsnUserList *userlist, const char *passport);
       
    75 MsnUser * msn_userlist_find_add_user(MsnUserList *userlist,
       
    76 				const char *passport, const char *friendly_name);
       
    77 MsnUser * msn_userlist_find_user_with_id(MsnUserList *userlist, const char *uid);
       
    78 MsnUser * msn_userlist_find_user_with_mobile_phone(MsnUserList *userlist, const char *number);
       
    79 
       
    80 void msn_userlist_add_group(MsnUserList *userlist, MsnGroup *group);
       
    81 void msn_userlist_remove_group(MsnUserList *userlist, MsnGroup *group);
       
    82 MsnGroup *msn_userlist_find_group_with_id(MsnUserList *userlist, const char *id);
       
    83 MsnGroup *msn_userlist_find_group_with_name(MsnUserList *userlist, const char *name);
       
    84 const char * msn_userlist_find_group_id(MsnUserList *userlist,
       
    85 					const char *group_name);
       
    86 const char *msn_userlist_find_group_name(MsnUserList *userlist, const char *group_id);
       
    87 void msn_userlist_rename_group_id(MsnUserList *userlist, const char *group_id,
       
    88 				  const char *new_name);
       
    89 void msn_userlist_remove_group_id(MsnUserList *userlist, const char *group_id);
       
    90 
       
    91 void msn_userlist_rem_buddy(MsnUserList *userlist, const char *who);
       
    92 void msn_userlist_add_buddy(MsnUserList *userlist,
       
    93 			    const char *who, const char *group_name);
       
    94 void msn_userlist_move_buddy(MsnUserList *userlist, const char *who,
       
    95 						    const char *old_group_name,
       
    96 						    const char *new_group_name);
       
    97 
       
    98 gboolean msn_userlist_add_buddy_to_group(MsnUserList *userlist, const char *who,
       
    99 					 const char *group_name);
       
   100 gboolean msn_userlist_rem_buddy_from_group(MsnUserList *userlist,
       
   101 					   const char *who,
       
   102 					   const char *group_name);
       
   103 
       
   104 void msn_userlist_add_buddy_to_list(MsnUserList *userlist, const char *who,
       
   105 				    MsnListId list_id);
       
   106 void msn_userlist_rem_buddy_from_list(MsnUserList *userlist, const char *who,
       
   107 				      MsnListId list_id);
       
   108 void msn_release_buddy_icon_request(MsnUserList *userlist);
       
   109 
       
   110 void msn_userlist_load(MsnSession *session);
       
   111 
       
   112 #endif /* MSN_USERLIST_H */