Chris@148: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
Chris@148: 
Chris@148: /*
Chris@148:     Sonic Visualiser
Chris@148:     An audio file viewer and annotation editor.
Chris@148:     Centre for Digital Music, Queen Mary, University of London.
Chris@148:     This file copyright 2006 Chris Cannam.
Chris@148:     
Chris@148:     This program is free software; you can redistribute it and/or
Chris@148:     modify it under the terms of the GNU General Public License as
Chris@148:     published by the Free Software Foundation; either version 2 of the
Chris@148:     License, or (at your option) any later version.  See the file
Chris@148:     COPYING included with this distribution for more information.
Chris@148: */
Chris@148: 
cannam@1452: #ifndef SV_CSV_FILE_WRITER_H
cannam@1452: #define SV_CSV_FILE_WRITER_H
Chris@148: 
Chris@148: #include <QObject>
Chris@148: #include <QString>
Chris@148: 
Chris@1063: #include "base/DataExportOptions.h"
Chris@1063: 
Chris@148: class Model;
Chris@839: class MultiSelection;
dev@1435: class ProgressReporter;
Chris@148: 
Chris@148: class CSVFileWriter : public QObject
Chris@148: {
Chris@148:     Q_OBJECT
Chris@148: 
Chris@148: public:
Chris@1063:     CSVFileWriter(QString path,
Chris@1063:                   Model *model,
Chris@1063:                   QString delimiter = ",",
Chris@1063:                   DataExportOptions options = DataExportDefaults);
dev@1435: 
dev@1438:     CSVFileWriter(QString path,
dev@1438:                   Model *model,
dev@1438:                   ProgressReporter *reporter,
dev@1438:                   QString delimiter = ",",
dev@1438:                   DataExportOptions options = DataExportDefaults) 
dev@1438:     : CSVFileWriter(path, model, delimiter, options)
dev@1435:     {
dev@1435:         m_reporter = reporter;
dev@1435:     }
Chris@148:     virtual ~CSVFileWriter();
Chris@148: 
Chris@148:     virtual bool isOK() const;
Chris@148:     virtual QString getError() const;
Chris@148: 
Chris@148:     virtual void write();
cannam@1452:     virtual void writeSelection(MultiSelection selection);
Chris@148: 
Chris@148: protected:
Chris@148:     QString m_path;
Chris@148:     Model *m_model;
Chris@148:     QString m_error;
Chris@148:     QString m_delimiter;
Chris@1063:     DataExportOptions m_options;
dev@1439:     ProgressReporter *m_reporter = nullptr;
Chris@148: };
Chris@148: 
Chris@148: #endif
Chris@148: 
Chris@148: