Frameworks/libpurple.framework/Versions/0.6.2/Headers/buddy.h
changeset 2592 e8d15275025e
parent 2571 75fb8ee8f2e6
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Frameworks/libpurple.framework/Versions/0.6.2/Headers/buddy.h	Fri Aug 21 13:25:11 2009 -0700
     1.3 @@ -0,0 +1,132 @@
     1.4 +/**
     1.5 + * @file buddy.h Buddy handlers
     1.6 + *
     1.7 + * purple
     1.8 + *
     1.9 + * Copyright (C) 2003 Nathan Walp <faceprint@faceprint.com>
    1.10 + *
    1.11 + * This program is free software; you can redistribute it and/or modify
    1.12 + * it under the terms of the GNU General Public License as published by
    1.13 + * the Free Software Foundation; either version 2 of the License, or
    1.14 + * (at your option) any later version.
    1.15 + *
    1.16 + * This program is distributed in the hope that it will be useful,
    1.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.19 + * GNU General Public License for more details.
    1.20 + *
    1.21 + * You should have received a copy of the GNU General Public License
    1.22 + * along with this program; if not, write to the Free Software
    1.23 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
    1.24 + */
    1.25 +#ifndef PURPLE_JABBER_BUDDY_H_
    1.26 +#define PURPLE_JABBER_BUDDY_H_
    1.27 +
    1.28 +typedef enum {
    1.29 +	JABBER_BUDDY_STATE_UNKNOWN = -2,
    1.30 +	JABBER_BUDDY_STATE_ERROR = -1,
    1.31 +	JABBER_BUDDY_STATE_UNAVAILABLE = 0,
    1.32 +	JABBER_BUDDY_STATE_ONLINE,
    1.33 +	JABBER_BUDDY_STATE_CHAT,
    1.34 +	JABBER_BUDDY_STATE_AWAY,
    1.35 +	JABBER_BUDDY_STATE_XA,
    1.36 +	JABBER_BUDDY_STATE_DND
    1.37 +} JabberBuddyState;
    1.38 +
    1.39 +typedef struct _JabberBuddy JabberBuddy;
    1.40 +
    1.41 +#include "jabber.h"
    1.42 +#include "caps.h"
    1.43 +
    1.44 +struct _JabberBuddy {
    1.45 +	GList *resources;
    1.46 +	char *error_msg;
    1.47 +	enum {
    1.48 +		JABBER_INVISIBLE_NONE   = 0,
    1.49 +		JABBER_INVISIBLE_SERVER = 1 << 1,
    1.50 +		JABBER_INVIS_BUDDY      = 1 << 2
    1.51 +	} invisible;
    1.52 +	enum {
    1.53 +		JABBER_SUB_NONE    = 0,
    1.54 +		JABBER_SUB_PENDING = 1 << 1,
    1.55 +		JABBER_SUB_TO      = 1 << 2,
    1.56 +		JABBER_SUB_FROM    = 1 << 3,
    1.57 +		JABBER_SUB_BOTH    = (JABBER_SUB_TO | JABBER_SUB_FROM),
    1.58 +		JABBER_SUB_REMOVE  = 1 << 4
    1.59 +	} subscription;
    1.60 +};
    1.61 +
    1.62 +typedef struct _JabberAdHocCommands {
    1.63 +	char *jid;
    1.64 +	char *node;
    1.65 +	char *name;
    1.66 +} JabberAdHocCommands;
    1.67 +
    1.68 +typedef struct _JabberBuddyResource {
    1.69 +	JabberBuddy *jb;
    1.70 +	char *name;
    1.71 +	int priority;
    1.72 +	JabberBuddyState state;
    1.73 +	char *status;
    1.74 +	time_t idle;
    1.75 +	JabberCapabilities capabilities;
    1.76 +	char *thread_id;
    1.77 +	enum {
    1.78 +		JABBER_CHAT_STATES_UNKNOWN,
    1.79 +		JABBER_CHAT_STATES_UNSUPPORTED,
    1.80 +		JABBER_CHAT_STATES_SUPPORTED
    1.81 +	} chat_states;
    1.82 +	struct {
    1.83 +		char *version;
    1.84 +		char *name;
    1.85 +		char *os;
    1.86 +	} client;
    1.87 +	/* tz_off == PURPLE_NO_TZ_OFF when unset */
    1.88 +	long tz_off;
    1.89 +	struct {
    1.90 +		JabberCapsClientInfo *info;
    1.91 +		GList *exts;
    1.92 +	} caps;
    1.93 +	GList *commands;
    1.94 +	gboolean commands_fetched;
    1.95 +} JabberBuddyResource;
    1.96 +
    1.97 +void jabber_buddy_free(JabberBuddy *jb);
    1.98 +JabberBuddy *jabber_buddy_find(JabberStream *js, const char *name,
    1.99 +		gboolean create);
   1.100 +JabberBuddyResource *jabber_buddy_find_resource(JabberBuddy *jb,
   1.101 +		const char *resource);
   1.102 +JabberBuddyResource *jabber_buddy_track_resource(JabberBuddy *jb, const char *resource,
   1.103 +		int priority, JabberBuddyState state, const char *status);
   1.104 +void jabber_buddy_resource_free(JabberBuddyResource *jbr);
   1.105 +void jabber_buddy_remove_resource(JabberBuddy *jb, const char *resource);
   1.106 +void jabber_buddy_get_info(PurpleConnection *gc, const char *who);
   1.107 +
   1.108 +GList *jabber_blist_node_menu(PurpleBlistNode *node);
   1.109 +
   1.110 +void jabber_set_info(PurpleConnection *gc, const char *info);
   1.111 +void jabber_setup_set_info(PurplePluginAction *action);
   1.112 +void jabber_set_buddy_icon(PurpleConnection *gc, PurpleStoredImage *img);
   1.113 +
   1.114 +const char *jabber_buddy_state_get_name(JabberBuddyState state);
   1.115 +const char *jabber_buddy_state_get_status_id(JabberBuddyState state);
   1.116 +const char *jabber_buddy_state_get_show(JabberBuddyState state);
   1.117 +JabberBuddyState jabber_buddy_status_id_get_state(const char *id);
   1.118 +JabberBuddyState jabber_buddy_show_get_state(const char *id);
   1.119 +
   1.120 +void jabber_user_search(JabberStream *js, const char *directory);
   1.121 +void jabber_user_search_begin(PurplePluginAction *);
   1.122 +
   1.123 +void jabber_buddy_remove_all_pending_buddy_info_requests(JabberStream *js);
   1.124 +
   1.125 +void jabber_vcard_fetch_mine(JabberStream *js);
   1.126 +
   1.127 +gboolean jabber_resource_has_capability(const JabberBuddyResource *jbr,
   1.128 +										const gchar *cap);
   1.129 +gboolean jabber_buddy_has_capability(const JabberBuddy *jb, const gchar *cap);
   1.130 +
   1.131 +const gchar *
   1.132 +jabber_resource_get_identity_category_type(const JabberBuddyResource *jbr,
   1.133 +	const gchar *category);
   1.134 +
   1.135 +#endif /* PURPLE_JABBER_BUDDY_H_ */