7014
|
1 /**
|
|
2 * @file buddy.h Buddy handlers
|
|
3 *
|
|
4 * gaim
|
|
5 *
|
|
6 * Copyright (C) 2003 Nathan Walp <faceprint@faceprint.com>
|
|
7 *
|
|
8 * This program is free software; you can redistribute it and/or modify
|
|
9 * it under the terms of the GNU General Public License as published by
|
|
10 * the Free Software Foundation; either version 2 of the License, or
|
|
11 * (at your option) any later version.
|
|
12 *
|
|
13 * This program is distributed in the hope that it will be useful,
|
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16 * GNU General Public License for more details.
|
|
17 *
|
|
18 * You should have received a copy of the GNU General Public License
|
|
19 * along with this program; if not, write to the Free Software
|
|
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
21 */
|
|
22 #ifndef _GAIM_JABBER_BUDDY_H_
|
|
23 #define _GAIM_JABBER_BUDDY_H_
|
|
24
|
|
25 #include "jabber.h"
|
|
26
|
9954
|
27 typedef enum {
|
|
28 JABBER_BUDDY_STATE_UNKNOWN = -2,
|
|
29 JABBER_BUDDY_STATE_ERROR = -1,
|
|
30 JABBER_BUDDY_STATE_UNAVAILABLE = 0,
|
|
31 JABBER_BUDDY_STATE_ONLINE,
|
|
32 JABBER_BUDDY_STATE_CHAT,
|
|
33 JABBER_BUDDY_STATE_AWAY,
|
|
34 JABBER_BUDDY_STATE_XA,
|
|
35 JABBER_BUDDY_STATE_DND
|
|
36 } JabberBuddyState;
|
|
37
|
7014
|
38 typedef struct _JabberBuddy {
|
|
39 GList *resources;
|
|
40 char *error_msg;
|
|
41 enum {
|
|
42 JABBER_INVISIBLE_NONE = 0,
|
|
43 JABBER_INVISIBLE_SERVER = 1 << 1,
|
|
44 JABBER_INVIS_BUDDY = 1 << 2
|
|
45 } invisible;
|
|
46 enum {
|
|
47 JABBER_SUB_NONE = 0,
|
|
48 JABBER_SUB_PENDING = 1 << 1,
|
|
49 JABBER_SUB_TO = 1 << 2,
|
|
50 JABBER_SUB_FROM = 1 << 3,
|
8194
|
51 JABBER_SUB_BOTH = (JABBER_SUB_TO | JABBER_SUB_FROM),
|
|
52 JABBER_SUB_REMOVE = 1 << 4
|
7014
|
53 } subscription;
|
|
54 } JabberBuddy;
|
|
55
|
7116
|
56 typedef struct _JabberBuddyResource {
|
|
57 JabberBuddy *jb;
|
|
58 char *name;
|
|
59 int priority;
|
9954
|
60 JabberBuddyState state;
|
7116
|
61 char *status;
|
8312
|
62 JabberCapabilities capabilities;
|
8400
|
63 char *thread_id;
|
13706
|
64 enum {
|
|
65 JABBER_CHAT_STATES_UNKNOWN,
|
|
66 JABBER_CHAT_STATES_UNSUPPORTED,
|
|
67 JABBER_CHAT_STATES_SUPPORTED
|
|
68 } chat_states;
|
|
69 struct {
|
|
70 char *version;
|
|
71 char *name;
|
|
72 char *os;
|
|
73 } client;
|
7116
|
74 } JabberBuddyResource;
|
|
75
|
|
76 void jabber_buddy_free(JabberBuddy *jb);
|
7014
|
77 JabberBuddy *jabber_buddy_find(JabberStream *js, const char *name,
|
|
78 gboolean create);
|
|
79 JabberBuddyResource *jabber_buddy_find_resource(JabberBuddy *jb,
|
|
80 const char *resource);
|
9954
|
81 JabberBuddyResource *jabber_buddy_track_resource(JabberBuddy *jb, const char *resource,
|
|
82 int priority, JabberBuddyState state, const char *status);
|
7116
|
83 void jabber_buddy_resource_free(JabberBuddyResource *jbr);
|
7014
|
84 void jabber_buddy_remove_resource(JabberBuddy *jb, const char *resource);
|
|
85 const char *jabber_buddy_get_status_msg(JabberBuddy *jb);
|
|
86 void jabber_buddy_get_info(GaimConnection *gc, const char *who);
|
|
87 void jabber_buddy_get_info_chat(GaimConnection *gc, int id,
|
|
88 const char *resource);
|
|
89
|
9030
|
90 GList *jabber_blist_node_menu(GaimBlistNode *node);
|
7014
|
91
|
|
92 void jabber_set_info(GaimConnection *gc, const char *info);
|
9015
|
93 void jabber_setup_set_info(GaimPluginAction *action);
|
10189
|
94 void jabber_set_buddy_icon(GaimConnection *gc, const char *iconfile);
|
7014
|
95
|
9954
|
96 const char *jabber_buddy_state_get_name(JabberBuddyState state);
|
|
97 const char *jabber_buddy_state_get_status_id(JabberBuddyState state);
|
12683
|
98 const char *jabber_buddy_state_get_show(JabberBuddyState state);
|
9954
|
99 JabberBuddyState jabber_buddy_status_id_get_state(const char *id);
|
12683
|
100 JabberBuddyState jabber_buddy_show_get_state(const char *id);
|
9954
|
101
|
11675
|
102 void jabber_user_search_begin(GaimPluginAction *);
|
|
103
|
7014
|
104 #endif /* _GAIM_JABBER_BUDDY_H_ */
|