author | unc0rr |
Sun, 25 Jan 2009 13:48:41 +0000 | |
changeset 1747 | 44a6a9924c6d |
parent 1587 | b8a3d449bed7 |
child 1860 | ce140b2b928a |
permissions | -rw-r--r-- |
480 | 1 |
/* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
486 | 3 |
* Copyright (c) 2007 Igor Ulyanov <iulyanov@gmail.com> |
480 | 4 |
* |
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
17 |
*/ |
|
18 |
||
461 | 19 |
#ifndef _CHAT_WIDGET_INCLUDED |
20 |
#define _CHAT_WIDGET_INCLUDED |
|
21 |
||
22 |
#include <QWidget> |
|
23 |
#include <QString> |
|
24 |
#include <QGridLayout> |
|
25 |
||
1520
f72f538eba05
Refactor chat widget to use QTextBrower instead of QListWidget:
unc0rr
parents:
1405
diff
changeset
|
26 |
class QTextBrowser; |
f72f538eba05
Refactor chat widget to use QTextBrower instead of QListWidget:
unc0rr
parents:
1405
diff
changeset
|
27 |
class QLineEdit; |
461 | 28 |
class QListWidget; |
29 |
||
30 |
class HWChatWidget : public QWidget |
|
31 |
{ |
|
32 |
Q_OBJECT |
|
33 |
||
34 |
public: |
|
35 |
HWChatWidget(QWidget* parent=0); |
|
36 |
||
37 |
public slots: |
|
1360 | 38 |
void onChatString(const QString& str); |
1587 | 39 |
void onServerMessage(const QString& str); |
465 | 40 |
void nickAdded(const QString& nick); |
41 |
void nickRemoved(const QString& nick); |
|
42 |
void clear(); |
|
1405 | 43 |
void setReadyStatus(const QString & nick, bool isReady); |
461 | 44 |
|
45 |
signals: |
|
46 |
void chatLine(const QString& str); |
|
1391 | 47 |
void kick(const QString & str); |
1577 | 48 |
void info(const QString & str); |
461 | 49 |
|
50 |
private: |
|
51 |
QGridLayout mainLayout; |
|
1520
f72f538eba05
Refactor chat widget to use QTextBrower instead of QListWidget:
unc0rr
parents:
1405
diff
changeset
|
52 |
QTextBrowser* chatText; |
f72f538eba05
Refactor chat widget to use QTextBrower instead of QListWidget:
unc0rr
parents:
1405
diff
changeset
|
53 |
QStringList chatStrings; |
462 | 54 |
QListWidget* chatNicks; |
461 | 55 |
QLineEdit* chatEditLine; |
56 |
||
57 |
private slots: |
|
58 |
void returnPressed(); |
|
1391 | 59 |
void onKick(); |
1577 | 60 |
void onInfo(); |
461 | 61 |
}; |
62 |
||
63 |
#endif // _CHAT_WIDGET_INCLUDED |