00001 #ifndef GUITABLIST_H 00002 #define GUITABLIST_H 00003 00004 #include <QTabWidget> 00005 #include <QHostAddress> 00006 #include <QVBoxLayout> 00007 #include <QHBoxLayout> 00008 #include "GUITab.h" 00009 00014 class GUITabList : public QTabWidget 00015 { 00016 Q_OBJECT 00017 00018 public: 00019 00020 GUITabList(QWidget *parent, QHostAddress broadcast, 00021 QString sm = "red", QString um = "green", QString bc = "white"); 00022 00028 void delTab(QHostAddress ip); 00029 00035 void hideTab(QHostAddress ip); 00036 00042 void showTab(QHostAddress ip); 00043 00049 void setActiveTab (QHostAddress ip); 00050 00055 GUITab* getActiveTab(); 00056 00061 GUITab* publicChat(); 00067 GUITab* tab(int index); 00068 00073 void closeTab(GUITab *tab); 00078 void closeAllPrivChat(); 00079 00086 int isCreate(QHostAddress ip); 00092 int getTabNumber(QHostAddress ip); 00093 00100 void setTabTextColor(int index, QColor col = "red" ); 00101 00102 00103 00104 00105 00106 public slots: 00107 00117 void addTab(QHostAddress ip, QString name, bool can_be_closed , QString icon); 00118 00125 void setUnactiveUser(QHostAddress host); 00126 00131 void closeActiveTab(); 00132 00133 00134 00135 private slots: 00142 void checkCBC(int index); 00143 00150 void checkOnline(int index); 00151 00152 void setDefaultIconAndColor(int index); 00153 00154 00155 00156 signals: 00161 void tabCanNotBeClose(); 00166 void tabCanBeClose(); 00171 void isOnline(); 00176 void isNotOnline(); 00181 void setDisableInputText(); 00182 00183 00184 00185 private: 00186 00187 QString um, sm, bc; 00188 00189 }; 00190 00191 #endif