Frameworks/libpurple.framework/Versions/2.10.12r8d2874a79747/Headers/slplink.h
branchadium-1.5.11-merge
changeset 6013 f8d0dc659e3f
parent 5941 307f53385811
parent 6012 200a01709ba4
child 6014 fcb71cb71a3d
child 6015 2b01cc935b7c
equal deleted inserted replaced
5941:307f53385811 6013:f8d0dc659e3f
     1 /**
       
     2  * @file slplink.h MSNSLP Link support
       
     3  *
       
     4  * purple
       
     5  *
       
     6  * Purple is the legal property of its developers, whose names are too numerous
       
     7  * to list here.  Please refer to the COPYRIGHT file distributed with this
       
     8  * source distribution.
       
     9  *
       
    10  * This program is free software; you can redistribute it and/or modify
       
    11  * it under the terms of the GNU General Public License as published by
       
    12  * the Free Software Foundation; either version 2 of the License, or
       
    13  * (at your option) any later version.
       
    14  *
       
    15  * This program is distributed in the hope that it will be useful,
       
    16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    18  * GNU General Public License for more details.
       
    19  *
       
    20  * You should have received a copy of the GNU General Public License
       
    21  * along with this program; if not, write to the Free Software
       
    22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
       
    23  */
       
    24 #ifndef MSN_SLPLINK_H
       
    25 #define MSN_SLPLINK_H
       
    26 
       
    27 typedef struct _MsnSlpLink MsnSlpLink;
       
    28 
       
    29 #include "directconn.h"
       
    30 #include "session.h"
       
    31 #include "slpcall.h"
       
    32 #include "slpmsg.h"
       
    33 #include "switchboard.h"
       
    34 
       
    35 typedef void (*MsnSlpCb)(MsnSlpCall *slpcall,
       
    36 						 const guchar *data, gsize size);
       
    37 typedef void (*MsnSlpEndCb)(MsnSlpCall *slpcall, MsnSession *session);
       
    38 
       
    39 struct _MsnSlpLink
       
    40 {
       
    41 	MsnSession *session;
       
    42 	MsnSwitchBoard *swboard;
       
    43 	MsnDirectConn *dc;
       
    44 
       
    45 	guint refs;
       
    46 
       
    47 	char *remote_user;
       
    48 	MsnP2PVersion p2p_version;
       
    49 
       
    50 	int slp_seq_id;
       
    51 
       
    52 	GList *slp_calls;
       
    53 	GList *slp_msgs;
       
    54 
       
    55 	GQueue *slp_msg_queue;
       
    56 };
       
    57 
       
    58 MsnSlpLink *msn_slplink_ref(MsnSlpLink *slplink);
       
    59 void msn_slplink_unref(MsnSlpLink *slplink);
       
    60 
       
    61 /**
       
    62  * @return An MsnSlpLink for the given user, or NULL if there is no
       
    63  *         existing MsnSlpLink.
       
    64  */
       
    65 MsnSlpLink *msn_session_find_slplink(MsnSession *session,
       
    66 									 const char *who);
       
    67 
       
    68 /**
       
    69  * @return An MsnSlpLink for the given user.  One will be created if
       
    70  *         it does not already exist.
       
    71  */
       
    72 MsnSlpLink *msn_session_get_slplink(MsnSession *session, const char *username);
       
    73 
       
    74 void msn_slplink_add_slpcall(MsnSlpLink *slplink, MsnSlpCall *slpcall);
       
    75 void msn_slplink_remove_slpcall(MsnSlpLink *slplink, MsnSlpCall *slpcall);
       
    76 MsnSlpCall *msn_slplink_find_slp_call(MsnSlpLink *slplink,
       
    77 									  const char *id);
       
    78 MsnSlpCall *msn_slplink_find_slp_call_with_session_id(MsnSlpLink *slplink, long id);
       
    79 MsnP2PVersion msn_slplink_get_p2p_version(MsnSlpLink *slplink);
       
    80 
       
    81 void msn_slplink_queue_slpmsg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg);
       
    82 void msn_slplink_send_slpmsg(MsnSlpLink *slplink,
       
    83 							 MsnSlpMessage *slpmsg);
       
    84 void msn_slplink_send_queued_slpmsgs(MsnSlpLink *slplink);
       
    85 void msn_slplink_process_msg(MsnSlpLink *slplink, MsnSlpMessagePart *part);
       
    86 
       
    87 /* Only exported for msn_xfer_write */
       
    88 void msn_slplink_send_msgpart(MsnSlpLink *slplink, MsnSlpMessage *slpmsg);
       
    89 
       
    90 void msn_slplink_request_object(MsnSlpLink *slplink,
       
    91 								const char *info,
       
    92 								MsnSlpCb cb,
       
    93 								MsnSlpEndCb end_cb,
       
    94 								const MsnObject *obj);
       
    95 
       
    96 MsnSlpCall *msn_slp_process_msg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg);
       
    97 
       
    98 #endif /* MSN_SLPLINK_H */