/****************************************************************************
** Form interface generated from reading ui file 'dialoggenerate.ui'
**
** Created: Fri Jan 23 09:12:57 2004
**      by: The User Interface Compiler ($Id: dialogexecute.h,v 1.90 2006/03/16 04:56:11 qdvdauthor Exp $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#ifndef DIALOGEXECUTE_H
#define DIALOGEXECUTE_H

#include <qvariant.h>
#include <qdialog.h>
#include <qvaluelist.h>

#include "execute.h"
#include "utils.h"

class DVDMenu;

class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QPushButton;
class QTabWidget;
class QWidget;
class QFrame;
class QGroupBox;
class QLabel;
class QCheckBox;
class QComboBox;
class QScrollView;
class QDVDAuthorInit;

// Here we define the Interface from QDVDAuthor - class to the ExexcuteDialog.
class ExecuteInterface
{
public:
	 ExecuteInterface () { bShowBlock=true; };
	~ExecuteInterface () {};

	QString     qsBlockName;
	QColor      backgroundColor;

	// Okay, each line can have multiple command lines, to replace one if the other does not work.
	QStringList commentList;
	QValueList <QStringList> listCommandList;
	QValueList <int> listDefaults;
	QValueList <int> listBlockIDs;
	QValueList <QString> listKeywords;
	bool bShowBlock;
	// indicates which of the listCommandList represent a split to the next tool (transcode / MEncoder ...)
	QValueList <int> listSplitAt;	// if empty, then normal handling
};

class DialogExecute : public QDialog
{
    Q_OBJECT

public:
	 DialogExecute (QValueList<ExecuteInterface *>, bool b=true);
	~DialogExecute();
	
	void createManPages(QStringList &listOfCommandsUsed);
	void setInit (QDVDAuthorInit *);
	void returnFromRenderMenu    ();

protected:
	virtual void resizeEvent (QResizeEvent *);

	void createMainForm ();
	void createPreprocessing  ();
	void createDVDAuthorTab   (QValueList<ExecuteInterface *>);
	void createPostprocessing ();
	QString stripTags(QString);
	QString getToolsPath(QString);

	void createCommandBlock      (QWidget *, QGridLayout *, ExecuteInterface *, int, int);
	QGridLayout *createBlockFrame(QWidget *, QGridLayout *, ExecuteInterface *, int, int i=-1);
	void createStandardBlock     (QWidget *, QGridLayout *, ExecuteInterface *, int);
	void createTranscodeBlock    (ExecuteInterface *, int);

protected:	// member variables ...
	QValueList<QLabel *>		m_listCommentsWidget;
	QValueList<QWidget *>		m_listTranscodeFrames;
	QValueList<QComboBox *>         m_listTranscodeCombos;
	QValueList<QComboBox *>		m_listCommandsWidget;
	QValueList<QGroupBox *>		m_listGroupBox;
	QValueList<QCheckBox *>		m_listCheckBox;
	QValueList<QCheckBox *>		m_listCheckBox2;
	QValueList<QPushButton *>	m_listButtonWidgets;
	QValueList<QPushButton *>	m_listButtonEdit;
	QValueList<QPushButton *>	m_listButtonSetAsDefault;
	QValueList<int>                 m_listBlockID;	// used to find the correct Block in the ini - file.
	QValueList<int>                 m_listBlockExecuteInterface; // used to connect the generated commandblock to the source ExecuteInterface.
	QValueList<ExecuteInterface *>  m_listExecuteInterface;      // indexed by the above to fiund keywords ...
	QTabWidget* m_pTabWidget;
	QWidget* m_pTabExpert;

    QFrame* m_pFrameExplain;
    QLabel* m_pLabelExplain;

    QScrollView* m_pScrollView;
    QFrame* m_pScrollFrame;

    QPushButton* buttonHelp;
    QPushButton* buttonOk;
    QPushButton* buttonCancel;
    QPushButton* buttonExport;

protected:
    QGridLayout* DialogExecuteLayout;
    QHBoxLayout* Layout1;
    QGridLayout* tabLayout;
    QGridLayout* m_pScrollFrameLayout;
    QGridLayout* m_pGroupBoxLayout;
    QGridLayout* m_pFrameExplainLayout;

protected slots:
	virtual void languageChange           ( );
	virtual void slotOkay                 ( );
	virtual void slotExport               ( );
	virtual void slotHelp                 ( );
	virtual void slotManButtonClicked     ( );
	virtual void slotEditButtonClicked    ( );
	virtual void slotDefaultButtonClicked ( );
	virtual void slotTabChanged ( QWidget * );
	virtual void slotCheckBlock ( bool      );
	virtual void slotRenderMenu ( QString   );
	virtual void slotTranscodeSelectionChanged (int);

signals:
	void signalGenerateMasks ();
	void signalRenderMenu (QString);

private:
	int             m_iTranscodeOffset;
	QWidget        *m_pTranscodeParent;
	QGridLayout    *m_pTranscodeLayout;
	Execute		m_doSomething;
	QDVDAuthorInit *m_pInitObject;
	QValueList <Utils::toolsPaths *> m_listToolsPaths;
};

#endif // DIALOGEXECUTE_H


