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 __IRCTAB_H 00022 #define __IRCTAB_H 00023 00024 #include <qwidget.h> 00025 #include <qtextview.h> 00026 #include <qlineedit.h> 00027 #include <qlabel.h> 00028 #include <qlayout.h> 00029 #include "ircsession.h" 00030 00031 /* This is the base class for any tabs which need to be integrated into 00032 the main GUI tab widget */ 00033 00034 class IRCTab : public QWidget { 00035 Q_OBJECT 00036 public: 00037 IRCTab(QWidget *parent = 0, const char *name = 0, WFlags f = 0); 00038 /* The ID is required to store the position of this IRCTab inside the IRCTabWidget */ 00039 void setID(int id); 00040 int id(); 00041 00042 static void setUseTimeStamps(bool b); 00043 static QString appendTimestamp(const QString& tex); 00044 00045 virtual QString title() = 0; 00046 virtual IRCSession *session() = 0; 00047 virtual void appendText(QString text) = 0; 00048 signals: 00049 void changed(IRCTab *); 00050 void ping(const QString& ); 00051 void nextTab(); 00052 void prevTab(); 00053 void closeTab(); 00054 void editFocus(); 00055 00056 public slots: 00057 virtual void remove() = 0; 00058 virtual void settingsChanged() = 0; 00059 00060 protected: 00061 void showEvent( QShowEvent* ); 00062 00063 protected: 00064 QLabel *m_description; 00065 QVBoxLayout *m_layout; 00066 int m_id; 00067 public: 00068 /* Configuration shared accross all instances - contains HTML style colors (#rrggbb) */ 00069 static QString m_errorColor; 00070 static QString m_serverColor; 00071 static QString m_textColor; 00072 static QString m_backgroundColor; 00073 static QString m_selfColor; 00074 static QString m_otherColor; 00075 static QString m_notificationColor; 00076 /* Max number of lines to be displayed */ 00077 static int m_maxLines; 00078 }; 00079 00080 #endif /* __IRCTAB_H */
1.4.2