/*************************************************************************** * 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 #include #include //! 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 TQObject { TQ_OBJECT public: //! Standard TQObject-like constructor /** The constructor, nothing fancy * \param parent The parent of the TQObject * \param name The name of the TQObject */ AutotraceFormats(TQObject *parent = 0, const char *name = 0); //!Returns the list of supported input formats /** This class returns the list of formats returned by autotrace -list-input-formats * \return The supported formats */ TQStringList inputFormats(); //!Returns the list of supported output formats /** This class returns the list of formats returned by autotrace -list-output-formats * \return The supported formats */ TQStringList outputFormats(); //! Function to test the execution of autotrace /** This functions returns true if the autotrace command could be run succesfully. If it returns * false autotrace executable can not be found in the environment * \return true if autotrace ran, false 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 true if the processes has ended, false otherways */ bool done(); private: //! The process to get input formats TQProcess *inputProcess; //! The process to get output formats TQProcess *outputProcess; //! The list of input formats TQStringList input; //! The list of output formats TQStringList output; //! true 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