KVIrc 5.2.4
Developer APIs
DccChatWindow.h
Go to the documentation of this file.
1#ifndef _CHAT_H_
2#define _CHAT_H_
3//=============================================================================
4//
5// File : DccChatWindow.h
6// Creation date : Tue Sep 20 09 2000 15:11:12 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 "DccDescriptor.h"
28#include "DccThread.h"
29#include "DccWindow.h"
30
31#include "KviDataBuffer.h"
32#include "KviThemedLabel.h"
33#include "KviCString.h"
34#include "KviWindow.h"
35#include "KviError.h"
36
37#include <deque>
38#include <memory>
39
40#ifdef COMPILE_SSL_SUPPORT
41class KviSSL;
42#endif
43
44class DccMarshal;
45class QSplitter;
46
48{
49public:
51
52protected:
53 std::deque<std::unique_ptr<KviDataBuffer>> m_pOutBuffers;
54
55protected:
56 virtual void run();
57 bool tryFlushOutBuffers();
58 // This should handle the incoming data buffer
59 // must "eat" some data from data.buffer, memmove the remaining part
60 // to the beginning, kvi_realloc data.buffer and update data.iLen
61 // If bCritical is true, it should handle the whole data buffer
62 // since the thread is going to die
63 // It should return true if the handing was successful
64 // or false if the thread should be stopped
65 bool handleIncomingData(KviDccThreadIncomingData * data, bool bCritical);
66
67public:
68 void sendRawData(const void * buffer, int len); // mutex (m_pOutBuffers usage)
69};
70
72{
73 Q_OBJECT
74public:
75 DccChatWindow(DccDescriptor * dcc, const char * name);
77 QFrame * buttonContainer() override { return (QFrame *)m_pButtonContainer; }
78protected:
80 QString m_szTarget;
85
86protected:
87 const QString & target() override;
88 void fillCaptionBuffers() override;
89 void getBaseLogFileName(QString & buffer) override;
90 QPixmap * myIconPtr() override;
91 void resizeEvent(QResizeEvent * e) override;
92 QSize sizeHint() const override;
93 const QString & localNick() override;
94 bool event(QEvent * e) override;
95 void ownMessage(const QString & text, bool bUserFeedback = true) override;
96 void ownAction(const QString & text) override;
97 void triggerCreationEvents() override;
98 void triggerDestructionEvents() override;
99 void startConnection();
100 DccThread * getSlaveThread() override { return m_pSlaveThread; }
101protected slots:
103 void connected();
104 void sslError(const char * msg);
108};
109
110#endif //_CHAT_H_
Error List.
Contains the KviWindow class.
Definition DccChatWindow.h:48
void sendRawData(const void *buffer, int len)
Definition DccChatWindow.cpp:812
std::deque< std::unique_ptr< KviDataBuffer > > m_pOutBuffers
Definition DccChatWindow.h:53
virtual void run()
Definition DccChatWindow.cpp:606
bool handleIncomingData(KviDccThreadIncomingData *data, bool bCritical)
Definition DccChatWindow.cpp:744
bool tryFlushOutBuffers()
Definition DccChatWindow.cpp:819
Definition DccChatWindow.h:72
void triggerCreationEvents() override
Definition DccChatWindow.cpp:137
void textViewRightClicked()
Definition DccChatWindow.cpp:132
void connectionInProgress()
Definition DccChatWindow.cpp:175
bool event(QEvent *e) override
Definition DccChatWindow.cpp:418
DccChatThread * m_pSlaveThread
Definition DccChatWindow.h:79
void ownAction(const QString &text) override
Definition DccChatWindow.cpp:389
void resizeEvent(QResizeEvent *e) override
Definition DccChatWindow.cpp:535
void handleMarshalError(KviError::Code eError)
Definition DccChatWindow.cpp:551
DccThread * getSlaveThread() override
Definition DccChatWindow.h:100
KviTalHBox * m_pButtonContainer
Definition DccChatWindow.h:84
const QString & localNick() override
Definition DccChatWindow.cpp:382
QString m_szTarget
Definition DccChatWindow.h:80
void ownMessage(const QString &text, bool bUserFeedback=true) override
Definition DccChatWindow.cpp:299
void connected()
Definition DccChatWindow.cpp:558
KviThemedLabel * m_pLabel
Definition DccChatWindow.h:82
QPixmap * myIconPtr() override
Definition DccChatWindow.cpp:289
void triggerDestructionEvents() override
Definition DccChatWindow.cpp:142
QFrame * buttonContainer() override
Definition DccChatWindow.h:77
void fillCaptionBuffers() override
Definition DccChatWindow.cpp:276
void startingSSLHandshake()
Definition DccChatWindow.cpp:249
QSize sizeHint() const override
Definition DccChatWindow.cpp:544
void startConnection()
Definition DccChatWindow.cpp:147
void getBaseLogFileName(QString &buffer) override
Definition DccChatWindow.cpp:294
void sslError(const char *msg)
Definition DccChatWindow.cpp:257
~DccChatWindow()
Definition DccChatWindow.cpp:120
const QString & target() override
Definition DccChatWindow.cpp:265
QString m_szLocalNick
Definition DccChatWindow.h:81
KviTalHBox * m_pButtonBox
Definition DccChatWindow.h:83
Definition DccDescriptor.h:34
Definition DccMarshal.h:57
Definition DccThread.h:56
Definition DccWindow.h:35
Toolkit Abstraction Layer: hbox class.
Definition KviTalHBox.h:44
Definition KviThemedLabel.h:34
Base class for all windows in KVIrc.
Definition KviWindow.h:75
#define e
Definition detector.cpp:70
int kvi_socket_t
Definition kvi_sockettype.h:40
Code
Contains all error codes.
Definition KviError.h:48
Definition DccThread.h:50