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

KPty

kptydevice.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002 
00003     Copyright (C) 2007 Oswald Buddenhagen <ossi@kde.org>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to
00017     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018     Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef kptydev_h
00022 #define kptydev_h
00023 
00024 #include "kpty.h"
00025 
00026 #include <QtCore/QIODevice>
00027 
00028 struct KPtyDevicePrivate;
00029 
00030 #define Q_DECLARE_PRIVATE_MI(Class, SuperClass) \
00031     inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(SuperClass::d_ptr); } \
00032     inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(SuperClass::d_ptr); } \
00033     friend class Class##Private;
00034 
00038 class KPTY_EXPORT KPtyDevice : public QIODevice, public KPty { //krazy:exclude=dpointer (via macro)
00039     Q_OBJECT
00040     Q_DECLARE_PRIVATE_MI(KPtyDevice, KPty)
00041 
00042 public:
00043 
00047     KPtyDevice(QObject *parent = 0);
00048 
00055     virtual ~KPtyDevice();
00056 
00062     virtual bool open(OpenMode mode = ReadWrite | Unbuffered);
00063 
00077     bool open(int fd, OpenMode mode = ReadWrite | Unbuffered);
00078 
00082     virtual void close();
00083 
00096     void setSuspended(bool suspended);
00097 
00106     bool isSuspended() const;
00107 
00111     virtual bool isSequential() const;
00112 
00116     bool canReadLine() const;
00117 
00121     bool atEnd() const;
00122 
00126     qint64 bytesAvailable() const;
00127 
00131     qint64 bytesToWrite() const;
00132 
00133     bool waitForBytesWritten(int msecs = -1);
00134     bool waitForReadyRead(int msecs = -1);
00135 
00136 
00137 Q_SIGNALS:
00139     void readyRead();
00140 
00146     void readEof();
00147 
00148 protected:
00149     virtual qint64 readData(char *data, qint64 maxSize);
00150     virtual qint64 readLineData(char *data, qint64 maxSize);
00151     virtual qint64 writeData(const char *data, qint64 maxSize);
00152 
00153 private:
00154     Q_PRIVATE_SLOT(d_func(), bool _k_canRead())
00155     Q_PRIVATE_SLOT(d_func(), bool _k_canWrite())
00156 };
00157 
00158 #endif
00159 

KPty

Skip menu "KPty"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • 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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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