/***************************************************************************
 *   Copyright (C) 2004 by ImoLUG Staff                                    *
 *   developers@imolug.org                                                 *
 *                                                                         *
 *   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.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef QTSWARET_H
#define QTSWARET_H

#include "qtswaretdlg.h"
#include <stdlib.h>
#include <qlineedit.h>
#include <qcombobox.h>
#include <qtextedit.h>
#include <qprocess.h>
#include <qtimer.h>
#include <qmessagebox.h>
#include <qlistview.h>
#include <qlistbox.h>
#include <qpushbutton.h>
#include <qprogressdialog.h>
#include <qtabwidget.h>
#include <qdir.h>

#define SWARETCONFIGFILE "/etc/swaret.conf"
#define SPICONFIGFILE "/etc/spi/spi.conf"
#define BINSPI "/usr/bin/spi"

class QtSwaret : public MainDlg
{
  Q_OBJECT

public:
  QtSwaret(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
  ~QtSwaret();
  /*$PUBLIC_FUNCTIONS$*/
  QProcess* proc; // Puntatore al processo
  QString* StdoutStr; // Stdout dei processi
  QProgressDialog* pd; // ProgressDialog che viene utilizzata in varie funzioni
  int ipd;  // Indice della barra di avanzamento della ProgressDialog
   
public slots:
  /*$PUBLIC_SLOTS$*/
  virtual void          InstallPacket();
  virtual void          RemovePacket();
  virtual void          Clear();
  virtual void          SearchPacket();
  //virtual void		SearchDescr();
  virtual void          UpgradePacket();
  virtual void          UpgradeAll();     
  virtual void          SaveConf(); 
  virtual void          Update();
  virtual void          ListInstalled();
  virtual void          PacketIsSelected();
  virtual void          AddExclude();
  virtual void          RemoveExclude();
  virtual void          AddMirror();
  virtual void          RemoveMirror();
  virtual void          AddRep();
  virtual void          RemoveRep();
  virtual void          AddDep();
  virtual void          RemoveDep();
  virtual void		ClearLogs();
  virtual void          Exit();  
  /*$OWN_SLOTS$*/
  virtual void		ReadShowOutput();
  
  virtual void		ReadSearchOutput();
  virtual void		ReadInstallOutput();
  virtual void		ReadRemoveOutput();
  virtual void		ReadUpgradeOutput();
  virtual void		ReadUpgradeAllOutput();
  virtual void		ReadUpdateOutput();
  virtual void		ProcFinished();
  virtual void		RemoveFinished();
  virtual void          KillProcesses();
  virtual void          DisableButtons();
  virtual void          EnableButtons();
  virtual void          ReadConfigFile();
  virtual void          WriteConfigFile();
  virtual void 		ReInstallPacket();
  virtual void 		FilenameSearch();
  virtual void 		FilenameSearchOutput();
  //virtual void ReadSPISearchOutput();
    virtual void SPIUpdt();
    virtual void listFiles();

    virtual void readSPIConfigFile();
 virtual void WriteSPIConfigFile();
    virtual void SPIDBBuild();
    virtual void SPILocalUPDT();
    virtual void readSwaretManual();
    virtual void killProcess();
    virtual void listUpgradable();
	virtual void listUpgradableOutput();
    virtual void readSPIManual();
    virtual void swaretRemove();
    virtual void listPatches();
    virtual void listPatchesOutput();
  
protected:
  /*$PROTECTED_FUNCTIONS$*/

protected slots:
  /*$PROTECTED_SLOTS$*/

};

#endif
