/***************************************************************************
                          CdboCompilationView.h  -  description
                             -------------------
    begin                : Sun Nov 18 2001
    copyright            : (C) 2001 by Alex Podolsky
    email                : alexpod@users.sf.net
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/


#ifndef CDBOCOMPILATIONVIEW_H
#define CDBOCOMPILATIONVIEW_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

// include files for Qt
#include <qwidget.h>
#include <qgrid.h>
#include <kio/job.h>


// forward declaration of the CdboCompilationView classes
class TargetTreeCntPanel;
class EstimatePnl;
class CompilationTreeView;

class KProcess;

class CdboCompilationView : public QGrid{
  Q_OBJECT
public:
    /** Constructor for the main view */
    CdboCompilationView(QWidget *parent = 0, const char *name=0);
    /** Destructor for the main view */
    ~CdboCompilationView();
		
	static const int InfoSettings= 0;
	static const int DevicesSettings  = 1;
	static const int RecordSettings = 2;
	static const int ImageSettings = 3;
	static const int VideoSettings = 5;
	static const int DefaultSettings = 6;
	static const int AudioSettings = 7;

	virtual QWidget* getView() = 0;
	
public slots:
	virtual void showTargetControl(bool);
	virtual void showEstimate(bool);

	bool save();
	bool saveAs();
	void saveRemoveAndLoad(QString fileToOpen);
	bool saveAndRemove();
	/** removeAll in this interface does not remove the actual entries from the view */
	virtual void removeAll();

	void popUpSettings(int type);
	virtual void emitGotCaption() = 0;
	void contentsModified();

signals:
	void gotCaption(const QString &, bool);


protected slots:
	void kcmshellDone(KProcess *proc);

protected:
	virtual bool isEmpty() = 0;
	virtual void doSave(QString fileToOpen) = 0;
	virtual void doLoad(QString fileToOpen) = 0;
	virtual QWidget* getControl() = 0;
	virtual QWidget* getEstimate() = 0;
	virtual int getSize() = 0;


	bool checkDirSize();
	void showEmptyError();
	bool checkOverwrite(QString fName);

	bool saved;
	QString listFileName;
	
};

#endif // CDBOCOMPILATIONVIEW_H
