kpty.h

00001 /* This file is part of the KDE libraries
00002 
00003     Copyright (C) 1997-2002 The Konsole Developers
00004     Copyright (C) 2002 Waldo Bastian <bastian@kde.org>
00005     Copyright (C) 2002-2003 Oswald Buddenhagen <ossi@kde.org>
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Library General Public
00009     License as published by the Free Software Foundation; either
00010     version 2 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Library General Public License for more details.
00016 
00017     You should have received a copy of the GNU Library General Public License
00018     along with this library; see the file COPYING.LIB.  If not, write to
00019     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020     Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #ifndef __kpty_h__
00024 #define __kpty_h__
00025 
00026 #include <qglobal.h>
00027 #include <kdelibs_export.h>
00028 
00029 #ifdef Q_OS_UNIX
00030 
00031 struct KPtyPrivate;
00032 
00040 class KDECORE_EXPORT KPty {
00041 
00042 public:
00043 
00047   KPty();
00048 
00055   ~KPty();
00056 
00062   bool open();
00063 
00067   void close();
00068 
00073   void setCTty();
00074 
00085   void login(const char *user = 0, const char *remotehost = 0);
00086 
00090   void logout();
00091 
00099   void setWinSize(int lines, int columns);
00100 
00108   void setXonXoff(bool useXonXoff);
00109 
00117   void setUtf8Mode(bool useUtf8);
00118 
00119 
00125   const char *ttyName() const;
00126 
00132   int masterFd() const;
00133 
00139   int slaveFd() const;
00140 
00141 private:
00142   bool chownpty(bool grant);
00143 
00144   KPtyPrivate *d;
00145 };
00146 
00147 #endif //Q_OS_UNIX
00148 #endif
00149 
KDE Home | KDE Accessibility Home | Description of Access Keys