00001 #ifndef DATACHAPTER_H
00002 #define DATACHAPTER_H
00003
00004 #include <QString>
00005 #include <QList>
00006 #include <QDomElement>
00007 #include <QDomDocument>
00008 #include <QObject>
00009 #include "dataexercise.h"
00010
00012
00016 class DataChapter: public QObject
00017 {
00018 Q_OBJECT
00019
00020 public:
00021 QList<DataExercise *> exercises() { return exerciseList; }
00022 QString name() { return chapterName; }
00023 uint id() { return chapterId; }
00024 void setId(uint id) { chapterId = id; }
00025 void setChapterName(QString name) { chapterName = name; }
00026 DataExercise* exercise(QString exerciseName);
00027
00028 void addExercise(DataExercise *ex);
00029
00031 void hash(unsigned int &startValue);
00033 bool loadDataNode(const QDomNode data);
00035 QDomElement saveDataNode(QDomDocument* xml);
00036
00037 DataChapter();
00038 ~DataChapter();
00039
00040 public slots:
00041 void dataChanged() { emit changed(); }
00042
00043 signals:
00044 void changed();
00045
00046 private:
00047 QString chapterName;
00048 uint chapterId;
00049 QList<DataExercise *> exerciseList;
00050 };
00051
00052 #endif // DATACHAPTER_H