1.1 --- a/Frameworks/libpurple.framework/Versions/0.5.6/Headers/user.h Sun Jun 21 22:04:11 2009 -0400
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,393 +0,0 @@
1.4 -/**
1.5 - * @file user.h User functions
1.6 - *
1.7 - * purple
1.8 - *
1.9 - * Purple is the legal property of its developers, whose names are too numerous
1.10 - * to list here. Please refer to the COPYRIGHT file distributed with this
1.11 - * source distribution.
1.12 - *
1.13 - * This program is free software; you can redistribute it and/or modify
1.14 - * it under the terms of the GNU General Public License as published by
1.15 - * the Free Software Foundation; either version 2 of the License, or
1.16 - * (at your option) any later version.
1.17 - *
1.18 - * This program is distributed in the hope that it will be useful,
1.19 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.20 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.21 - * GNU General Public License for more details.
1.22 - *
1.23 - * You should have received a copy of the GNU General Public License
1.24 - * along with this program; if not, write to the Free Software
1.25 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
1.26 - */
1.27 -#ifndef _MSN_USER_H_
1.28 -#define _MSN_USER_H_
1.29 -
1.30 -typedef struct _MsnUser MsnUser;
1.31 -
1.32 -#include "session.h"
1.33 -#include "object.h"
1.34 -
1.35 -#include "userlist.h"
1.36 -
1.37 -typedef enum
1.38 -{
1.39 - MSN_NETWORK_UNKNOWN = 0x00,
1.40 - MSN_NETWORK_PASSPORT = 0x01,
1.41 - MSN_NETWORK_COMMUNICATOR = 0x02,
1.42 - MSN_NETWORK_MOBILE = 0x04,
1.43 - MSN_NETWORK_MNI = 0x08,
1.44 - MSN_NETWORK_SMTP = 0x10,
1.45 - MSN_NETWORK_YAHOO = 0x20
1.46 -} MsnNetwork;
1.47 -
1.48 -/**
1.49 - * Current media.
1.50 - */
1.51 -typedef enum
1.52 -{
1.53 - CURRENT_MEDIA_UNKNOWN,
1.54 - CURRENT_MEDIA_MUSIC,
1.55 - CURRENT_MEDIA_GAMES,
1.56 - CURRENT_MEDIA_OFFICE
1.57 -} CurrentMediaType;
1.58 -
1.59 -typedef struct _CurrentMedia
1.60 -{
1.61 - CurrentMediaType type; /**< Type. */
1.62 - char *title; /**< Title. */
1.63 - char *artist; /**< Artist. */
1.64 - char *album; /**< Album. */
1.65 -} CurrentMedia;
1.66 -
1.67 -/**
1.68 - * A user.
1.69 - */
1.70 -struct _MsnUser
1.71 -{
1.72 - MsnUserList *userlist;
1.73 -
1.74 - char *passport; /**< The passport account. */
1.75 - char *friendly_name; /**< The friendly name. */
1.76 -
1.77 - char * uid; /*< User Id */
1.78 -
1.79 - const char *status; /**< The state of the user. */
1.80 - char *statusline; /**< The state of the user. */
1.81 - CurrentMedia media; /**< Current media of the user. */
1.82 -
1.83 - gboolean idle; /**< The idle state of the user. */
1.84 -
1.85 - struct
1.86 - {
1.87 - char *home; /**< Home phone number. */
1.88 - char *work; /**< Work phone number. */
1.89 - char *mobile; /**< Mobile phone number. */
1.90 -
1.91 - } phone;
1.92 -
1.93 - gboolean authorized; /**< Authorized to add this user. */
1.94 - gboolean mobile; /**< Signed up with MSN Mobile. */
1.95 -
1.96 - GList *group_ids; /**< The group IDs. */
1.97 - char *pending_group; /**< A pending group to add. */
1.98 -
1.99 - MsnObject *msnobj; /**< The user's MSN Object. */
1.100 -
1.101 - GHashTable *clientcaps; /**< The client's capabilities. */
1.102 -
1.103 - guint clientid; /**< The client's ID */
1.104 -
1.105 - MsnNetwork networkid; /**< The user's network */
1.106 -
1.107 - int list_op; /**< Which lists the user is in */
1.108 -
1.109 - guint membership_id[5]; /**< The membershipId sent by the contacts server,
1.110 - indexed by the list it belongs to */
1.111 -};
1.112 -
1.113 -/**************************************************************************
1.114 - ** @name User API *
1.115 - **************************************************************************/
1.116 -/*@{*/
1.117 -
1.118 -/**
1.119 - * Creates a new user structure.
1.120 - *
1.121 - * @param session The MSN session.
1.122 - * @param passport The initial passport.
1.123 - * @param stored_name The initial stored name.
1.124 - *
1.125 - * @return A new user structure.
1.126 - */
1.127 -MsnUser *msn_user_new(MsnUserList *userlist, const char *passport,
1.128 - const char *friendly_name);
1.129 -
1.130 -/**
1.131 - * Destroys a user structure.
1.132 - *
1.133 - * @param user The user to destroy.
1.134 - */
1.135 -void msn_user_destroy(MsnUser *user);
1.136 -
1.137 -
1.138 -/**
1.139 - * Updates the user.
1.140 - *
1.141 - * Communicates with the core to update the ui, etc.
1.142 - *
1.143 - * @param user The user to update.
1.144 - */
1.145 -void msn_user_update(MsnUser *user);
1.146 -
1.147 - /**
1.148 - * Sets the new statusline of user.
1.149 - *
1.150 - * @param user The user.
1.151 - * @param state The statusline string.
1.152 - */
1.153 -void msn_user_set_statusline(MsnUser *user, const char *statusline);
1.154 -
1.155 - /**
1.156 - * Sets the current media of user.
1.157 - *
1.158 - * @param user The user.
1.159 - * @param cmedia Current media.
1.160 - */
1.161 -void msn_user_set_currentmedia(MsnUser *user, const CurrentMedia *cmedia);
1.162 -
1.163 -/**
1.164 - * Sets the new state of user.
1.165 - *
1.166 - * @param user The user.
1.167 - * @param state The state string.
1.168 - */
1.169 -void msn_user_set_state(MsnUser *user, const char *state);
1.170 -
1.171 -/**
1.172 - * Sets the passport account for a user.
1.173 - *
1.174 - * @param user The user.
1.175 - * @param passport The passport account.
1.176 - */
1.177 -void msn_user_set_passport(MsnUser *user, const char *passport);
1.178 -
1.179 -/**
1.180 - * Sets the friendly name for a user.
1.181 - *
1.182 - * @param user The user.
1.183 - * @param name The friendly name.
1.184 - *
1.185 - * @returns TRUE is name actually changed, FALSE otherwise.
1.186 - */
1.187 -gboolean msn_user_set_friendly_name(MsnUser *user, const char *name);
1.188 -
1.189 -/**
1.190 - * Sets the buddy icon for a local user.
1.191 - *
1.192 - * @param user The user.
1.193 - * @param img The buddy icon image
1.194 - */
1.195 -void msn_user_set_buddy_icon(MsnUser *user, PurpleStoredImage *img);
1.196 -
1.197 -/**
1.198 - * Sets the group ID list for a user.
1.199 - *
1.200 - * @param user The user.
1.201 - * @param ids The group ID list.
1.202 - */
1.203 -void msn_user_set_group_ids(MsnUser *user, GList *ids);
1.204 -
1.205 -/**
1.206 - * Adds the group ID for a user.
1.207 - *
1.208 - * @param user The user.
1.209 - * @param id The group ID.
1.210 - */
1.211 -void msn_user_add_group_id(MsnUser *user, const char * id);
1.212 -
1.213 -/**
1.214 - * Removes the group ID from a user.
1.215 - *
1.216 - * @param user The user.
1.217 - * @param id The group ID.
1.218 - */
1.219 -void msn_user_remove_group_id(MsnUser *user, const char * id);
1.220 -
1.221 -/**
1.222 - * Sets the pending group for a user.
1.223 - *
1.224 - * @param user The user.
1.225 - * @param group The group name.
1.226 - */
1.227 -void msn_user_set_pending_group(MsnUser *user, const char *group);
1.228 -
1.229 -/**
1.230 - * Removes the pending group from a user.
1.231 - *
1.232 - * @param user The user.
1.233 - *
1.234 - * @return Returns the pending group name.
1.235 - */
1.236 -char *msn_user_remove_pending_group(MsnUser *user);
1.237 -
1.238 -/**
1.239 - * Sets the home phone number for a user.
1.240 - *
1.241 - * @param user The user.
1.242 - * @param number The home phone number.
1.243 - */
1.244 -void msn_user_set_home_phone(MsnUser *user, const char *number);
1.245 -
1.246 -/**
1.247 - * Sets the work phone number for a user.
1.248 - *
1.249 - * @param user The user.
1.250 - * @param number The work phone number.
1.251 - */
1.252 -void msn_user_set_work_phone(MsnUser *user, const char *number);
1.253 -
1.254 -void msn_user_set_uid(MsnUser *user, const char *uid);
1.255 -
1.256 -/**
1.257 - * Sets the client id for a user.
1.258 - *
1.259 - * @param user The user.
1.260 - * @param clientid The client id.
1.261 - */
1.262 -void msn_user_set_clientid(MsnUser *user, guint clientid);
1.263 -
1.264 -/**
1.265 - * Sets the network id for a user.
1.266 - *
1.267 - * @param user The user.
1.268 - * @param network The network id.
1.269 - */
1.270 -void msn_user_set_network(MsnUser *user, MsnNetwork network);
1.271 -
1.272 -/**
1.273 - * Sets the mobile phone number for a user.
1.274 - *
1.275 - * @param user The user.
1.276 - * @param number The mobile phone number.
1.277 - */
1.278 -void msn_user_set_mobile_phone(MsnUser *user, const char *number);
1.279 -
1.280 -/**
1.281 - * Sets the MSNObject for a user.
1.282 - *
1.283 - * @param user The user.
1.284 - * @param obj The MSNObject.
1.285 - */
1.286 -void msn_user_set_object(MsnUser *user, MsnObject *obj);
1.287 -
1.288 -/**
1.289 - * Sets the client information for a user.
1.290 - *
1.291 - * @param user The user.
1.292 - * @param info The client information.
1.293 - */
1.294 -void msn_user_set_client_caps(MsnUser *user, GHashTable *info);
1.295 -
1.296 -
1.297 -/**
1.298 - * Returns the passport account for a user.
1.299 - *
1.300 - * @param user The user.
1.301 - *
1.302 - * @return The passport account.
1.303 - */
1.304 -const char *msn_user_get_passport(const MsnUser *user);
1.305 -
1.306 -/**
1.307 - * Returns the friendly name for a user.
1.308 - *
1.309 - * @param user The user.
1.310 - *
1.311 - * @return The friendly name.
1.312 - */
1.313 -const char *msn_user_get_friendly_name(const MsnUser *user);
1.314 -
1.315 -/**
1.316 - * Returns the home phone number for a user.
1.317 - *
1.318 - * @param user The user.
1.319 - *
1.320 - * @return The user's home phone number.
1.321 - */
1.322 -const char *msn_user_get_home_phone(const MsnUser *user);
1.323 -
1.324 -/**
1.325 - * Returns the work phone number for a user.
1.326 - *
1.327 - * @param user The user.
1.328 - *
1.329 - * @return The user's work phone number.
1.330 - */
1.331 -const char *msn_user_get_work_phone(const MsnUser *user);
1.332 -
1.333 -/**
1.334 - * Returns the mobile phone number for a user.
1.335 - *
1.336 - * @param user The user.
1.337 - *
1.338 - * @return The user's mobile phone number.
1.339 - */
1.340 -const char *msn_user_get_mobile_phone(const MsnUser *user);
1.341 -
1.342 -/**
1.343 - * Returns the client id for a user.
1.344 - *
1.345 - * @param user The user.
1.346 - *
1.347 - * @return The user's client id.
1.348 - */
1.349 -guint msn_user_get_clientid(const MsnUser *user);
1.350 -
1.351 -/**
1.352 - * Returns the network id for a user.
1.353 - *
1.354 - * @param user The user.
1.355 - *
1.356 - * @return The user's network id.
1.357 - */
1.358 -MsnNetwork msn_user_get_network(const MsnUser *user);
1.359 -
1.360 -/**
1.361 - * Returns the MSNObject for a user.
1.362 - *
1.363 - * @param user The user.
1.364 - *
1.365 - * @return The MSNObject.
1.366 - */
1.367 -MsnObject *msn_user_get_object(const MsnUser *user);
1.368 -
1.369 -/**
1.370 - * Returns the client information for a user.
1.371 - *
1.372 - * @param user The user.
1.373 - *
1.374 - * @return The client information.
1.375 - */
1.376 -GHashTable *msn_user_get_client_caps(const MsnUser *user);
1.377 -
1.378 -/**
1.379 - * check to see if user is online
1.380 - */
1.381 -gboolean
1.382 -msn_user_is_online(PurpleAccount *account, const char *name);
1.383 -
1.384 -/**
1.385 - * check to see if user is Yahoo User
1.386 - */
1.387 -gboolean
1.388 -msn_user_is_yahoo(PurpleAccount *account ,const char *name);
1.389 -
1.390 -void msn_user_set_op(MsnUser *user, int list_op);
1.391 -void msn_user_unset_op(MsnUser *user, int list_op);
1.392 -
1.393 -/*@}*/
1.394 -
1.395 -
1.396 -#endif /* _MSN_USER_H_ */