KPty
kptyprocess.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 KPTYPROCESS_H 00023 #define KPTYPROCESS_H 00024 00025 #include <kprocess.h> 00026 00027 #include "kpty_export.h" 00028 00029 class KPtyDevice; 00030 00031 struct KPtyProcessPrivate; 00032 00048 class KPTY_EXPORT KPtyProcess : public KProcess 00049 { 00050 Q_OBJECT 00051 Q_DECLARE_PRIVATE(KPtyProcess) 00052 00053 public: 00054 enum PtyChannelFlag { 00055 NoChannels = 0, 00056 StdinChannel = 1, 00057 StdoutChannel = 2, 00058 StderrChannel = 4, 00059 AllOutputChannels = 6, 00060 AllChannels = 7 00061 }; 00062 00063 Q_DECLARE_FLAGS(PtyChannels, PtyChannelFlag) 00064 00065 00068 explicit KPtyProcess(QObject *parent = 0); 00069 00077 KPtyProcess(int ptyMasterFd, QObject *parent = 0); 00078 00082 virtual ~KPtyProcess(); 00083 00091 void setPtyChannels(PtyChannels channels); 00092 00098 PtyChannels ptyChannels() const; 00099 00111 void setUseUtmp(bool value); 00112 00118 bool isUseUtmp() const; 00119 00125 KPtyDevice *pty() const; 00126 00127 protected: 00131 virtual void setupChildProcess(); 00132 00133 private: 00134 Q_PRIVATE_SLOT(d_func(), void _k_onStateChanged(QProcess::ProcessState)) 00135 }; 00136 00137 Q_DECLARE_OPERATORS_FOR_FLAGS(KPtyProcess::PtyChannels) 00138 00139 #endif
KDE 4.6 API Reference