/***************************************************************************
                            kde_Connection.h -  description
                             -------------------
    begin                : Wed Feb  6 15:12:26 2002
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Feb  6 15:12:26 2002, using kalyptus 0.9.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This library is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 ***************************************************************************/

#ifndef KDE_CONNECTION
#define KDE_CONNECTION

#include <qtc/qtc_types.h>

#include <kdec/kde_types.h>

/**

 This class provides a simple means for IPC between two applications
 via a pipe.
 It handles a queue of commands to be sent which makes it possible to
 queue data before an actual connection has been established.
     
 @short 
 This class provides a simple means for IPC between two applications
 via a pipe.
*/
kde_Connection * kde_new_Connection();
void kde_del_Connection( kde_Connection* p );
void kde_Connection_init(kde_Connection* instPointer,kde_KSocket* sock);
void kde_Connection_init1(kde_Connection* instPointer,int fd_in, int fd_out);
void kde_Connection_connect(kde_Connection* instPointer,qt_QObject * receiver, char* member);
void kde_Connection_close(kde_Connection* instPointer);
int kde_Connection_fd_from(kde_Connection* instPointer);
int kde_Connection_fd_to(kde_Connection* instPointer);
int kde_Connection_inited(kde_Connection* instPointer);
void kde_Connection_send(kde_Connection* instPointer,int cmd, qt_QByteArray* arr);
int kde_Connection_sendnow(kde_Connection* instPointer,int _cmd, qt_QByteArray* data);

/** 
 Receive data

*/
int kde_Connection_read(kde_Connection* instPointer,int* _cmd, qt_QByteArray* arg1);

/** 
 Don't handle incoming data until resumed
         
*/
void kde_Connection_suspend(kde_Connection* instPointer);

/** 
 Resume handling of incoming data
         
*/
void kde_Connection_resume(kde_Connection* instPointer);

/** 
 Returns status of connection
         
*/
int kde_Connection_suspended(kde_Connection* instPointer);
void kde_Connection_dequeue(kde_Connection* instPointer);

#endif
