Frameworks/libpurple.framework/Versions/0.6.2/Headers/server.h
changeset 2592 e8d15275025e
parent 1739 8b0daad9656c
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Frameworks/libpurple.framework/Versions/0.6.2/Headers/server.h	Fri Aug 21 13:25:11 2009 -0700
     1.3 @@ -0,0 +1,193 @@
     1.4 +/**
     1.5 + * @file server.h Server API
     1.6 + * @ingroup core
     1.7 + */
     1.8 +
     1.9 +/* purple
    1.10 + *
    1.11 + * Purple is the legal property of its developers, whose names are too numerous
    1.12 + * to list here.  Please refer to the COPYRIGHT file distributed with this
    1.13 + * source distribution.
    1.14 + *
    1.15 + * This program is free software; you can redistribute it and/or modify
    1.16 + * it under the terms of the GNU General Public License as published by
    1.17 + * the Free Software Foundation; either version 2 of the License, or
    1.18 + * (at your option) any later version.
    1.19 + *
    1.20 + * This program is distributed in the hope that it will be useful,
    1.21 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.22 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.23 + * GNU General Public License for more details.
    1.24 + *
    1.25 + * You should have received a copy of the GNU General Public License
    1.26 + * along with this program; if not, write to the Free Software
    1.27 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
    1.28 + */
    1.29 +#ifndef _PURPLE_SERVER_H_
    1.30 +#define _PURPLE_SERVER_H_
    1.31 +
    1.32 +#include "account.h"
    1.33 +#include "conversation.h"
    1.34 +#include "prpl.h"
    1.35 +
    1.36 +#ifdef __cplusplus
    1.37 +extern "C" {
    1.38 +#endif
    1.39 +
    1.40 +/**
    1.41 + * Send a typing message to a given user over a given connection.
    1.42 + *
    1.43 + * TODO: Could probably move this into the conversation API.
    1.44 + *
    1.45 + * @param gc    The connection over which to send the typing notification.
    1.46 + * @param name  The user to send the typing notification to.
    1.47 + * @param state One of PURPLE_TYPING, PURPLE_TYPED, or PURPLE_NOT_TYPING.
    1.48 + * @return A quiet-period, specified in seconds, where Purple will not
    1.49 + *         send any additional typing notification messages.  Most
    1.50 + *         protocols should return 0, which means that no additional
    1.51 + *         PURPLE_TYPING messages need to be sent.  If this is 5, for
    1.52 + *         example, then Purple will wait five seconds, and if the Purple
    1.53 + *         user is still typing then Purple will send another PURPLE_TYPING
    1.54 + *         message.
    1.55 + */
    1.56 +unsigned int serv_send_typing(PurpleConnection *gc, const char *name, PurpleTypingState state);
    1.57 +
    1.58 +void serv_move_buddy(PurpleBuddy *, PurpleGroup *, PurpleGroup *);
    1.59 +int  serv_send_im(PurpleConnection *, const char *, const char *, PurpleMessageFlags flags);
    1.60 +
    1.61 +/** Get information about an account's attention commands, from the prpl.
    1.62 + *
    1.63 + * @return The attention command numbered 'code' from the prpl's attention_types, or NULL.
    1.64 + */
    1.65 +PurpleAttentionType *purple_get_attention_type_from_code(PurpleAccount *account, guint type_code);
    1.66 +
    1.67 +/** Send an attention request message.
    1.68 + *
    1.69 + * @deprecated Use purple_prpl_send_attention() instead.
    1.70 + *
    1.71 + * @param gc The connection to send the message on.
    1.72 + * @param who Whose attention to request.
    1.73 + * @param type_code An index into the prpl's attention_types list determining the type
    1.74 + * 	of the attention request command to send. 0 if prpl only defines one
    1.75 + * 	(for example, Yahoo and MSN), but some protocols define more (MySpaceIM).
    1.76 + *
    1.77 + * Note that you can't send arbitrary PurpleAttentionType's, because there is
    1.78 + * only a fixed set of attention commands.
    1.79 + */
    1.80 +void serv_send_attention(PurpleConnection *gc, const char *who, guint type_code);
    1.81 +
    1.82 +/** Process an incoming attention message.
    1.83 + *
    1.84 + * @deprecated Use purple_prpl_got_attention() instead.
    1.85 + *
    1.86 + * @param gc The connection that received the attention message.
    1.87 + * @param who Who requested your attention.
    1.88 + * @param type_code An index into the prpl's attention_types list determining the type
    1.89 + * 	of the attention request command to send.
    1.90 + */
    1.91 +void serv_got_attention(PurpleConnection *gc, const char *who, guint type_code);
    1.92 +
    1.93 +void serv_get_info(PurpleConnection *, const char *);
    1.94 +void serv_set_info(PurpleConnection *, const char *);
    1.95 +
    1.96 +void serv_add_permit(PurpleConnection *, const char *);
    1.97 +void serv_add_deny(PurpleConnection *, const char *);
    1.98 +void serv_rem_permit(PurpleConnection *, const char *);
    1.99 +void serv_rem_deny(PurpleConnection *, const char *);
   1.100 +void serv_set_permit_deny(PurpleConnection *);
   1.101 +void serv_chat_invite(PurpleConnection *, int, const char *, const char *);
   1.102 +void serv_chat_leave(PurpleConnection *, int);
   1.103 +void serv_chat_whisper(PurpleConnection *, int, const char *, const char *);
   1.104 +int  serv_chat_send(PurpleConnection *, int, const char *, PurpleMessageFlags flags);
   1.105 +void serv_alias_buddy(PurpleBuddy *);
   1.106 +void serv_got_alias(PurpleConnection *gc, const char *who, const char *alias);
   1.107 +
   1.108 +/**
   1.109 + * A protocol plugin should call this when it retrieves a private alias from
   1.110 + * the server.  Private aliases are the aliases the user sets, while public
   1.111 + * aliases are the aliases or display names that buddies set for themselves.
   1.112 + *
   1.113 + * @param gc The connection on which the alias was received.
   1.114 + * @param who The name of the buddy whose alias was received.
   1.115 + * @param alias The alias that was received.
   1.116 + */
   1.117 +void purple_serv_got_private_alias(PurpleConnection *gc, const char *who, const char *alias);
   1.118 +
   1.119 +
   1.120 +/**
   1.121 + * Receive a typing message from a remote user.  Either PURPLE_TYPING
   1.122 + * or PURPLE_TYPED.  If the user has stopped typing then use
   1.123 + * serv_got_typing_stopped instead.
   1.124 + *
   1.125 + * TODO: Could probably move this into the conversation API.
   1.126 + *
   1.127 + * @param gc      The connection on which the typing message was received.
   1.128 + * @param name    The name of the remote user.
   1.129 + * @param timeout If this is a number greater than 0, then
   1.130 + *        Purple will wait this number of seconds and then
   1.131 + *        set this buddy to the PURPLE_NOT_TYPING state.  This
   1.132 + *        is used by protocols that send repeated typing messages
   1.133 + *        while the user is composing the message.
   1.134 + * @param state   The typing state received
   1.135 + */
   1.136 +void serv_got_typing(PurpleConnection *gc, const char *name, int timeout,
   1.137 +					 PurpleTypingState state);
   1.138 +
   1.139 +/**
   1.140 + * TODO: Could probably move this into the conversation API.
   1.141 + */
   1.142 +void serv_got_typing_stopped(PurpleConnection *gc, const char *name);
   1.143 +
   1.144 +void serv_got_im(PurpleConnection *gc, const char *who, const char *msg,
   1.145 +				 PurpleMessageFlags flags, time_t mtime);
   1.146 +
   1.147 +/**
   1.148 + * @param data The hash function should be g_str_hash() and the equal
   1.149 + *             function should be g_str_equal().
   1.150 + */
   1.151 +void serv_join_chat(PurpleConnection *, GHashTable *data);
   1.152 +
   1.153 +/**
   1.154 + * @param data The hash function should be g_str_hash() and the equal
   1.155 + *             function should be g_str_equal().
   1.156 + */
   1.157 +void serv_reject_chat(PurpleConnection *, GHashTable *data);
   1.158 +
   1.159 +/**
   1.160 + * Called by a prpl when an account is invited into a chat.
   1.161 + *
   1.162 + * @param gc      The connection on which the invite arrived.
   1.163 + * @param name    The name of the chat you're being invited to.
   1.164 + * @param who     The username of the person inviting the account.
   1.165 + * @param message The optional invite message.
   1.166 + * @param data    The components necessary if you want to call serv_join_chat().
   1.167 + *                The hash function should be g_str_hash() and the equal
   1.168 + *                function should be g_str_equal().
   1.169 + */
   1.170 +void serv_got_chat_invite(PurpleConnection *gc, const char *name,
   1.171 +						  const char *who, const char *message,
   1.172 +						  GHashTable *data);
   1.173 +
   1.174 +PurpleConversation *serv_got_joined_chat(PurpleConnection *gc,
   1.175 +									   int id, const char *name);
   1.176 +/**
   1.177 + * Called by a prpl when an attempt to join a chat via serv_join_chat()
   1.178 + * fails.
   1.179 + *
   1.180 + * @param gc      The connection on which chat joining failed
   1.181 + * @param data    The components passed to serv_join_chat() originally.
   1.182 + *                The hash function should be g_str_hash() and the equal
   1.183 + *                function should be g_str_equal().
   1.184 + */
   1.185 +void purple_serv_got_join_chat_failed(PurpleConnection *gc, GHashTable *data);
   1.186 +
   1.187 +void serv_got_chat_left(PurpleConnection *g, int id);
   1.188 +void serv_got_chat_in(PurpleConnection *g, int id, const char *who,
   1.189 +					  PurpleMessageFlags flags, const char *message, time_t mtime);
   1.190 +void serv_send_file(PurpleConnection *gc, const char *who, const char *file);
   1.191 +
   1.192 +#ifdef __cplusplus
   1.193 +}
   1.194 +#endif
   1.195 +
   1.196 +#endif /* _PURPLE_SERVER_H_ */