KVIrc 5.2.0
Developer APIs
DccThread.h
Go to the documentation of this file.
1#ifndef _THREAD_H_
2#define _THREAD_H_
3//=============================================================================
4//
5// File : DccThread.h
6// Creation date : Tue Sep 20 09 2000 18:28:44 by Szymon Stefanek
7//
8// This file is part of the KVIrc IRC client distribution
9// Copyright (C) 2000-2010 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 "kvi_settings.h"
28#include "KviThread.h"
29#include "kvi_sockettype.h"
30#include "KviPointerList.h"
31
32#include <QObject>
33
34#ifdef COMPILE_SSL_SUPPORT
35#include "KviSSL.h"
36#endif
37
38// KviThreadDataEvent<int>
39#define KVI_DCC_THREAD_EVENT_ERROR (KVI_THREAD_USER_EVENT_BASE + 1)
40// KviThreadDataEvent<KviCString>
41#define KVI_DCC_THREAD_EVENT_DATA (KVI_THREAD_USER_EVENT_BASE + 2)
42// KviThreadEvent
43#define KVI_DCC_THREAD_EVENT_SUCCESS (KVI_THREAD_USER_EVENT_BASE + 3)
44// KviThreadDataEvent<KviCString>
45#define KVI_DCC_THREAD_EVENT_MESSAGE (KVI_THREAD_USER_EVENT_BASE + 4)
46// KviThreadDataEvent<int>
47#define KVI_DCC_THREAD_EVENT_ACTION (KVI_THREAD_USER_EVENT_BASE + 5)
48
50{
51 int iLen;
52 char * buffer;
53};
54
56{
57public:
58 DccThread(QObject * par, kvi_socket_t fd);
59 ~DccThread();
60
61protected:
62 KviMutex * m_pMutex; // OWNED! PROTECTS m_pOutBuffers
64 QObject * m_pParent; // READ ONLY!
65#ifdef COMPILE_SSL_SUPPORT
66 KviSSL * m_pSSL;
67#endif
68protected:
69 bool handleInvalidSocketRead(int readLen);
70
71public:
72 QObject * parent() { return m_pParent; };
73 void postErrorEvent(int err);
74 // Warning!..newer call __tr() here!...use __tr_no_lookup()
75 void postMessageEvent(const char * message);
76#ifdef COMPILE_SSL_SUPPORT
77 void raiseSSLError();
78 void setSSL(KviSSL * s);
79 KviSSL * getSSL() const { return m_pSSL; };
80#endif
81};
82
83#endif //_THREAD_H_
C++ Template based double linked pointer list class.
Definition DccThread.h:56
QObject * m_pParent
Definition DccThread.h:64
QObject * parent()
Definition DccThread.h:72
~DccThread()
Definition DccThread.cpp:50
void postMessageEvent(const char *message)
Definition DccThread.cpp:113
bool handleInvalidSocketRead(int readLen)
Definition DccThread.cpp:72
kvi_socket_t m_fd
Definition DccThread.h:63
KviMutex * m_pMutex
Definition DccThread.h:62
void postErrorEvent(int err)
Definition DccThread.cpp:106
Definition KviThread.h:147
Definition KviThread.h:334
#define s
Definition detector.cpp:84
This file contains compile time settings.
int kvi_socket_t
Definition kvi_sockettype.h:40
Definition DccThread.h:50
char * buffer
Definition DccThread.h:52
int iLen
Definition DccThread.h:51