#ifndef PRINT_ENGINE_H
#define PRINT_ENGINE_H
#include "session_wizard.h"
#include "mtlistwidget.h"
#include "mttablewidget.h"
#include "mtspinbox.h"
#include <QCheckBox>
#include <QSpinBox>
#include <QHeaderView>
class PrintQuestionsDialogue : public QWidget
{
Q_OBJECT
public:
PrintQuestionsDialogue(MainWindow *);
MTTableWidget * includeTableWidget() { return printq_includelist; };
bool flagsSelected() { return rbtngrpPrintqSelect->checkedButton()->text() == tr("Flags"); };
bool questionsSelected() { return rbtngrpPrintqSelect->checkedButton()->text() == tr("Questions"); };
bool printStatistics() { return printTest() ? false : printq_advanced_statistics->isChecked(); };
bool printFormatting() { return printTest() ? true : printq_advanced_formatting->isChecked(); };
bool printTest() { return printq_advanced_test->isChecked(); };
bool printKey() { return printTest() ? printq_advanced_key->isChecked() : false; };
bool printGraphics() { return printq_advanced_graphics->isChecked(); };
bool randomise() { return printq_advanced_randomise->isChecked(); };
int numPrintouts() { return randomise() ? printq_advanced_numprintouts->value() : 1; };
bool useGroups() { return printTest() ? printq_advanced_usegroups->isChecked() : false; };
int numQuestions() { return printq_advanced_numquestions->value(); };
private slots:
void addQuestionToPrint();
void removeQuestionToPrint();
void addAllQuestionsToPrint();
void togglePrintSelection(QAbstractButton *);
void togglePrintEnabled();
void resetDefaultValues();
void updateTestQnum();
void printQuestions();
private:
void addQuestionToPrint(int);
MTListWidget * printq_excludelist;
MTTableWidget * printq_includelist;
QPushButton * printq_btn_print;
QButtonGroup * rbtngrpPrintqSelect;
QCheckBox * printq_advanced_statistics;
QCheckBox * printq_advanced_formatting;
QCheckBox * printq_advanced_test;
QCheckBox * printq_advanced_key;
QCheckBox * printq_advanced_graphics;
QCheckBox * printq_advanced_randomise;
QSpinBox * printq_advanced_numprintouts;
QCheckBox * printq_advanced_usegroups;
MTSpinBox * printq_advanced_numquestions;
MainWindow * printq_parent;
};
#endif