1 #ifndef NEOVIM_QT_REQUEST 2 #define NEOVIM_QT_REQUEST 3 4 #include <QObject> 5 #include <QTimer> 6 7 namespace NeovimQt { 8 9 class MsgpackIODevice; 10 class MsgpackRequest: public QObject { 11 Q_OBJECT 12 public: 13 MsgpackRequest(quint32 id, MsgpackIODevice *dev, QObject *parent=0); 14 void setFunction(quint64); 15 quint64 function(); 16 void setTimeout(int msec); 17 /** The identifier for this Msgpack request */ 18 const quint32 id; 19 signals: 20 void finished(quint32 msgid, quint64 fun, const QVariant& resp); 21 void error(quint32 msgid, quint64 fun, const QVariant& err); 22 void timeout(quint32 id); 23 protected slots: 24 void requestTimeout(); 25 26 private: 27 MsgpackIODevice *m_dev; 28 quint64 m_function; 29 QTimer m_timer; 30 }; 31 } // Namespace 32 33 #endif 34