Frameworks/libpurple.framework/Versions/2.10.12r8d2874a79747/Headers/cmdproc.h
branchadium-1.5.11
changeset 6014 fcb71cb71a3d
parent 5941 307f53385811
parent 6013 f8d0dc659e3f
child 6016 325e2ab3406f
equal deleted inserted replaced
5941:307f53385811 6014:fcb71cb71a3d
     1 /**
       
     2  * @file cmdproc.h MSN command processor functions
       
     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_CMDPROC_H
       
    25 #define MSN_CMDPROC_H
       
    26 
       
    27 typedef struct _MsnCmdProc MsnCmdProc;
       
    28 
       
    29 #include "command.h"
       
    30 #include "history.h"
       
    31 #include "servconn.h"
       
    32 #include "session.h"
       
    33 #include "table.h"
       
    34 
       
    35 struct _MsnCmdProc
       
    36 {
       
    37 	MsnSession *session;
       
    38 	MsnServConn *servconn;
       
    39 
       
    40 	GQueue *txqueue;
       
    41 
       
    42 	MsnCommand *last_cmd;
       
    43 
       
    44 	MsnTable *cbs_table;
       
    45 
       
    46 	MsnHistory *history;
       
    47 
       
    48 	GHashTable *multiparts; /**< Multi-part message ID's */
       
    49 
       
    50 	void *data; /**< Extra data, like the switchboard. */
       
    51 };
       
    52 
       
    53 /**
       
    54  * Creates a MsnCmdProc structure.
       
    55  *
       
    56  * @param session 	The session to associate with.
       
    57  *
       
    58  * @return A new MsnCmdProc structure.
       
    59  */
       
    60 MsnCmdProc *msn_cmdproc_new(MsnSession *session);
       
    61 
       
    62 /**
       
    63  * Destroys an MsnCmdProc.
       
    64  *
       
    65  * @param cmdproc 	The object structure.
       
    66  */
       
    67 void msn_cmdproc_destroy(MsnCmdProc *cmdproc);
       
    68 
       
    69 /**
       
    70  * Process the queued transactions.
       
    71  *
       
    72  * @param cmdproc 	The MsnCmdProc.
       
    73  */
       
    74 void msn_cmdproc_process_queue(MsnCmdProc *cmdproc);
       
    75 
       
    76 /**
       
    77  * Sends transaction using this servconn.
       
    78  *
       
    79  * @param cmdproc 	The MsnCmdProc to be used.
       
    80  * @param trans 	The MsnTransaction to be sent.
       
    81  */
       
    82 gboolean msn_cmdproc_send_trans(MsnCmdProc *cmdproc, MsnTransaction *trans);
       
    83 
       
    84 /**
       
    85  * Add a transaction to the queue to be processed latter.
       
    86  *
       
    87  * @param cmdproc 	The MsnCmdProc in which the transaction will be queued.
       
    88  * @param trans 	The MsnTransaction to be queued.
       
    89  */
       
    90 void msn_cmdproc_queue_trans(MsnCmdProc *cmdproc,
       
    91 							 MsnTransaction *trans);
       
    92 
       
    93 void msn_cmdproc_process_msg(MsnCmdProc *cmdproc,
       
    94 							 MsnMessage *msg);
       
    95 void msn_cmdproc_process_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd);
       
    96 void msn_cmdproc_process_cmd_text(MsnCmdProc *cmdproc, const char *command);
       
    97 void msn_cmdproc_process_payload(MsnCmdProc *cmdproc,
       
    98 								 char *payload, int payload_len);
       
    99 
       
   100 #endif /* MSN_CMDPROC_H */