diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-03-10 20:44:18 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-03-10 20:44:18 +0000 |
commit | a39b92f278f6d1530cb151875b445185951634df (patch) | |
tree | 3adaf003614915d78c38782a51353690f9136852 /src/autotraceformats.h | |
download | potracegui-a39b92f278f6d1530cb151875b445185951634df.tar.gz potracegui-a39b92f278f6d1530cb151875b445185951634df.zip |
Added KDE3 version of POTraceGUI
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/potracegui@1101754 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/autotraceformats.h')
-rw-r--r-- | src/autotraceformats.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/autotraceformats.h b/src/autotraceformats.h new file mode 100644 index 0000000..00359d8 --- /dev/null +++ b/src/autotraceformats.h @@ -0,0 +1,86 @@ +/*************************************************************************** + * Copyright (C) 2004 by Antonio Fasolato * + * Antonio.Fasolato@poste.it * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef AUTOTRACEFORMATS_H +#define AUTOTRACEFORMATS_H + +#include <qobject.h> +#include <qstringlist.h> +#include <qprocess.h> + +//! Class to read autotrace input and output formats +/** This class executes autotrace to gain informations about the formats it can use + * \author Antonio Fasolato + */ +class AutotraceFormats : public QObject +{ +Q_OBJECT +public: + //! Standard QObject-like constructor + /** The constructor, nothing fancy + * \param parent The parent of the QObject + * \param name The name of the QObject + */ + AutotraceFormats(QObject *parent = 0, const char *name = 0); + //!Returns the list of supported input formats + /** This class returns the list of formats returned by <code>autotrace -list-input-formats</code> + * \return The supported formats + */ + QStringList inputFormats(); + //!Returns the list of supported output formats + /** This class returns the list of formats returned by <code>autotrace -list-output-formats</code> + * \return The supported formats + */ + QStringList outputFormats(); + //! Function to test the execution of autotrace + /** This functions returns <code>true</code> if the autotrace command could be run succesfully. If it returns + * <code>false</code> autotrace executable can not be found in the environment + * \return <code>true</code> if autotrace ran, <code>false</code> otherways + */ + bool OK(); + //! Tests if the class has ended its work + /** This class tests if the autotrace processes ended, thus completing the formats listing + * \return <code>true</code> if the processes has ended, <code>false</code> otherways + */ + bool done(); + +private: + //! The process to get input formats + QProcess *inputProcess; + //! The process to get output formats + QProcess *outputProcess; + //! The list of input formats + QStringList input; + //! The list of output formats + QStringList output; + //! <code>true</code> if autotrace could be run + bool allOK; + +private slots: + //! Reads from inputProcess stderr + /** Reads, when possible, the output of AutotraceFormats::inputProcess + */ + void inputRead(); + //! Reads from outputProcess stderr + /** Reads, when possible, the output of AutotraceFormats::outputProcess + */ + void outputRead(); +}; + +#endif |