author | nemo |
Tue, 26 Jan 2010 23:00:45 +0000 | |
changeset 2717 | 2b75ef82676d |
parent 2706 | 935b7d618cf0 |
child 2773 | e94f240a8a41 |
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> |
|
2706
935b7d618cf0
sheepluva's patch to add a "follow" command to server and frontend, in order to stalk people and join them in their rooms
koda
parents:
1860
diff
changeset
|
23 |
#include <QListWidget> |
461 | 24 |
#include <QString> |
25 |
#include <QGridLayout> |
|
26 |
||
1520
f72f538eba05
Refactor chat widget to use QTextBrower instead of QListWidget:
unc0rr
parents:
1405
diff
changeset
|
27 |
class QTextBrowser; |
f72f538eba05
Refactor chat widget to use QTextBrower instead of QListWidget:
unc0rr
parents:
1405
diff
changeset
|
28 |
class QLineEdit; |
461 | 29 |
class QListWidget; |
30 |
||
31 |
class HWChatWidget : public QWidget |
|
32 |
{ |
|
33 |
Q_OBJECT |
|
34 |
||
35 |
public: |
|
36 |
HWChatWidget(QWidget* parent=0); |
|
37 |
||
38 |
public slots: |
|
1360 | 39 |
void onChatString(const QString& str); |
1587 | 40 |
void onServerMessage(const QString& str); |
465 | 41 |
void nickAdded(const QString& nick); |
42 |
void nickRemoved(const QString& nick); |
|
43 |
void clear(); |
|
1405 | 44 |
void setReadyStatus(const QString & nick, bool isReady); |
1860 | 45 |
void adminAccess(bool); |
461 | 46 |
|
47 |
signals: |
|
48 |
void chatLine(const QString& str); |
|
1391 | 49 |
void kick(const QString & str); |
1860 | 50 |
void ban(const QString & str); |
1577 | 51 |
void info(const QString & str); |
2706
935b7d618cf0
sheepluva's patch to add a "follow" command to server and frontend, in order to stalk people and join them in their rooms
koda
parents:
1860
diff
changeset
|
52 |
void follow(const QString &); |
461 | 53 |
|
54 |
private: |
|
55 |
QGridLayout mainLayout; |
|
1520
f72f538eba05
Refactor chat widget to use QTextBrower instead of QListWidget:
unc0rr
parents:
1405
diff
changeset
|
56 |
QTextBrowser* chatText; |
f72f538eba05
Refactor chat widget to use QTextBrower instead of QListWidget:
unc0rr
parents:
1405
diff
changeset
|
57 |
QStringList chatStrings; |
462 | 58 |
QListWidget* chatNicks; |
461 | 59 |
QLineEdit* chatEditLine; |
1860 | 60 |
QAction * acInfo; |
61 |
QAction * acKick; |
|
62 |
QAction * acBan; |
|
2706
935b7d618cf0
sheepluva's patch to add a "follow" command to server and frontend, in order to stalk people and join them in their rooms
koda
parents:
1860
diff
changeset
|
63 |
QAction * acFollow; |
461 | 64 |
|
65 |
private slots: |
|
66 |
void returnPressed(); |
|
1860 | 67 |
void onBan(); |
1391 | 68 |
void onKick(); |
1577 | 69 |
void onInfo(); |
2706
935b7d618cf0
sheepluva's patch to add a "follow" command to server and frontend, in order to stalk people and join them in their rooms
koda
parents:
1860
diff
changeset
|
70 |
void onFollow(); |
935b7d618cf0
sheepluva's patch to add a "follow" command to server and frontend, in order to stalk people and join them in their rooms
koda
parents:
1860
diff
changeset
|
71 |
void chatNickDoubleClicked(QListWidgetItem * item); |
461 | 72 |
}; |
73 |
||
74 |
#endif // _CHAT_WIDGET_INCLUDED |