Open an explorer.exe window at the location of the file when clicking
[pidgin-git.git] / libpurple / protocols / yahoo / yahoo_friend.h
blob2560fc77b7781549ab1f3c68f0afbfe1470cda41
1 /**
2 * @file yahoo_friend.h The Yahoo! protocol plugin YahooFriend object
4 * purple
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.
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.
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.
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
25 #ifndef _YAHOO_FRIEND_H_
26 #define _YAHOO_FRIEND_H_
28 #include "libymsg.h"
29 #include "yahoo_packet.h"
31 typedef enum {
32 YAHOO_PRESENCE_DEFAULT = 0,
33 YAHOO_PRESENCE_ONLINE,
34 YAHOO_PRESENCE_PERM_OFFLINE
35 } YahooPresenceVisibility;
37 typedef enum {
38 YAHOO_P2PSTATUS_NOT_CONNECTED = 0,
39 YAHOO_P2PSTATUS_DO_NOT_CONNECT,
40 YAHOO_P2PSTATUS_WE_ARE_SERVER,
41 YAHOO_P2PSTATUS_WE_ARE_CLIENT
42 } YahooP2PStatus;
45 /* these are called friends instead of buddies mainly so I can use variables
46 * named f and not confuse them with variables named b
48 typedef struct _YahooFriend {
49 enum yahoo_status status;
50 gchar *msg;
51 gchar *game;
52 int idle;
53 int away;
54 gboolean sms;
55 gchar *ip;
56 gboolean bicon_sent_request;
57 YahooPresenceVisibility presence;
58 YahooFederation fed;
59 long int version_id;
60 YahooPersonalDetails ypd;
61 YahooP2PStatus p2p_status;
62 gboolean p2p_packet_sent; /* 0:not sent, 1=sent */
63 gint session_id; /* session id of friend */
64 } YahooFriend;
66 YahooFriend *yahoo_friend_find(PurpleConnection *gc, const char *name);
67 YahooFriend *yahoo_friend_find_or_new(PurpleConnection *gc, const char *name);
69 void yahoo_friend_set_ip(YahooFriend *f, const char *ip);
70 const char *yahoo_friend_get_ip(YahooFriend *f);
72 void yahoo_friend_set_game(YahooFriend *f, const char *game);
73 const char *yahoo_friend_get_game(YahooFriend *f);
75 void yahoo_friend_set_status_message(YahooFriend *f, char *msg);
76 const char *yahoo_friend_get_status_message(YahooFriend *f);
78 void yahoo_friend_set_alias_id(YahooFriend *f, const char *alias_id);
79 const char *yahoo_friend_get_alias_id(YahooFriend *f);
81 void yahoo_friend_set_buddy_icon_need_request(YahooFriend *f, gboolean needs);
82 gboolean yahoo_friend_get_buddy_icon_need_request(YahooFriend *f);
84 void yahoo_friend_free(gpointer p);
86 void yahoo_process_presence(PurpleConnection *gc, struct yahoo_packet *pkt);
87 void yahoo_friend_update_presence(PurpleConnection *gc, const char *name,
88 YahooPresenceVisibility presence);
90 void yahoo_friend_set_p2p_status(YahooFriend *f, YahooP2PStatus p2p_status);
91 YahooP2PStatus yahoo_friend_get_p2p_status(YahooFriend *f);
93 #endif /* _YAHOO_FRIEND_H_ */