mingw: fix for G_GNUC_NULL_TERMINATED
[siplcs.git] / src / core / sipe-ft.h
blob43d5e51956e206ab228b593e0abfa1d7656cf2eb
1 /**
2 * @file sipe-ft.h
4 * pidgin-sipe
6 * Copyright (C) 2010 Jakub Adam <jakub.adam@tieto.com>
7 * Copyright (C) 2010 Tomáš Hrabčík <tomas.hrabcik@tieto.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 * Interface dependencies:
27 * <glib.h>
30 /* Forward declarations */
31 struct sipmsg;
32 struct _PurpleAccount;
33 struct _PurpleConnection;
34 struct _PurpleXfer;
36 /**
37 * Called when remote peer wants to send a file.
39 * Function initializes libpurple filetransfer API structure and calls
40 * purple_xfer_request().
42 * @param account PurpleAccount corresponding to the request
43 * @param msg SIP message
44 * @param body parsed SIP message body as name-value pairs
46 void sipe_ft_incoming_transfer(struct _PurpleAccount *account, struct sipmsg *msg, const GSList *body);
47 /**
48 * Handles incoming filetransfer message with ACCEPT invitation command.
50 * This message is sent during the negotiation phase when parameters of the
51 * transfer like IP address or TCP port are going to be set up.
53 * @param account PurpleAccount corresponding to the request
54 * @param body parsed SIP message body as name-value pairs
56 void sipe_ft_incoming_accept(struct _PurpleAccount *account, const GSList *body);
57 /**
58 * Called when remote peer cancels ongoing file transfer.
60 * Function dispatches the request to libpurple
62 * @param account PurpleAccount corresponding to the request
63 * @param body parsed SIP message body as name-value pairs
65 void sipe_ft_incoming_cancel(struct _PurpleAccount *account, GSList *body);
66 /**
67 * Initiates outgoing file transfer, sending @c file to remote peer identified
68 * by @c who.
70 * @param gc a PurpleConnection
71 * @param who string identifying receiver of the file
72 * @param file local file system path of the file to send
74 void sipe_ft_send_file(struct _PurpleConnection *gc, const char *who, const char *file);
75 /**
76 * Creates new PurpleXfer structure representing a file transfer.
78 * @param gc a PurpleConnection
79 * @param who remote participant in the file transfer session
81 struct _PurpleXfer * sipe_ft_new_xfer(struct _PurpleConnection *gc, const char *who);
83 /**
84 * Parses file transfer message body and creates a list with name-value pairs
86 * @param body file transfer SIP message body
88 * @return GSList of name-value pairs parsed from message body, NULL if body has
89 * incorrect format
91 GSList * sipe_ft_parse_msg_body(const gchar *body);