00001 #ifndef DATAEXERCISEVALIDATOR_H
00002 #define DATAEXERCISEVALIDATOR_H
00003
00004 #include <QObject>
00005 #include <QList>
00006 #include <QStringList>
00007 #include <QListIterator>
00008 #include "../Widgets/acombobox.h"
00009 #include "../Widgets/alineedit.h"
00010 #include "../Data/dataexercise.h"
00011 #include "../Data/dataaccountingrecord.h"
00012 #include "../Data/datadefinitions.h"
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00045 class DataExerciseValidator : public QObject
00046 {
00047 Q_OBJECT
00048
00049 public:
00050 DataExerciseValidator();
00051 bool everythingOk() { return this->_everythingOk; }
00052 void resetOk() { this->_everythingOk = true; }
00053
00054 public slots:
00055 void exerciseFinished(DataExercise *exercise, AccountingInformation *accountingRowInfos, QList<AccountingInformation> *listCredits, QList<AccountingInformation> *listDebits);
00056
00057 private:
00058 void validateAccountingRows(QList<QPair<int, double> *> *solution, QList<AccountingInformation> *list);
00059 void markWrong(AComboBox *combobox);
00060 void markWrong(ALineEdit *lineedit);
00061
00062 void markWidgetWrong(QWidget *widget);
00063
00064 bool _everythingOk;
00065 };
00066
00067 #endif // DATAEXERCISEVALIDATOR_H