mark PurpleImageClass as private
[pidgin-git.git] / libpurple / protocols / bonjour / buddy.h
blobc0ff2e3c24bb3acaaa657a61fdfc43c0f6bc2ee6
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 "account.h"
23 #include "jabber.h"
25 typedef struct
27 PurpleAccount *account;
29 gchar *name;
30 GSList *ips;
31 gint port_p2pj;
33 gchar *first;
34 gchar *phsh;
35 gchar *status;
36 gchar *email;
37 gchar *last;
38 gchar *jid;
39 gchar *AIM;
40 gchar *vc;
41 gchar *msg;
42 gchar *ext;
43 gchar *nick;
44 gchar *node;
45 gchar *ver;
47 BonjourJabberConversation *conversation;
49 gpointer mdns_impl_data;
50 } BonjourBuddy;
52 static const char *const buddy_TXT_records[] = {
53 "1st",
54 "email",
55 "ext",
56 "jid",
57 "last",
58 "msg",
59 "nick",
60 "node",
61 "phsh",
62 /* "port.p2pj", Deprecated - MUST ignore */
63 "status",
64 /* "txtvers", Deprecated - hardcoded to 1 */
65 "vc",
66 "ver",
67 "AIM", /* non standard */
68 NULL
71 /**
72 * Creates a new buddy.
74 BonjourBuddy *bonjour_buddy_new(const gchar *name, PurpleAccount *account);
76 /**
77 * Clear any existing values from the buddy.
78 * This is called before updating so that we can notice removals
80 void clear_bonjour_buddy_values(BonjourBuddy *buddy);
82 /**
83 * Sets a value in the BonjourBuddy struct, destroying the old value
85 void set_bonjour_buddy_value(BonjourBuddy *buddy, const char *record_key, const char *value, guint32 len);
87 /**
88 * Check if all the compulsory buddy data is present.
90 gboolean bonjour_buddy_check(BonjourBuddy *buddy);
92 /**
93 * If the buddy doesn't previously exists, it is created. Else, its data is changed (???)
94 * purple_buddy is optional; it saves an additional lookup if we already have it
96 void bonjour_buddy_add_to_purple(BonjourBuddy *bonjour_buddy, PurpleBuddy *purple_buddy);
98 /**
99 * The buddy has signed off Bonjour.
100 * If the buddy is being saved, mark as offline, otherwise delete
102 void bonjour_buddy_signed_off(PurpleBuddy *purple_buddy);
105 * We got the buddy icon data; deal with it
107 void bonjour_buddy_got_buddy_icon(BonjourBuddy *buddy, gconstpointer data, gsize len);
110 * Deletes a buddy from memory.
112 void bonjour_buddy_delete(BonjourBuddy *buddy);
114 #endif /* PURPLE_BONJOUR_BUDDY_H */