00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef QTS_DOCUMENT_H
00022 #define QTS_DOCUMENT_H
00023
00024 #include <qfileinfo.h>
00025
00026 #include "qts_graphic.h"
00027 #include "qts_table.h"
00028
00032 class QTS_Document: public QObject {
00033 Q_OBJECT
00034
00035 public:
00036 QTS_Document();
00037 ~QTS_Document();
00038
00039 void newDoc();
00040 bool save();
00041 bool saveAs(const QString &filename);
00042 bool load(const QString &filename);
00043 bool isModified() const;
00045 QTS_Table* getTable() {
00046 return table;
00047 }
00049 QTS_Graphic* getGraphic() {
00050 return graphic;
00051 }
00053 RS_Graphic* getMarking() {
00054 return marking;
00055 }
00057 RS_Graphic* getContainer() {
00058 return container;
00059 }
00060
00061 QString getFilename() const {
00062 return filename;
00063 }
00064
00065 QString getFilename(const QString& ext) {
00066 QString path = QFileInfo(filename).dirPath(true);
00067 QString base = QFileInfo(filename).baseName(true);
00068 return path + "/" + base + "." + ext;
00069 }
00070
00071 signals:
00072 void documentChanged();
00073
00074 protected:
00075 bool modified;
00076
00077 private:
00079 QTS_Graphic* container;
00081 QTS_Graphic* graphic;
00083 RS_Graphic* marking;
00085 QTS_Table* table;
00087 QString filename;
00088
00089 };
00090
00091
00092 #endif
00093