QtiPlot 0.9.8.2
ImportExportPlugin.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     File                 : ImportExportPlugin.h
00003     Project              : QtiPlot
00004     --------------------------------------------------------------------
00005     Copyright            : (C) 2011 by Ion Vasilief
00006     Email (use @ for *)  : ion_vasilief*yahoo.fr
00007     Description          : Base class for import/export plugins
00008 
00009  ***************************************************************************/
00010 
00011 /***************************************************************************
00012  *                                                                         *
00013  *  This program is free software; you can redistribute it and/or modify   *
00014  *  it under the terms of the GNU General Public License as published by   *
00015  *  the Free Software Foundation; either version 2 of the License, or      *
00016  *  (at your option) any later version.                                    *
00017  *                                                                         *
00018  *  This program is distributed in the hope that it will be useful,        *
00019  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
00020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
00021  *  GNU General Public License for more details.                           *
00022  *                                                                         *
00023  *   You should have received a copy of the GNU General Public License     *
00024  *   along with this program; if not, write to the Free Software           *
00025  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
00026  *   Boston, MA  02110-1301  USA                                           *
00027  *                                                                         *
00028  ***************************************************************************/
00029 #ifndef INTERFACES_H
00030 #define INTERFACES_H
00031 
00032 #include <QtPlugin>
00033 #include <ApplicationWindow.h>
00034 
00035 class QStringList;
00036 
00037 class ImportExportPlugin
00038 {
00039 public:
00040     virtual ~ImportExportPlugin(){}
00041 
00042     virtual QStringList importFormats(){return QStringList();};
00043     virtual Table* import(const QString & /*fileName*/, int /*sheet*/ = -1){return 0;}
00044 
00045     virtual QStringList exportFormats() const {return QStringList();};
00046     virtual bool exportTable(Table *, const QString& /*fname*/, bool /*withLabels*/, bool /*exportComments*/, bool /*exportSelection*/){return false;}
00047     virtual bool exportMatrix(Matrix *, const QString& /*fname*/, bool /*exportSelection*/){return false;}
00048     virtual bool exportGraph(Graph *, const QString& /*fname*/, const QSizeF& /*customSize*/, int /*unit*/, double /*fontsFactor*/ = 1){return false;}
00049     virtual bool exportMultiLayerPlot(MultiLayer *, const QString& /*fname*/, const QSizeF& /*customSize*/, int /*unit*/, double /*fontsFactor*/ = 1){return false;}
00050 
00051     void setApplicationWindow(ApplicationWindow *app){d_app = app;};
00052     ApplicationWindow *applicationWindow(){return d_app;};
00053 
00054 private:
00055     ApplicationWindow *d_app;
00056 };
00057 
00058 Q_DECLARE_INTERFACE(ImportExportPlugin, "com.ProIndependent.QtiPlot.ImportExportPlugin/1.0")
00059 #endif