/***************************************************************************
 *   Copyright (C) 2005 by xavier helluy   *
 *   xavier.helluy@web.de   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA.             *
 ***************************************************************************/
#ifndef SERVERCLIENT_H
#define SERVERCLIENT_H

// #include <ksocketdevice.h>
#include <kstreamsocket.h>
#include "marshallinghelper.h"

/**
@author xavier helluy
*/
class ServerClient 
{
	public:
		ServerClient();
		~ServerClient();
		
		bool  getSignal(const QString  str);
		
		int  sendSignal(const QString  str);
		
		int  readBlockFromSocket( );
		
		int  readBlockFromSocket( QByteArray &dataArray );
		
		int  readBlockFromSocket(  QByteArray &dataArray , const int & BlockLength);
		
		int  writeBlockToSocket(  const QByteArray &dataArray );
		
		int  writeBlockToSocket( const QByteArray &dataArray , const int & BlockLength , const uint & QByteArrayStartPosition);
    
		int BigRawDataServerToCLient( const QByteArray &dataArray , const int & BufferSize);
   
		int  BigRawDataClientToServer(  QByteArray &dataArray);
					      
// 		KNetwork::KSocketDevice *  m_socket;
		KNetwork::KStreamSocket * m_socket;
};

#endif
