//////////////////////////////////////////////////////////////         
//      $Id: procbuf.h,v 1.6 2002/04/22 18:48:35 arbab Exp $ 
//
// Author: Toivo Pedaste
//
#include "../config.h"
#include <kprocess.h>
#include <kdialog.h> 
#include <qobject.h> 
#include <qtimer.h>

#ifndef PROCBUF
#define PROCBUF

class Modal : public KDialog {
  Q_OBJECT
public:
  Modal(QString msg, QWidget *parent, const char * name );
  void terminate();
};

class procbuf: public QObject
{
  Q_OBJECT

public:
  procbuf();
  ~procbuf();
  void setup(QString);
  int start(QString  msg, bool errorDlg = TRUE,
	    int timeout=0, QString timeMsg = "");

  QString buf;
  KProcess *proc; 
  Modal *m;
  QString command;
  bool timed;
  QTimer *tm;

public slots:
  void slotReadInfo(KProcess *, char *, int);
  void slotExited(KProcess *);
  void slotTimeout();
};
#endif
