QTfrontend/chatwidget.h
author unc0rr
Sun, 04 May 2008 14:21:47 +0000
changeset 903 d4e5d8cbe449
parent 486 7ea71cd3acd5
child 1066 1f1b3686a2b0
permissions -rw-r--r--
Implement LIST command
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
480
09434d6c3865 GPL headers added
displacer
parents: 465
diff changeset
     1
/*
09434d6c3865 GPL headers added
displacer
parents: 465
diff changeset
     2
 * Hedgewars, a worms-like game
486
7ea71cd3acd5 - Change proto version to 4
unc0rr
parents: 480
diff changeset
     3
 * Copyright (c) 2007 Igor Ulyanov <iulyanov@gmail.com>
480
09434d6c3865 GPL headers added
displacer
parents: 465
diff changeset
     4
 *
09434d6c3865 GPL headers added
displacer
parents: 465
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
09434d6c3865 GPL headers added
displacer
parents: 465
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
09434d6c3865 GPL headers added
displacer
parents: 465
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
09434d6c3865 GPL headers added
displacer
parents: 465
diff changeset
     8
 *
09434d6c3865 GPL headers added
displacer
parents: 465
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
09434d6c3865 GPL headers added
displacer
parents: 465
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
09434d6c3865 GPL headers added
displacer
parents: 465
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
09434d6c3865 GPL headers added
displacer
parents: 465
diff changeset
    12
 * GNU General Public License for more details.
09434d6c3865 GPL headers added
displacer
parents: 465
diff changeset
    13
 *
09434d6c3865 GPL headers added
displacer
parents: 465
diff changeset
    14
 * You should have received a copy of the GNU General Public License
09434d6c3865 GPL headers added
displacer
parents: 465
diff changeset
    15
 * along with this program; if not, write to the Free Software
09434d6c3865 GPL headers added
displacer
parents: 465
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
09434d6c3865 GPL headers added
displacer
parents: 465
diff changeset
    17
 */
09434d6c3865 GPL headers added
displacer
parents: 465
diff changeset
    18
461
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    19
#ifndef _CHAT_WIDGET_INCLUDED
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    20
#define _CHAT_WIDGET_INCLUDED
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    21
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    22
#include <QWidget>
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    23
#include <QString>
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    24
#include <QGridLayout>
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    25
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    26
class QListWidget;
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    27
class QLineEdit;
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    28
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    29
class HWChatWidget : public QWidget
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    30
{
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    31
  Q_OBJECT
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    32
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    33
 public:
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    34
  HWChatWidget(QWidget* parent=0);
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    35
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    36
 public slots:
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    37
  void onChatStringFromNet(const QStringList& str);
465
07eca0a2546c chatWidget with nicks ready
displacer
parents: 462
diff changeset
    38
  void nickAdded(const QString& nick);
07eca0a2546c chatWidget with nicks ready
displacer
parents: 462
diff changeset
    39
  void nickRemoved(const QString& nick);
07eca0a2546c chatWidget with nicks ready
displacer
parents: 462
diff changeset
    40
  void clear();
461
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    41
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    42
 signals:
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    43
  void chatLine(const QString& str);
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    44
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    45
 private:
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    46
  QGridLayout mainLayout;
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    47
  QListWidget* chatText;
462
91baab07b79a resizing and grid problems
displacer
parents: 461
diff changeset
    48
  QListWidget* chatNicks;
461
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    49
  QLineEdit* chatEditLine;
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    50
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    51
 private slots:
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    52
  void returnPressed();
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    53
};
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    54
105af110b0e6 chatWidget with layout
displacer
parents:
diff changeset
    55
#endif // _CHAT_WIDGET_INCLUDED