~liuxingcs/+junk/IM

« back to all changes in this revision

Viewing changes to libpurple/protocols/yahoo/yahoo_friend.h

  • Committer: liuxing
  • Date: 2013-04-25 10:41:36 UTC
  • Revision ID: liuxingcs@yeah.net-20130425104136-e5towjtz19wsz1w7
Init IM

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * @file yahoo_friend.h The Yahoo! protocol plugin YahooFriend object
 
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
 
 
25
#ifndef _YAHOO_FRIEND_H_
 
26
#define _YAHOO_FRIEND_H_
 
27
 
 
28
#include "libymsg.h"
 
29
#include "yahoo_packet.h"
 
30
 
 
31
typedef enum {
 
32
        YAHOO_PRESENCE_DEFAULT = 0,
 
33
        YAHOO_PRESENCE_ONLINE,
 
34
        YAHOO_PRESENCE_PERM_OFFLINE
 
35
} YahooPresenceVisibility;
 
36
 
 
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;
 
43
 
 
44
 
 
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
 
47
 */
 
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;
 
65
 
 
66
YahooFriend *yahoo_friend_find(PurpleConnection *gc, const char *name);
 
67
YahooFriend *yahoo_friend_find_or_new(PurpleConnection *gc, const char *name);
 
68
 
 
69
void yahoo_friend_set_ip(YahooFriend *f, const char *ip);
 
70
const char *yahoo_friend_get_ip(YahooFriend *f);
 
71
 
 
72
void yahoo_friend_set_game(YahooFriend *f, const char *game);
 
73
const char *yahoo_friend_get_game(YahooFriend *f);
 
74
 
 
75
void yahoo_friend_set_status_message(YahooFriend *f, char *msg);
 
76
const char *yahoo_friend_get_status_message(YahooFriend *f);
 
77
 
 
78
void yahoo_friend_set_alias_id(YahooFriend *f, const char *alias_id);
 
79
const char *yahoo_friend_get_alias_id(YahooFriend *f);
 
80
 
 
81
void yahoo_friend_set_buddy_icon_need_request(YahooFriend *f, gboolean needs);
 
82
gboolean yahoo_friend_get_buddy_icon_need_request(YahooFriend *f);
 
83
 
 
84
void yahoo_friend_free(gpointer p);
 
85
 
 
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);
 
89
 
 
90
void yahoo_friend_set_p2p_status(YahooFriend *f, YahooP2PStatus p2p_status);
 
91
YahooP2PStatus yahoo_friend_get_p2p_status(YahooFriend *f);
 
92
 
 
93
#endif /* _YAHOO_FRIEND_H_ */