7338ecdc2e2af3a48ed65693cab15723b8090ee9
[quassel.git] / gui / channelwidget.h
1 /***************************************************************************
2  *   Copyright (C) 2005 by The Quassel Team                                *
3  *   devel@quassel-irc.org                                                 *
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; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  *                                                                         *
10  *   This program is distributed in the hope that it will be useful,       *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with this program; if not, write to the                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19  ***************************************************************************/
20
21 #ifndef _CHANNELWIDGET_H_
22 #define _CHANNELWIDGET_H_
23
24 #include "ui_channelwidget.h"
25 #include "ui_ircwidget.h"
26
27 #include "message.h"
28
29 class ChannelWidget : public QWidget {
30   Q_OBJECT
31
32   public:
33     ChannelWidget(QString netname, QString bufname, QWidget *parent = 0);
34
35     QString bufferName() { return _bufferName; }
36     QString networkName() { return _networkName; }
37   signals:
38     void sendMessage(QString, QString, QString);
39
40   public slots:
41     void recvMessage(Message);
42     void recvStatusMsg(QString msg);
43     void setTopic(QString);
44     void setNicks(QStringList);
45
46   private slots:
47     void enterPressed();
48
49   private:
50     Ui::ChannelWidget ui;
51
52     QColor stdCol, errorCol, noticeCol, joinCol, quitCol, partCol, serverCol;
53     QString _networkName;
54     QString _bufferName;
55 };
56
57 /** Temporary widget for displaying a set of ChannelWidgets. */
58 class IrcWidget : public QWidget {
59   Q_OBJECT
60
61   public:
62     IrcWidget(QWidget *parent = 0);
63
64   public slots:
65     void recvMessage(QString network, QString buffer, Message message);
66     void recvStatusMsg(QString network, QString message);
67     void setTopic(QString, QString, QString);
68     void setNicks(QString, QString, QStringList);
69
70   signals:
71     void sendMessage(QString network, QString buffer, QString message);
72
73   private slots:
74     void userInput(QString, QString, QString);
75
76   private:
77     Ui::IrcWidget ui;
78     QHash<QString, ChannelWidget *> buffers;
79
80     ChannelWidget * getBuffer(QString net, QString buf);
81 };
82
83 #endif