KVIrc 5.2.6
Developer APIs
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
35public:
37protected:
38 QAbstractSocket * m_pSocket = nullptr;
39 QTcpServer * m_pServer = nullptr;
41 bool bIsSetFromExternal = false;
42
43protected:
44 bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams) override;
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();
77protected 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_
Definition KviKvsObjectFunctionCall.h:34
Definition KviKvsObject.h:51
Definition KviKvsRunTimeContext.h:104
Class to handle variant variables lists.
Definition KviKvsVariantList.h:42
Definition KvsObject_socket.h:33
bool bytesAvailable(KviKvsObjectFunctionCall *c)
bool close(KviKvsObjectFunctionCall *c)
bool remoteIp(KviKvsObjectFunctionCall *c)
bool remotePort(KviKvsObjectFunctionCall *c)
void makeConnections()
Definition KvsObject_socket.cpp:585
const char * getStateString(QAbstractSocket::SocketState)
Definition KvsObject_socket.cpp:595
bool functionConnect(KviKvsObjectFunctionCall *c)
bool incomingConnectionEvent(KviKvsObjectFunctionCall *c)
bool listen(KviKvsObjectFunctionCall *c)
KviKvsRunTimeContext * m_pContext
Definition KvsObject_socket.h:40
bool localPort(KviKvsObjectFunctionCall *c)
void slotHostFound()
Definition KvsObject_socket.cpp:671
void slotNewConnection()
Definition KvsObject_socket.cpp:685
void setInternalSocket(QAbstractSocket *pSocket)
Definition KvsObject_socket.h:47
void slotReadyRead()
Definition KvsObject_socket.cpp:644
bool dataAvailableEvent(KviKvsObjectFunctionCall *c)
bool stateChangedEvent(KviKvsObjectFunctionCall *c)
bool localIp(KviKvsObjectFunctionCall *c)
QTcpServer * m_pServer
Definition KvsObject_socket.h:39
bool setProtocol(KviKvsObjectFunctionCall *c)
void slotError(QAbstractSocket::SocketError socketError)
Definition KvsObject_socket.cpp:663
bool write(KviKvsObjectFunctionCall *c)
bool connectedEvent(KviKvsObjectFunctionCall *c)
void slotConnected()
Definition KvsObject_socket.cpp:651
bool status(KviKvsObjectFunctionCall *c)
bool hostFoundEvent(KviKvsObjectFunctionCall *c)
bool read(KviKvsObjectFunctionCall *c)
QAbstractSocket * m_pSocket
Definition KvsObject_socket.h:38
bool disconnectedEvent(KviKvsObjectFunctionCall *c)
bool bIsSetFromExternal
Definition KvsObject_socket.h:41
void slotDisconnected()
Definition KvsObject_socket.cpp:657
bool errorEvent(KviKvsObjectFunctionCall *c)
void slotStateChanged(QAbstractSocket::SocketState socketState)
Definition KvsObject_socket.cpp:677
#define KVSO_DECLARE_OBJECT(__className)
Definition object_macros.h:33
int init()
Definition winamp.cpp:118