• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDECore

kprocess.h

Go to the documentation of this file.
00001 /*
00002     This file is part of the KDE libraries
00003 
00004     Copyright (C) 2007 Oswald Buddenhagen <ossi@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library 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 GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef KPROCESS_H
00023 #define KPROCESS_H
00024 
00025 #include <kdecore_export.h>
00026 
00027 #include <QtCore/QProcess>
00028 
00029 class KProcessPrivate;
00030 
00042 class KDECORE_EXPORT KProcess : public QProcess
00043 {
00044     Q_OBJECT
00045     Q_DECLARE_PRIVATE(KProcess)
00046 
00047 public:
00048 
00052     enum OutputChannelMode {
00053         SeparateChannels = QProcess::SeparateChannels,
00056         MergedChannels = QProcess::MergedChannels,
00059         ForwardedChannels = QProcess::ForwardedChannels,
00062         OnlyStdoutChannel,
00064         OnlyStderrChannel  
00065     };
00066 
00070     explicit KProcess(QObject *parent = 0);
00071 
00075     virtual ~KProcess();
00076 
00088     void setOutputChannelMode(OutputChannelMode mode);
00089 
00095     OutputChannelMode outputChannelMode() const;
00096 
00106     void setNextOpenMode(QIODevice::OpenMode mode);
00107 
00118     void setEnv(const QString &name, const QString &value, bool overwrite = true);
00119 
00127     void unsetEnv(const QString &name);
00128 
00137     void clearEnvironment();
00138 
00148     void setProgram(const QString &exe, const QStringList &args = QStringList());
00149 
00156     void setProgram(const QStringList &argv);
00157 
00175     KProcess &operator<<(const QString& arg);
00176 
00183     KProcess &operator<<(const QStringList& args);
00184 
00188     void clearProgram();
00189 
00206     void setShellCommand(const QString &cmd);
00207 
00214     QStringList program() const;
00215 
00221     void start();
00222 
00240     int execute(int msecs = -1);
00241 
00252     static int execute(const QString &exe, const QStringList &args = QStringList(), int msecs = -1);
00253 
00263     static int execute(const QStringList &argv, int msecs = -1);
00264 
00279     int startDetached();
00280 
00289     static int startDetached(const QString &exe, const QStringList &args = QStringList());
00290 
00298     static int startDetached(const QStringList &argv);
00299 
00310     int pid() const;
00311 
00312 protected:
00316     KProcess(KProcessPrivate *d, QObject *parent);
00317 
00321     KProcessPrivate * const d_ptr;
00322 
00323 private:
00324     // hide those
00325     using QProcess::setReadChannelMode;
00326     using QProcess::readChannelMode;
00327     using QProcess::setProcessChannelMode;
00328     using QProcess::processChannelMode;
00329 
00330     Q_PRIVATE_SLOT(d_func(), void _k_forwardStdout())
00331     Q_PRIVATE_SLOT(d_func(), void _k_forwardStderr())
00332 };
00333 
00334 #endif
00335 

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   WTF
  • KJSEmbed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  •   core
  • Phonon
  •   Backend
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal