00001 /****************************************************************************************************** 00002 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released * 00003 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file * 00004 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. * 00005 ******************************************************************************************************/ 00006 00007 #ifndef DOCUMENT_MODEL_EXPORT_FORMAT_H 00008 #define DOCUMENT_MODEL_EXPORT_FORMAT_H 00009 00010 #include "DocumentModelAbstractBase.h" 00011 #include "ExportDelimiter.h" 00012 #include "ExportHeader.h" 00013 #include "ExportLayoutFunctions.h" 00014 #include "ExportPointsIntervalUnits.h" 00015 #include "ExportPointsSelectionFunctions.h" 00016 #include "ExportPointsSelectionRelations.h" 00017 #include <QStringList> 00018 00019 class Document; 00020 class QTextStream; 00021 00023 class DocumentModelExportFormat : public DocumentModelAbstractBase 00024 { 00025 public: 00027 DocumentModelExportFormat(); 00028 00030 DocumentModelExportFormat(const Document &document); 00031 00033 DocumentModelExportFormat(const DocumentModelExportFormat &other); 00034 00036 DocumentModelExportFormat &operator=(const DocumentModelExportFormat &other); 00037 00039 QStringList curveNamesNotExported() const; 00040 00042 ExportDelimiter delimiter() const; 00043 00045 ExportHeader header() const; 00046 00048 ExportLayoutFunctions layoutFunctions() const; 00049 00050 virtual void loadXml(QXmlStreamReader &reader); 00051 00053 bool overrideCsvTsv () const; 00054 00056 double pointsIntervalFunctions () const; 00057 00059 double pointsIntervalRelations () const; 00060 00062 ExportPointsIntervalUnits pointsIntervalUnitsFunctions () const; 00063 00065 ExportPointsIntervalUnits pointsIntervalUnitsRelations () const; 00066 00068 ExportPointsSelectionFunctions pointsSelectionFunctions() const; 00069 00071 ExportPointsSelectionRelations pointsSelectionRelations() const; 00072 00074 void printStream (QString indentation, 00075 QTextStream &str) const; 00076 00077 virtual void saveXml(QXmlStreamWriter &writer) const; 00078 00080 void setCurveNamesNotExported(const QStringList &curveNamesNotExported); 00081 00083 void setDelimiter(ExportDelimiter exportDelimiter); 00084 00086 void setHeader(ExportHeader exportHeader); 00087 00089 void setLayoutFunctions(ExportLayoutFunctions exportLayoutFunctions); 00090 00092 void setOverrideCsvTsv (bool overrideCsvTsv); 00093 00095 void setPointsIntervalFunctions (double pointsIntervalFunctions); 00096 00098 void setPointsIntervalRelations (double pointsIntervalRelations); 00099 00101 void setPointsIntervalUnitsFunctions (ExportPointsIntervalUnits pointsIntervalUnitsFunctions); 00102 00104 void setPointsIntervalUnitsRelations (ExportPointsIntervalUnits pointsIntervalUnitsRelations); 00105 00107 void setPointsSelectionFunctions(ExportPointsSelectionFunctions exportPointsSelectionFunctions); 00108 00110 void setPointsSelectionRelations(ExportPointsSelectionRelations exportPointsSelectionRelations); 00111 00113 void setXLabel (const QString &xLabel); 00114 00116 QString xLabel () const; 00117 00118 private: 00119 00120 // Curves to be excluded from export. New curves will not appear in this so they will be exported by default. 00121 QStringList m_curveNamesNotExported; 00122 00123 ExportPointsSelectionFunctions m_pointsSelectionFunctions; 00124 double m_pointsIntervalFunctions; 00125 ExportPointsIntervalUnits m_pointsIntervalUnitsFunctions; 00126 ExportPointsSelectionRelations m_pointsSelectionRelations; 00127 double m_pointsIntervalRelations; 00128 ExportPointsIntervalUnits m_pointsIntervalUnitsRelations; 00129 ExportLayoutFunctions m_layoutFunctions; 00130 ExportDelimiter m_delimiter; 00131 bool m_overrideCsvTsv; 00132 ExportHeader m_header; 00133 QString m_xLabel; 00134 }; 00135 00136 #endif // DOCUMENT_MODEL_EXPORT_FORMAT_H