00001 /* 00002 OpieIRC - An embedded IRC client 00003 Copyright (C) 2002 Wenzel Jakob 00004 00005 This program is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation; either version 2 of the License, or 00008 (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 00019 */ 00020 00021 #ifndef __IRCCHANNELTAB_H 00022 #define __IRCCHANNELTAB_H 00023 00024 #include <qpopupmenu.h> 00025 #include <qpushbutton.h> 00026 #include "irctab.h" 00027 #include "ircsession.h" 00028 #include "ircmisc.h" 00029 #include "mainwindow.h" 00030 #include "ircchannellist.h" 00031 00032 #define LISTWIDTH 70 00033 00034 template <class T> class QDict; 00035 class IRCServerTab; 00036 class IRCChannelTab : public IRCTab { 00037 Q_OBJECT 00038 public: 00039 /* IRCTab implementation */ 00040 IRCChannelTab(IRCChannel *channel, IRCServerTab *parentTab, MainWindow *mainWindow, QWidget *parent = 0, const char *name = 0, WFlags f = 0); 00041 ~IRCChannelTab(); 00042 QString title(); 00043 IRCSession *session(); 00044 IRCChannel *channel(); 00045 IRCChannelList *list(); 00046 public: 00047 void appendText(QString text); 00048 static void enqueue(const QString &channel, const QString &message); 00049 public slots: 00050 void remove(); 00051 void settingsChanged(); 00052 void scrolling(); 00053 protected slots: 00054 void processCommand(); 00055 void toggleList(); 00056 void mouseButtonPressed(int mouse, QListBoxItem *item, const QPoint &point); 00057 /* Popup slots */ 00058 void popupQuery(QListBoxItem*); 00059 void popupQuery(); 00060 00061 void popupPing(); 00062 void popupVersion(); 00063 void popupWhois(); 00064 protected: 00065 IRCServerTab *m_parentTab; 00066 IRCChannel *m_channel; 00067 IRCChannelList *m_list; 00068 QPushButton *m_listButton; 00069 MainWindow *m_mainWindow; 00070 QTextView *m_textview; 00071 IRCHistoryLineEdit *m_field; 00072 QPopupMenu *m_popup; 00073 bool m_listVisible; 00074 int m_lines; 00075 static QDict<QString> m_queuedMessages; 00076 }; 00077 00078 #endif /* __IRCCHANNELTAB_H */
1.4.2