• Skip to content
  • Skip to link menu
KDE 4.1 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 
00044 class KDECORE_EXPORT KProcess : public QProcess
00045 {
00046     Q_OBJECT
00047     Q_DECLARE_PRIVATE(KProcess)
00048 
00049 public:
00050 
00054     enum OutputChannelMode {
00055         SeparateChannels = QProcess::SeparateChannels,
00058         MergedChannels = QProcess::MergedChannels,
00061         ForwardedChannels = QProcess::ForwardedChannels,
00064         OnlyStdoutChannel,
00066         OnlyStderrChannel  
00067     };
00068 
00072     explicit KProcess(QObject *parent = 0);
00073 
00077     virtual ~KProcess();
00078 
00090     void setOutputChannelMode(OutputChannelMode mode);
00091 
00097     OutputChannelMode outputChannelMode() const;
00098 
00108     void setNextOpenMode(QIODevice::OpenMode mode);
00109 
00120     void setEnv(const QString &name, const QString &value, bool overwrite = true);
00121 
00129     void unsetEnv(const QString &name);
00130 
00139     void clearEnvironment();
00140 
00150     void setProgram(const QString &exe, const QStringList &args = QStringList());
00151 
00158     void setProgram(const QStringList &argv);
00159 
00177     KProcess &operator<<(const QString& arg);
00178 
00185     KProcess &operator<<(const QStringList& args);
00186 
00190     void clearProgram();
00191 
00208     void setShellCommand(const QString &cmd);
00209 
00216     QStringList program() const;
00217 
00223     void start();
00224 
00242     int execute(int msecs = -1);
00243 
00254     static int execute(const QString &exe, const QStringList &args = QStringList(), int msecs = -1);
00255 
00265     static int execute(const QStringList &argv, int msecs = -1);
00266 
00281     int startDetached();
00282 
00291     static int startDetached(const QString &exe, const QStringList &args = QStringList());
00292 
00300     static int startDetached(const QStringList &argv);
00301 
00312     int pid() const;
00313 
00314 protected:
00318     KProcess(KProcessPrivate *d, QObject *parent);
00319 
00323     KProcessPrivate * const d_ptr;
00324 
00325 private:
00326     // hide those
00327     using QProcess::setReadChannelMode;
00328     using QProcess::readChannelMode;
00329     using QProcess::setProcessChannelMode;
00330     using QProcess::processChannelMode;
00331 
00332     Q_PRIVATE_SLOT(d_func(), void _k_forwardStdout())
00333     Q_PRIVATE_SLOT(d_func(), void _k_forwardStderr())
00334 };
00335 
00336 #endif
00337 

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
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • 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