author | nemo |
Mon, 11 May 2009 21:27:31 +0000 | |
changeset 2047 | 805f7b62cff6 |
parent 1860 | ce140b2b928a |
child 2706 | 935b7d618cf0 |
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); |
1860 | 44 |
void adminAccess(bool); |
461 | 45 |
|
46 |
signals: |
|
47 |
void chatLine(const QString& str); |
|
1391 | 48 |
void kick(const QString & str); |
1860 | 49 |
void ban(const QString & str); |
1577 | 50 |
void info(const QString & str); |
461 | 51 |
|
52 |
private: |
|
53 |
QGridLayout mainLayout; |
|
1520
f72f538eba05
Refactor chat widget to use QTextBrower instead of QListWidget:
unc0rr
parents:
1405
diff
changeset
|
54 |
QTextBrowser* chatText; |
f72f538eba05
Refactor chat widget to use QTextBrower instead of QListWidget:
unc0rr
parents:
1405
diff
changeset
|
55 |
QStringList chatStrings; |
462 | 56 |
QListWidget* chatNicks; |
461 | 57 |
QLineEdit* chatEditLine; |
1860 | 58 |
QAction * acInfo; |
59 |
QAction * acKick; |
|
60 |
QAction * acBan; |
|
461 | 61 |
|
62 |
private slots: |
|
63 |
void returnPressed(); |
|
1860 | 64 |
void onBan(); |
1391 | 65 |
void onKick(); |
1577 | 66 |
void onInfo(); |
461 | 67 |
}; |
68 |
||
69 |
#endif // _CHAT_WIDGET_INCLUDED |