kitchensync

pluckerprocesshandler.h

00001 /*
00002     This file is part of KitchenSync.
00003 
00004     Copyright (c) 2004 Holger Hans Peter Freyther <freyther@kde.org>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019 */
00020 
00021 
00022 #ifndef KS_PLUCKER_PROCESS_HANDLER_H
00023 #define KS_PLUCKER_PROCESS_HANDLER_H
00024 
00025 #include <kprocess.h>
00026 
00027 #include <qobject.h>
00028 #include <qstringlist.h>
00029 
00030 namespace KSPlucker {
00031 class PluckerProcessHandler : public QObject 
00032 {
00033     Q_OBJECT
00034 public:
00035     enum Mode {
00036         Configure,
00037         Convert
00038     };
00039     PluckerProcessHandler( enum Mode, bool forget,
00040                     const QString& file, QObject* parent = 0);
00041     PluckerProcessHandler( enum Mode, bool forget,
00042                     const QStringList& file, const QString& dest,
00043                     QObject* parent = 0);
00044     ~PluckerProcessHandler();
00045 
00046     void run();
00047 signals:
00048     void sigProgress( const QString& );
00049     void sigFinished( PluckerProcessHandler* );
00050 
00051 private:
00052     void runConfig (KProcess*);
00053     void runConvert(KProcess*);
00054     void popFirst();
00055     Mode m_mode;
00056     bool m_forget : 1;
00057     QString m_file;
00058     QString m_dir;
00059     QStringList m_files;
00060     bool m_useList : 1;
00061 private slots:
00062     void slotExited( KProcess* proc );
00063     void slotStdOutput(KProcess* proc, char *buffer,  int buflen );
00064 };
00065 }
00066 
00067 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys