PythonQtWrapper_QIODevice.h
108 lines
| 4.8 KiB
| text/x-c
|
CLexer
florianlink
|
r13 | #ifndef PYTHONQTWRAPPER_QIODEVICE_H | ||
#define PYTHONQTWRAPPER_QIODEVICE_H | ||||
#include <qiodevice.h> | ||||
#include <QObject> | ||||
florianlink
|
r24 | #include <PythonQt.h> | ||
florianlink
|
r13 | #include <QVariant> | ||
#include <qbytearray.h> | ||||
#include <qcoreevent.h> | ||||
#include <qiodevice.h> | ||||
#include <qlist.h> | ||||
#include <qobject.h> | ||||
florianlink
|
r24 | class PythonQtShell_QIODevice : public QIODevice | ||
{ | ||||
public: | ||||
PythonQtShell_QIODevice():QIODevice(),_wrapper(NULL) {}; | ||||
PythonQtShell_QIODevice(QObject* parent):QIODevice(parent),_wrapper(NULL) {}; | ||||
virtual bool atEnd() const; | ||||
virtual qint64 bytesAvailable() const; | ||||
virtual qint64 bytesToWrite() const; | ||||
virtual bool canReadLine() const; | ||||
virtual void childEvent(QChildEvent* arg__1); | ||||
virtual void close(); | ||||
virtual void customEvent(QEvent* arg__1); | ||||
virtual bool event(QEvent* arg__1); | ||||
virtual bool eventFilter(QObject* arg__1, QEvent* arg__2); | ||||
virtual bool isSequential() const; | ||||
virtual bool open(QIODevice::OpenMode mode); | ||||
virtual qint64 pos() const; | ||||
virtual qint64 readData(char* data, qint64 maxlen); | ||||
virtual qint64 readLineData(char* data, qint64 maxlen); | ||||
virtual bool reset(); | ||||
virtual bool seek(qint64 pos); | ||||
virtual qint64 size() const; | ||||
virtual void timerEvent(QTimerEvent* arg__1); | ||||
virtual bool waitForBytesWritten(int msecs); | ||||
virtual bool waitForReadyRead(int msecs); | ||||
virtual qint64 writeData(const char* data, qint64 len); | ||||
PythonQtInstanceWrapper* _wrapper; | ||||
}; | ||||
class PythonQtPublicPromoter_QIODevice : public QIODevice | ||||
{ public: | ||||
florianlink
|
r28 | inline qint64 promoted_readLineData(char* data, qint64 maxlen) { return QIODevice::readLineData(data, maxlen); } | ||
inline void promoted_close() { QIODevice::close(); } | ||||
inline qint64 promoted_bytesAvailable() const { return QIODevice::bytesAvailable(); } | ||||
florianlink
|
r73 | inline bool promoted_open(QIODevice::OpenMode mode) { return QIODevice::open(mode); } | ||
florianlink
|
r28 | inline bool promoted_atEnd() const { return QIODevice::atEnd(); } | ||
inline bool promoted_seek(qint64 pos) { return QIODevice::seek(pos); } | ||||
florianlink
|
r73 | inline bool promoted_isSequential() const { return QIODevice::isSequential(); } | ||
inline qint64 promoted_bytesToWrite() const { return QIODevice::bytesToWrite(); } | ||||
florianlink
|
r28 | inline bool promoted_canReadLine() const { return QIODevice::canReadLine(); } | ||
florianlink
|
r73 | inline bool promoted_waitForBytesWritten(int msecs) { return QIODevice::waitForBytesWritten(msecs); } | ||
florianlink
|
r28 | inline bool promoted_waitForReadyRead(int msecs) { return QIODevice::waitForReadyRead(msecs); } | ||
inline qint64 promoted_pos() const { return QIODevice::pos(); } | ||||
florianlink
|
r73 | inline bool promoted_reset() { return QIODevice::reset(); } | ||
inline qint64 promoted_size() const { return QIODevice::size(); } | ||||
florianlink
|
r24 | }; | ||
florianlink
|
r13 | class PythonQtWrapper_QIODevice : public QObject | ||
{ Q_OBJECT | ||||
public: | ||||
Q_ENUMS(OpenModeFlag ) | ||||
florianlink
|
r73 | Q_FLAGS(OpenMode ) | ||
florianlink
|
r13 | enum OpenModeFlag{ | ||
NotOpen = QIODevice::NotOpen, ReadOnly = QIODevice::ReadOnly, WriteOnly = QIODevice::WriteOnly, ReadWrite = QIODevice::ReadWrite, Append = QIODevice::Append, Truncate = QIODevice::Truncate, Text = QIODevice::Text, Unbuffered = QIODevice::Unbuffered}; | ||||
florianlink
|
r73 | Q_DECLARE_FLAGS(OpenMode, OpenModeFlag) | ||
florianlink
|
r13 | public slots: | ||
florianlink
|
r24 | QIODevice* new_QIODevice(); | ||
QIODevice* new_QIODevice(QObject* parent); | ||||
florianlink
|
r13 | void delete_QIODevice(QIODevice* obj) { delete obj; } | ||
florianlink
|
r24 | qint64 readLineData(QIODevice* theWrappedObject, char* data, qint64 maxlen); | ||
bool isOpen(QIODevice* theWrappedObject) const; | ||||
void close(QIODevice* theWrappedObject); | ||||
qint64 bytesAvailable(QIODevice* theWrappedObject) const; | ||||
QIODevice::OpenMode openMode(QIODevice* theWrappedObject) const; | ||||
bool isReadable(QIODevice* theWrappedObject) const; | ||||
florianlink
|
r73 | void setTextModeEnabled(QIODevice* theWrappedObject, bool enabled); | ||
bool open(QIODevice* theWrappedObject, QIODevice::OpenMode mode); | ||||
florianlink
|
r24 | bool atEnd(QIODevice* theWrappedObject) const; | ||
bool seek(QIODevice* theWrappedObject, qint64 pos); | ||||
bool getChar(QIODevice* theWrappedObject, char* c); | ||||
florianlink
|
r73 | bool isSequential(QIODevice* theWrappedObject) const; | ||
florianlink
|
r24 | QByteArray readLine(QIODevice* theWrappedObject, qint64 maxlen = 0); | ||
florianlink
|
r73 | qint64 bytesToWrite(QIODevice* theWrappedObject) const; | ||
florianlink
|
r28 | qint64 write(QIODevice* theWrappedObject, const QByteArray& data); | ||
florianlink
|
r73 | bool canReadLine(QIODevice* theWrappedObject) const; | ||
florianlink
|
r24 | void ungetChar(QIODevice* theWrappedObject, char c); | ||
florianlink
|
r73 | bool waitForBytesWritten(QIODevice* theWrappedObject, int msecs); | ||
florianlink
|
r24 | bool waitForReadyRead(QIODevice* theWrappedObject, int msecs); | ||
florianlink
|
r28 | bool isWritable(QIODevice* theWrappedObject) const; | ||
qint64 pos(QIODevice* theWrappedObject) const; | ||||
bool putChar(QIODevice* theWrappedObject, char c); | ||||
florianlink
|
r73 | bool reset(QIODevice* theWrappedObject); | ||
florianlink
|
r28 | QString errorString(QIODevice* theWrappedObject) const; | ||
florianlink
|
r73 | QByteArray peek(QIODevice* theWrappedObject, qint64 maxlen); | ||
QByteArray read(QIODevice* theWrappedObject, qint64 maxlen); | ||||
florianlink
|
r28 | QByteArray readAll(QIODevice* theWrappedObject); | ||
florianlink
|
r73 | qint64 size(QIODevice* theWrappedObject) const; | ||
bool isTextModeEnabled(QIODevice* theWrappedObject) const; | ||||
florianlink
|
r13 | }; | ||
#endif // PYTHONQTWRAPPER_QIODEVICE_H | ||||