| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2006-2008 fullmetalcoder <[email protected]> |
| 4 | ** |
| 5 | ** This file is part of the Edyuk project <http://edyuk.org> |
| 6 | ** |
| 7 | ** This file may be used under the terms of the GNU General Public License |
| 8 | ** version 2 as published by the Free Software Foundation and appearing in the |
| 9 | ** file GPL.txt included in the packaging of this file. |
| 10 | ** |
| 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
| 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
| 13 | ** |
| 14 | ****************************************************************************/ |
| 15 | |
| 16 | #ifndef _QMANAGED_SOCKET_H_ |
| 17 | #define _QMANAGED_SOCKET_H_ |
| 18 | |
| 19 | #include "qcumber.h" |
| 20 | |
| 21 | /*! |
| 22 | \file qmanagedsocket.h |
| 23 | |
| 24 | \brief Definition of the QManagedSocket class. |
| 25 | */ |
| 26 | |
| 27 | #include <QObject> |
| 28 | |
| 29 | class QTcpSocket; |
| 30 | |
| 31 | class QCUMBER_EXPORT QManagedSocket : public QObject { |
| 32 | Q_OBJECT |
| 33 | |
| 34 | public: |
| 35 | QManagedSocket(QTcpSocket *s, QObject *p = 0); |
| 36 | virtual ~QManagedSocket(); |
| 37 | |
| 38 | virtual void send(const QByteArray &msg); |
| 39 | |
| 40 | signals: |
| 41 | void message(const QString &m); |
| 42 | void message(const QString &m, QManagedSocket *s); |
| 43 | |
| 44 | protected slots: |
| 45 | virtual void readyRead(); |
| 46 | |
| 47 | private: |
| 48 | QTcpSocket *pSocket; |
| 49 | }; |
| 50 | |
| 51 | #endif // _QMANAGED_SOCKET_H_ |