#ifndef K9ASSISTANT_H
#define K9ASSISTANT_H

#include <QWizard>
#include <QWizardPage>
#include "k9dvd.h"
#include "k9cddrive.h"

class k9astSource;
class k9astDestination;
class k9astTitles;
class k9astStreams;
class k9astDVDOption;
class k9astMpeg;
class k9astMp4;

enum eDestination {dstDVD,dstAvi,dstMpeg,dstIso,dstFolder,dstAudio};

class k9Assistant:public QWizard {
Q_OBJECT
public:
    k9Assistant(QWidget *parent);
    static k9Assistant * createAssistant(){return new k9Assistant(NULL);}
    void run();
    void setDestination(const eDestination& theValue) {
        m_destination = theValue;
    }
    eDestination destination() const {
        return m_destination;
    }
            void setCopyMenus(bool theValue) {
        m_copyMenus = theValue;
    }


    bool copyMenus() const {
        return m_copyMenus;
    }

    void setPath(const QString& theValue) {
        m_path = theValue;
    }


    QString path() const {
        return m_path;
    }

    void setDVDdestination(const eDestination& theValue) {
        m_DVDdestination = theValue;
    }


    eDestination DVDdestination() const {
        return m_DVDdestination;
    }
    k9DVD *getDvd() { return &m_dvd;}
public:
    virtual bool validateCurrentPage() ;
    virtual int nextId() const;
    void back();
    void accept();
private:
    enum {page_source,page_destination,page_titles,page_streams,page_DVDOption,page_mpeg,page_mp4};

    k9CdDrives *m_drives;
    k9astSource *m_astSource;
    QWizardPage *m_sourcePage;

    k9astDestination *m_astDestination;
    QWizardPage *m_destinationPage;

    k9astTitles *m_astTitles;
    QWizardPage *m_titlesPage;

    k9astStreams *m_astStreams;
    QWizardPage *m_streamsPage;

    k9astDVDOption *m_astDVDOption;
    QWizardPage *m_DVDOptionPage;

    k9astMpeg *m_astMpeg;
    QWizardPage *m_mpegPage;

    k9astMp4 *m_astMp4;
    QWizardPage *m_mp4Page;

    k9DVD m_dvd;

    eDestination m_destination;
    eDestination m_DVDdestination;
    bool m_copyMenus;
    QString m_path;
protected:
    void cleanupPage(int id);

private slots:
    void customButtonClicked ( int which ) ;
    void helpRequested();
};

#endif // K9ASSISTANT_H
