KVIrc  4.9.2
DeveloperAPIs
KvsObject_socket.h
Go to the documentation of this file.
1 #ifndef _CLASS_SOCKET_H_
2 #define _CLASS_SOCKET_H_
3 //=============================================================================
4 //
5 // File : KvsObject_socket.h
6 // Creation date : Sun Nov 11 03:13:46 2001 GMT by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net)
10 //
11 // This program is FREE software. You can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
15 //
16 // This program is distributed in the HOPE that it will be USEFUL,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 // See the GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, write to the Free Software Foundation,
23 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 //=============================================================================
26 
27 #include <QAbstractSocket>
28 #include <QTcpServer>
29 
30 #include "object_macros.h"
31 
33 {
34  Q_OBJECT
35 public:
37 protected:
38  QAbstractSocket * m_pSocket;
39  QTcpServer * m_pServer;
42 
43 protected:
44  virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams);
45  const char * getStateString(QAbstractSocket::SocketState);
46 
47  void setInternalSocket(QAbstractSocket * pSocket)
48  {
49  delete m_pSocket;
50  m_pSocket = pSocket;
51  bIsSetFromExternal = true;
53  }
54 
66  //bool setReadBufferSize(KviKvsObjectFunctionCall *c);
75 
76  void makeConnections();
77 protected slots:
78  void slotReadyRead();
79  void slotNewConnection();
80  void slotConnected();
81  void slotDisconnected();
82  void slotError(QAbstractSocket::SocketError socketError);
83  void slotHostFound();
84  void slotStateChanged(QAbstractSocket::SocketState socketState);
85 };
86 #endif //_CLASS_SOCKET_H_
void slotError(QAbstractSocket::SocketError socketError)
Definition: KvsObject_socket.cpp:665
void setInternalSocket(QAbstractSocket *pSocket)
Definition: KvsObject_socket.h:47
bool incomingConnectionEvent(KviKvsObjectFunctionCall *c)
void slotConnected()
Definition: KvsObject_socket.cpp:653
char s char s char s s s s s char char c s *s c s s s d c s *s d c d d d d c
Definition: KviIrcNumericCodes.h:391
bool bytesAvailable(KviKvsObjectFunctionCall *c)
bool errorEvent(KviKvsObjectFunctionCall *c)
void slotStateChanged(QAbstractSocket::SocketState socketState)
Definition: KvsObject_socket.cpp:679
Class to handle variant variables lists.
Definition: KviKvsVariantList.h:41
Definition: KviKvsObjectFunctionCall.h:33
Definition: KviKvsObject.h:50
void makeConnections()
Definition: KvsObject_socket.cpp:587
bool functionConnect(KviKvsObjectFunctionCall *c)
bool write(KviKvsObjectFunctionCall *c)
bool read(KviKvsObjectFunctionCall *c)
bool connectedEvent(KviKvsObjectFunctionCall *c)
bool dataAvailableEvent(KviKvsObjectFunctionCall *c)
bool status(KviKvsObjectFunctionCall *c)
bool stateChangedEvent(KviKvsObjectFunctionCall *c)
QAbstractSocket * m_pSocket
Definition: KvsObject_socket.h:38
bool localIp(KviKvsObjectFunctionCall *c)
Definition: KvsObject_socket.h:32
bool close(KviKvsObjectFunctionCall *c)
void slotNewConnection()
Definition: KvsObject_socket.cpp:687
bool setProtocol(KviKvsObjectFunctionCall *c)
bool remotePort(KviKvsObjectFunctionCall *c)
bool remoteIp(KviKvsObjectFunctionCall *c)
#define KVSO_DECLARE_OBJECT(__className)
Definition: object_macros.h:33
const char * getStateString(QAbstractSocket::SocketState)
Definition: KvsObject_socket.cpp:597
Definition: KviKvsRunTimeContext.h:103
void slotDisconnected()
Definition: KvsObject_socket.cpp:659
bool disconnectedEvent(KviKvsObjectFunctionCall *c)
KviKvsRunTimeContext * m_pContext
Definition: KvsObject_socket.h:40
QTcpServer * m_pServer
Definition: KvsObject_socket.h:39
virtual bool init(KviKvsRunTimeContext *pContext, KviKvsVariantList *pParams)
Definition: KvsObject_socket.cpp:295
void slotReadyRead()
Definition: KvsObject_socket.cpp:646
bool localPort(KviKvsObjectFunctionCall *c)
void slotHostFound()
Definition: KvsObject_socket.cpp:673
bool hostFoundEvent(KviKvsObjectFunctionCall *c)
bool bIsSetFromExternal
Definition: KvsObject_socket.h:41
bool listen(KviKvsObjectFunctionCall *c)