QTimeSeries Homepage

Main Page   Alphabetical List   Compound List   File List   Compound Members  

qts_document.h

00001 /*****************************************************************************
00002 **  $Id: qts_document.h,v 1.3 2002/10/07 22:47:17 andrew23 Exp $
00003 **
00004 **  This is part of the QCad GUI
00005 **  Copyright (C) 2001 Andrew Mustun
00006 **
00007 **  This program is free software; you can redistribute it and/or modify
00008 **  it under the terms of the GNU General Public License (version 2) as
00009 **  published by the Free Software Foundation.
00010 **
00011 **  This program is distributed in the hope that it will be useful,
00012 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 **  GNU General Public License for more details.
00015 **
00016 **  You should have received a copy of the GNU General Public License
00017 **  along with this program; if not, write to the Free Software
00018 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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 

Copyright © 2002, Andrew Mustun <andrew@mustun.com>. All rights reserved.
System documentation was generated using doxygen.