KVIrc  4.9.2
DeveloperAPIs
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;
54 
56 {
57 public:
58  DccThread(QObject * par, kvi_socket_t fd);
59  ~DccThread();
60 
61 protected:
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
68 protected:
69  bool handleInvalidSocketRead(int readLen);
70 
71 public:
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_
int kvi_socket_t
Definition: kvi_sockettype.h:40
Definition: DccThread.h:49
void postMessageEvent(const char *message)
Definition: DccThread.cpp:113
struct _KviDccThreadIncomingData KviDccThreadIncomingData
void postErrorEvent(int err)
Definition: DccThread.cpp:106
KviMutex * m_pMutex
Definition: DccThread.h:62
Definition: KviThread.h:146
kvi_socket_t m_fd
Definition: DccThread.h:63
Definition: DccThread.h:55
QObject * m_pParent
Definition: DccThread.h:64
char s char s s
Definition: KviIrcNumericCodes.h:391
~DccThread()
Definition: DccThread.cpp:50
C++ Template based double linked pointer list class.
DccThread(QObject *par, kvi_socket_t fd)
Definition: DccThread.cpp:38
bool handleInvalidSocketRead(int readLen)
Definition: DccThread.cpp:72
QObject * parent()
Definition: DccThread.h:72
This file contains compile time settings.
Definition: KviThread.h:333
int iLen
Definition: DccThread.h:51
char * buffer
Definition: DccThread.h:52