rename accountopt.[ch] to purpleaccountoption.[ch]
[pidgin-git.git] / libpurple / protocols / bonjour / buddy.h
blobae5e1ad5d35efece4e6d473c552d76a2b053e66c
1 /*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU Library General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA.
17 #ifndef PURPLE_BONJOUR_BUDDY_H
18 #define PURPLE_BONJOUR_BUDDY_H
20 #include <glib.h>
22 #include <purple.h>
24 #include "jabber.h"
26 typedef struct
28 PurpleAccount *account;
30 gchar *name;
31 GSList *ips;
32 gint port_p2pj;
34 gchar *first;
35 gchar *phsh;
36 gchar *status;
37 gchar *email;
38 gchar *last;
39 gchar *jid;
40 gchar *AIM;
41 gchar *vc;
42 gchar *msg;
43 gchar *ext;
44 gchar *nick;
45 gchar *node;
46 gchar *ver;
48 BonjourJabberConversation *conversation;
50 gpointer mdns_impl_data;
51 } BonjourBuddy;
53 static const char *const buddy_TXT_records[] = {
54 "1st",
55 "email",
56 "ext",
57 "jid",
58 "last",
59 "msg",
60 "nick",
61 "node",
62 "phsh",
63 /* "port.p2pj", Deprecated - MUST ignore */
64 "status",
65 /* "txtvers", Deprecated - hardcoded to 1 */
66 "vc",
67 "ver",
68 "AIM", /* non standard */
69 NULL
72 /**
73 * Creates a new buddy.
75 BonjourBuddy *bonjour_buddy_new(const gchar *name, PurpleAccount *account);
77 /**
78 * Clear any existing values from the buddy.
79 * This is called before updating so that we can notice removals
81 void clear_bonjour_buddy_values(BonjourBuddy *buddy);
83 /**
84 * Sets a value in the BonjourBuddy struct, destroying the old value
86 void set_bonjour_buddy_value(BonjourBuddy *buddy, const char *record_key, const char *value, guint32 len);
88 /**
89 * Check if all the compulsory buddy data is present.
91 gboolean bonjour_buddy_check(BonjourBuddy *buddy);
93 /**
94 * If the buddy doesn't previously exists, it is created. Else, its data is changed (???)
95 * purple_buddy is optional; it saves an additional lookup if we already have it
97 void bonjour_buddy_add_to_purple(BonjourBuddy *bonjour_buddy, PurpleBuddy *purple_buddy);
99 /**
100 * The buddy has signed off Bonjour.
101 * If the buddy is being saved, mark as offline, otherwise delete
103 void bonjour_buddy_signed_off(PurpleBuddy *purple_buddy);
106 * We got the buddy icon data; deal with it
108 void bonjour_buddy_got_buddy_icon(BonjourBuddy *buddy, gconstpointer data, gsize len);
111 * Deletes a buddy from memory.
113 void bonjour_buddy_delete(BonjourBuddy *buddy);
115 #endif /* PURPLE_BONJOUR_BUDDY_H */