author | unc0rr |
Thu, 04 Dec 2008 21:17:03 +0000 | |
changeset 1527 | 4a610e970b66 |
parent 1520 | f72f538eba05 |
child 1577 | e3e37c730dc0 |
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); |
465 | 39 |
void nickAdded(const QString& nick); |
40 |
void nickRemoved(const QString& nick); |
|
41 |
void clear(); |
|
1405 | 42 |
void setReadyStatus(const QString & nick, bool isReady); |
461 | 43 |
|
44 |
signals: |
|
45 |
void chatLine(const QString& str); |
|
1391 | 46 |
void kick(const QString & str); |
461 | 47 |
|
48 |
private: |
|
49 |
QGridLayout mainLayout; |
|
1520
f72f538eba05
Refactor chat widget to use QTextBrower instead of QListWidget:
unc0rr
parents:
1405
diff
changeset
|
50 |
QTextBrowser* chatText; |
f72f538eba05
Refactor chat widget to use QTextBrower instead of QListWidget:
unc0rr
parents:
1405
diff
changeset
|
51 |
QStringList chatStrings; |
462 | 52 |
QListWidget* chatNicks; |
461 | 53 |
QLineEdit* chatEditLine; |
54 |
||
55 |
private slots: |
|
56 |
void returnPressed(); |
|
1391 | 57 |
void onKick(); |
461 | 58 |
}; |
59 |
||
60 |
#endif // _CHAT_WIDGET_INCLUDED |