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 |
|
|
26 |
class QListWidget;
|
|
27 |
class QLineEdit;
|
|
28 |
|
|
29 |
class HWChatWidget : public QWidget
|
|
30 |
{
|
|
31 |
Q_OBJECT
|
|
32 |
|
|
33 |
public:
|
|
34 |
HWChatWidget(QWidget* parent=0);
|
|
35 |
|
|
36 |
public slots:
|
1360
|
37 |
void onChatString(const QString& str);
|
465
|
38 |
void nickAdded(const QString& nick);
|
|
39 |
void nickRemoved(const QString& nick);
|
|
40 |
void clear();
|
461
|
41 |
|
|
42 |
signals:
|
|
43 |
void chatLine(const QString& str);
|
|
44 |
|
|
45 |
private:
|
|
46 |
QGridLayout mainLayout;
|
|
47 |
QListWidget* chatText;
|
462
|
48 |
QListWidget* chatNicks;
|
461
|
49 |
QLineEdit* chatEditLine;
|
|
50 |
|
|
51 |
private slots:
|
|
52 |
void returnPressed();
|
|
53 |
};
|
|
54 |
|
|
55 |
#endif // _CHAT_WIDGET_INCLUDED
|