QGpGuiTools/ColumnTextWidget.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of QGpGuiTools.
00004 **
00005 **  This library is free software; you can redistribute it and/or
00006 **  modify it under the terms of the GNU Lesser General Public
00007 **  License as published by the Free Software Foundation; either
00008 **  version 2.1 of the License, or (at your option) any later version.
00009 **
00010 **  This file is distributed in the hope that it will be useful, but WITHOUT
00011 **  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 **  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
00013 **  License for more details.
00014 **
00015 **  You should have received a copy of the GNU Lesser General Public
00016 **  License along with this library; if not, write to the Free Software
00017 **  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00018 **
00019 **  See http://www.geopsy.org for more information.
00020 **
00021 **  Created : 2008-07-11
00022 **  Authors :
00023 **    Marc Wathelet
00024 **    Marc Wathelet (LGIT, Grenoble, France)
00025 **
00026 ***************************************************************************/
00027 
00028 #ifndef COLUMNTEXTWIDGET_H
00029 #define COLUMNTEXTWIDGET_H
00030 
00031 #include <QGpCoreTools.h>
00032 
00033 #include "ui_ColumnTextWidget.h"
00034 #include "QGpGuiToolsDLLExport.h"
00035 
00036 namespace QGpGuiTools {
00037 
00038 class QGPGUITOOLS_EXPORT ColumnTextWidget : public QWidget, private Ui::ColumnTextWidget
00039 {
00040   Q_OBJECT
00041 public:
00042   ColumnTextWidget(QWidget * parent=0);
00043   ~ColumnTextWidget();
00044 
00045   bool setFile(const QString& fileName);
00046   bool setBuffer(const QString& str);
00047   void setParserFile(const QString& p);
00048   void setStandardTypes(const QStringList& t);
00049   void setTypes(const QVector<int>& t);
00050   void parse(bool ignoreParserFile);
00051 
00052   void restoreParserSettings(QString keyName);
00053   void saveParserSettings(QString keyName);
00054 
00055   const ColumnTextParser * parser() const {return _parser;}
00056   ColumnTextParser * parser() {return _parser;}
00057 private slots:
00058   void on_parserName_editTextChanged(const QString& text);
00059   void on_linesBut_clicked();
00060   void on_columnsBut_clicked();
00061   void on_sectionsBut_clicked();
00062   void on_loadBut_clicked();
00063   void on_saveBut_clicked();
00064   void restoreColumnWidths();
00065 signals:
00066   void typeChanged();
00067 private:
00068   QFile * _file;
00069   QString * _buffer;
00070   ColumnTextParser * _parser;
00071   QString _parserFile;
00072   QString _restoreColumnWidth;
00073 };
00074 
00075 } // namespace QGpGuiTools
00076 
00077 #endif // COLUMNTEXTWIDGET_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines